mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-28 11:49:14 +00:00
Compare commits
1 Commits
@vercel/no
...
vc-cli-run
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d44ca0d7c5 |
5
.changeset/blue-rats-know.md
Normal file
5
.changeset/blue-rats-know.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"vercel": patch
|
||||
---
|
||||
|
||||
[cli] vc env pull should add `.env*.local` to `.gitignore`
|
||||
2
.changeset/chatty-flowers-sniff.md
Normal file
2
.changeset/chatty-flowers-sniff.md
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
---
|
||||
5
.changeset/mean-windows-cheer.md
Normal file
5
.changeset/mean-windows-cheer.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'vercel': patch
|
||||
---
|
||||
|
||||
Add support for `vc dev` command with repo link
|
||||
5
.changeset/perfect-gorillas-film.md
Normal file
5
.changeset/perfect-gorillas-film.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"vercel": patch
|
||||
---
|
||||
|
||||
Move readme copy logic to a helper function for `vc link`
|
||||
5
.changeset/polite-apricots-leave.md
Normal file
5
.changeset/polite-apricots-leave.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'vercel': patch
|
||||
---
|
||||
|
||||
Add support for `vc pull` command with repo link
|
||||
5
.changeset/red-wolves-boil.md
Normal file
5
.changeset/red-wolves-boil.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'vercel': patch
|
||||
---
|
||||
|
||||
Add support for `vc build` command with repo link
|
||||
432
examples/nextjs/package-lock.json
generated
432
examples/nextjs/package-lock.json
generated
@@ -8,17 +8,17 @@
|
||||
"name": "nextjs",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"eslint": "8.43.0",
|
||||
"eslint-config-next": "13.4.7",
|
||||
"next": "13.4.7",
|
||||
"eslint": "8.41.0",
|
||||
"eslint-config-next": "13.4.4",
|
||||
"next": "13.4.4",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/runtime": {
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz",
|
||||
"integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==",
|
||||
"version": "7.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz",
|
||||
"integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==",
|
||||
"dependencies": {
|
||||
"regenerator-runtime": "^0.13.11"
|
||||
},
|
||||
@@ -71,17 +71,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/js": {
|
||||
"version": "8.43.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.43.0.tgz",
|
||||
"integrity": "sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg==",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/config-array": {
|
||||
"version": "0.11.10",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz",
|
||||
"integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==",
|
||||
"version": "0.11.8",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz",
|
||||
"integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==",
|
||||
"dependencies": {
|
||||
"@humanwhocodes/object-schema": "^1.2.1",
|
||||
"debug": "^4.1.1",
|
||||
@@ -109,22 +109,22 @@
|
||||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
|
||||
},
|
||||
"node_modules/@next/env": {
|
||||
"version": "13.4.7",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.4.7.tgz",
|
||||
"integrity": "sha512-ZlbiFulnwiFsW9UV1ku1OvX/oyIPLtMk9p/nnvDSwI0s7vSoZdRtxXNsaO+ZXrLv/pMbXVGq4lL8TbY9iuGmVw=="
|
||||
"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.7",
|
||||
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.4.7.tgz",
|
||||
"integrity": "sha512-ANEPltxzXbyyG7CvqxdY4PmeM5+RyWdAJGufTHnU+LA/i3J6IDV2r8Z4onKwskwKEhwqzz5lMaSYGGXLyHX+mg==",
|
||||
"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.7",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.4.7.tgz",
|
||||
"integrity": "sha512-VZTxPv1b59KGiv/pZHTO5Gbsdeoxcj2rU2cqJu03btMhHpn3vwzEK0gUSVC/XW96aeGO67X+cMahhwHzef24/w==",
|
||||
"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.7",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.4.7.tgz",
|
||||
"integrity": "sha512-gO2bw+2Ymmga+QYujjvDz9955xvYGrWofmxTq7m70b9pDPvl7aDFABJOZ2a8SRCuSNB5mXU8eTOmVVwyp/nAew==",
|
||||
"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.7",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.4.7.tgz",
|
||||
"integrity": "sha512-6cqp3vf1eHxjIDhEOc7Mh/s8z1cwc/l5B6ZNkOofmZVyu1zsbEM5Hmx64s12Rd9AYgGoiCz4OJ4M/oRnkE16/Q==",
|
||||
"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.7",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.4.7.tgz",
|
||||
"integrity": "sha512-T1kD2FWOEy5WPidOn1si0rYmWORNch4a/NR52Ghyp4q7KyxOCuiOfZzyhVC5tsLIBDH3+cNdB5DkD9afpNDaOw==",
|
||||
"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.7",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.4.7.tgz",
|
||||
"integrity": "sha512-zaEC+iEiAHNdhl6fuwl0H0shnTzQoAoJiDYBUze8QTntE/GNPfTYpYboxF5LRYIjBwETUatvE0T64W6SKDipvg==",
|
||||
"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.7",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.4.7.tgz",
|
||||
"integrity": "sha512-X6r12F8d8SKAtYJqLZBBMIwEqcTRvUdVm+xIq+l6pJqlgT2tNsLLf2i5Cl88xSsIytBICGsCNNHd+siD2fbWBA==",
|
||||
"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.7",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.4.7.tgz",
|
||||
"integrity": "sha512-NPnmnV+vEIxnu6SUvjnuaWRglZzw4ox5n/MQTxeUhb5iwVWFedolPFebMNwgrWu4AELwvTdGtWjqof53AiWHcw==",
|
||||
"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.7",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.4.7.tgz",
|
||||
"integrity": "sha512-6Hxijm6/a8XqLQpOOf/XuwWRhcuc/g4rBB2oxjgCMuV9Xlr2bLs5+lXyh8w9YbAUMYR3iC9mgOlXbHa79elmXw==",
|
||||
"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.7",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.7.tgz",
|
||||
"integrity": "sha512-sW9Yt36Db1nXJL+mTr2Wo0y+VkPWeYhygvcHj1FF0srVtV+VoDjxleKtny21QHaG05zdeZnw2fCtf2+dEqgwqA==",
|
||||
"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"
|
||||
],
|
||||
@@ -308,9 +308,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/eslint-patch": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.3.2.tgz",
|
||||
"integrity": "sha512-V+MvGwaHH03hYhY+k6Ef/xKd6RYlc4q8WBx+2ANmipHJcKuktNcI/NgEsJgdSUF6Lw32njT6OnrRsKYCdgHjYw=="
|
||||
"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.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.60.0.tgz",
|
||||
"integrity": "sha512-jBONcBsDJ9UoTWrARkRRCgDz6wUggmH5RpQVlt7BimSwaTkTjwypGzKORXbR4/2Hqjk9hgwlon2rVQAjWNpkyQ==",
|
||||
"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.60.0",
|
||||
"@typescript-eslint/types": "5.60.0",
|
||||
"@typescript-eslint/typescript-estree": "5.60.0",
|
||||
"@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.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.60.0.tgz",
|
||||
"integrity": "sha512-hakuzcxPwXi2ihf9WQu1BbRj1e/Pd8ZZwVTG9kfbxAMZstKz8/9OoexIwnmLzShtsdap5U/CoQGRCWlSuPbYxQ==",
|
||||
"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.60.0",
|
||||
"@typescript-eslint/visitor-keys": "5.60.0"
|
||||
"@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.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.60.0.tgz",
|
||||
"integrity": "sha512-ascOuoCpNZBccFVNJRSC6rPq4EmJ2NkuoKnd6LDNyAQmdDnziAtxbCGWCbefG1CNzmDvd05zO36AmB7H8RzKPA==",
|
||||
"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.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.0.tgz",
|
||||
"integrity": "sha512-R43thAuwarC99SnvrBmh26tc7F6sPa2B3evkXp/8q954kYL6Ro56AwASYWtEEi+4j09GbiNAHqYwNNZuNlARGQ==",
|
||||
"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.60.0",
|
||||
"@typescript-eslint/visitor-keys": "5.60.0",
|
||||
"@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.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.0.tgz",
|
||||
"integrity": "sha512-wm9Uz71SbCyhUKgcaPRauBdTegUyY/ZWl8gLwD/i/ybJqscrrdVSFImpvUz16BLPChIeKBK5Fa9s6KDQjsjyWw==",
|
||||
"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.60.0",
|
||||
"@typescript-eslint/types": "5.59.7",
|
||||
"eslint-visitor-keys": "^3.3.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -422,9 +422,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.9.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz",
|
||||
"integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==",
|
||||
"version": "8.8.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
|
||||
"integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@@ -483,11 +483,11 @@
|
||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
|
||||
},
|
||||
"node_modules/aria-query": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.2.1.tgz",
|
||||
"integrity": "sha512-7uFg4b+lETFgdaJyETnILsXgnnzVnkHcgRbwbPwevm5x/LmUlt3MjczMRe1zg824iBgXZNRPTBftNYyRSKLp2g==",
|
||||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz",
|
||||
"integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==",
|
||||
"dependencies": {
|
||||
"dequal": "^2.0.3"
|
||||
"deep-equal": "^2.0.5"
|
||||
}
|
||||
},
|
||||
"node_modules/array-buffer-byte-length": {
|
||||
@@ -599,11 +599,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/axobject-query": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz",
|
||||
"integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==",
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz",
|
||||
"integrity": "sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==",
|
||||
"dependencies": {
|
||||
"dequal": "^2.0.3"
|
||||
"deep-equal": "^2.0.5"
|
||||
}
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
@@ -696,9 +696,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001506",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001506.tgz",
|
||||
"integrity": "sha512-6XNEcpygZMCKaufIcgpQNZNf00GEqc7VQON+9Rd0K1bMYo8xhMZRAo5zpbnbMNizi4YNgIDAFrdykWsvY3H4Hw==",
|
||||
"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",
|
||||
@@ -789,6 +789,34 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/deep-equal": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.1.tgz",
|
||||
"integrity": "sha512-lKdkdV6EOGoVn65XaOsPdH4rMxTZOnmFyuIkMjM1i5HHCbfjC97dawgTAy0deYNfuqUqW+Q5VrVaQYtUpSd6yQ==",
|
||||
"dependencies": {
|
||||
"array-buffer-byte-length": "^1.0.0",
|
||||
"call-bind": "^1.0.2",
|
||||
"es-get-iterator": "^1.1.3",
|
||||
"get-intrinsic": "^1.2.0",
|
||||
"is-arguments": "^1.1.1",
|
||||
"is-array-buffer": "^3.0.2",
|
||||
"is-date-object": "^1.0.5",
|
||||
"is-regex": "^1.1.4",
|
||||
"is-shared-array-buffer": "^1.0.2",
|
||||
"isarray": "^2.0.5",
|
||||
"object-is": "^1.1.5",
|
||||
"object-keys": "^1.1.1",
|
||||
"object.assign": "^4.1.4",
|
||||
"regexp.prototype.flags": "^1.5.0",
|
||||
"side-channel": "^1.0.4",
|
||||
"which-boxed-primitive": "^1.0.2",
|
||||
"which-collection": "^1.0.1",
|
||||
"which-typed-array": "^1.1.9"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/deep-is": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
|
||||
@@ -852,14 +880,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/dequal": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
|
||||
"integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/dir-glob": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
||||
@@ -888,9 +908,9 @@
|
||||
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="
|
||||
},
|
||||
"node_modules/enhanced-resolve": {
|
||||
"version": "5.15.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz",
|
||||
"integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==",
|
||||
"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"
|
||||
@@ -946,6 +966,25 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/es-get-iterator": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz",
|
||||
"integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"get-intrinsic": "^1.1.3",
|
||||
"has-symbols": "^1.0.3",
|
||||
"is-arguments": "^1.1.1",
|
||||
"is-map": "^2.0.2",
|
||||
"is-set": "^2.0.2",
|
||||
"is-string": "^1.0.7",
|
||||
"isarray": "^2.0.5",
|
||||
"stop-iteration-iterator": "^1.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/es-set-tostringtag": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz",
|
||||
@@ -995,15 +1034,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "8.43.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.43.0.tgz",
|
||||
"integrity": "sha512-aaCpf2JqqKesMFGgmRPessmVKjcGXqdlAYLLC3THM8t5nBRZRQ+st5WM/hoJXkdioEXLLbXgclUpM0TXo5HX5Q==",
|
||||
"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.3",
|
||||
"@eslint/js": "8.43.0",
|
||||
"@humanwhocodes/config-array": "^0.11.10",
|
||||
"@eslint/js": "8.41.0",
|
||||
"@humanwhocodes/config-array": "^0.11.8",
|
||||
"@humanwhocodes/module-importer": "^1.0.1",
|
||||
"@nodelib/fs.walk": "^1.2.8",
|
||||
"ajv": "^6.10.0",
|
||||
@@ -1050,11 +1089,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-config-next": {
|
||||
"version": "13.4.7",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.4.7.tgz",
|
||||
"integrity": "sha512-+IRAyD0+J1MZaTi9RQMPUfr6Q+GCZ1wOkK6XM52Vokh7VI4R6YFGOFzdkEFHl4ZyIX4FKa5vcwUP2WscSFNjNQ==",
|
||||
"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.7",
|
||||
"@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",
|
||||
@@ -1118,9 +1157,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-import-resolver-typescript/node_modules/globby": {
|
||||
"version": "13.2.0",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-13.2.0.tgz",
|
||||
"integrity": "sha512-jWsQfayf13NvqKUIL3Ta+CIqMnvlaIDFveWE/dpOZ9+3AMEJozsxDvKA02zync9UuvOM8rOXzsD5GqKP4OnWPQ==",
|
||||
"version": "13.1.4",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-13.1.4.tgz",
|
||||
"integrity": "sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==",
|
||||
"dependencies": {
|
||||
"dir-glob": "^3.0.1",
|
||||
"fast-glob": "^3.2.11",
|
||||
@@ -1625,12 +1664,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/get-tsconfig": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.6.0.tgz",
|
||||
"integrity": "sha512-lgbo68hHTQnFddybKbbs/RDRJnJT5YyGy2kQzVwbq+g67X73i+5MVTval34QxGkOe9X5Ujf1UYpCaphLyltjEg==",
|
||||
"dependencies": {
|
||||
"resolve-pkg-maps": "^1.0.0"
|
||||
},
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.5.0.tgz",
|
||||
"integrity": "sha512-MjhiaIWCJ1sAU4pIQ5i5OfOuHHxVo1oYeNsWTON7jxYkod8pHocXeh+SSbmu5OZZZK73B6cbJ2XADzXehLyovQ==",
|
||||
"funding": {
|
||||
"url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
|
||||
}
|
||||
@@ -1665,11 +1701,6 @@
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/glob-to-regexp": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",
|
||||
"integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw=="
|
||||
},
|
||||
"node_modules/globals": {
|
||||
"version": "13.20.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz",
|
||||
@@ -1878,6 +1909,21 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/is-arguments": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz",
|
||||
"integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"has-tostringtag": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-array-buffer": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz",
|
||||
@@ -2003,6 +2049,14 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/is-map": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz",
|
||||
"integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-negative-zero": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz",
|
||||
@@ -2059,6 +2113,14 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-set": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz",
|
||||
"integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-shared-array-buffer": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz",
|
||||
@@ -2127,6 +2189,14 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-weakmap": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz",
|
||||
"integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-weakref": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz",
|
||||
@@ -2138,6 +2208,18 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-weakset": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz",
|
||||
"integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"get-intrinsic": "^1.1.1"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-wsl": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
|
||||
@@ -2163,6 +2245,11 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/isarray": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
|
||||
"integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="
|
||||
},
|
||||
"node_modules/isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||
@@ -2366,17 +2453,16 @@
|
||||
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="
|
||||
},
|
||||
"node_modules/next": {
|
||||
"version": "13.4.7",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.4.7.tgz",
|
||||
"integrity": "sha512-M8z3k9VmG51SRT6v5uDKdJXcAqLzP3C+vaKfLIAM0Mhx1um1G7MDnO63+m52qPdZfrTFzMZNzfsgvm3ghuVHIQ==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.4.4.tgz",
|
||||
"integrity": "sha512-C5S0ysM0Ily9McL4Jb48nOQHT1BukOWI59uC3X/xCMlYIh9rJZCv7nzG92J6e1cOBqQbKovlpgvHWFmz4eKKEA==",
|
||||
"dependencies": {
|
||||
"@next/env": "13.4.7",
|
||||
"@next/env": "13.4.4",
|
||||
"@swc/helpers": "0.5.1",
|
||||
"busboy": "1.6.0",
|
||||
"caniuse-lite": "^1.0.30001406",
|
||||
"postcss": "8.4.14",
|
||||
"styled-jsx": "5.1.1",
|
||||
"watchpack": "2.4.0",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
"bin": {
|
||||
@@ -2386,15 +2472,15 @@
|
||||
"node": ">=16.8.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@next/swc-darwin-arm64": "13.4.7",
|
||||
"@next/swc-darwin-x64": "13.4.7",
|
||||
"@next/swc-linux-arm64-gnu": "13.4.7",
|
||||
"@next/swc-linux-arm64-musl": "13.4.7",
|
||||
"@next/swc-linux-x64-gnu": "13.4.7",
|
||||
"@next/swc-linux-x64-musl": "13.4.7",
|
||||
"@next/swc-win32-arm64-msvc": "13.4.7",
|
||||
"@next/swc-win32-ia32-msvc": "13.4.7",
|
||||
"@next/swc-win32-x64-msvc": "13.4.7"
|
||||
"@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",
|
||||
@@ -2456,6 +2542,21 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/object-is": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz",
|
||||
"integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"define-properties": "^1.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/object-keys": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
|
||||
@@ -2826,14 +2927,6 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/resolve-pkg-maps": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
|
||||
"integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
|
||||
"funding": {
|
||||
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/reusify": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
|
||||
@@ -2997,9 +3090,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.5.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz",
|
||||
"integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==",
|
||||
"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"
|
||||
},
|
||||
@@ -3063,6 +3156,17 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/stop-iteration-iterator": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz",
|
||||
"integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==",
|
||||
"dependencies": {
|
||||
"internal-slot": "^1.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/streamsearch": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
|
||||
@@ -3278,9 +3382,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.5.3",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz",
|
||||
"integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w=="
|
||||
"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",
|
||||
@@ -3337,16 +3441,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz",
|
||||
"integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==",
|
||||
"version": "5.0.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz",
|
||||
"integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
"node": ">=12.20"
|
||||
}
|
||||
},
|
||||
"node_modules/unbox-primitive": {
|
||||
@@ -3379,18 +3483,6 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/watchpack": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
|
||||
"integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==",
|
||||
"dependencies": {
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
"graceful-fs": "^4.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
@@ -3420,6 +3512,20 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/which-collection": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz",
|
||||
"integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==",
|
||||
"dependencies": {
|
||||
"is-map": "^2.0.1",
|
||||
"is-set": "^2.0.1",
|
||||
"is-weakmap": "^2.0.1",
|
||||
"is-weakset": "^2.0.1"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/which-typed-array": {
|
||||
"version": "1.1.9",
|
||||
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz",
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint": "8.43.0",
|
||||
"eslint-config-next": "13.4.7",
|
||||
"next": "13.4.7",
|
||||
"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.4.3"
|
||||
"@vercel/frameworks": "1.4.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
extends: ["@remix-run/eslint-config", "@remix-run/eslint-config/node"],
|
||||
};
|
||||
|
||||
7
examples/remix/.gitignore
vendored
7
examples/remix/.gitignore
vendored
@@ -1,12 +1,11 @@
|
||||
node_modules
|
||||
|
||||
/.cache
|
||||
/build
|
||||
/public/build
|
||||
.cache
|
||||
.env
|
||||
|
||||
.vercel
|
||||
.output
|
||||
|
||||
/build/
|
||||
/public/build
|
||||
/api/index.js
|
||||
/api/index.js.map
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { cssBundleHref } from "@remix-run/css-bundle";
|
||||
import type { MetaFunction } from "@vercel/remix";
|
||||
import {
|
||||
Links,
|
||||
LiveReload,
|
||||
@@ -8,18 +8,17 @@ import {
|
||||
ScrollRestoration,
|
||||
} from "@remix-run/react";
|
||||
import { Analytics } from "@vercel/analytics/react";
|
||||
import type { LinksFunction } from "@vercel/remix";
|
||||
|
||||
export const links: LinksFunction = () => [
|
||||
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
|
||||
];
|
||||
export const meta: MetaFunction = () => ({
|
||||
charset: "utf-8",
|
||||
title: "New Remix App",
|
||||
viewport: "width=device-width,initial-scale=1",
|
||||
});
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charSet="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<Meta />
|
||||
<Links />
|
||||
</head>
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import type { V2_MetaFunction } from "@vercel/remix";
|
||||
|
||||
export const config = { runtime: "edge" };
|
||||
|
||||
export const meta: V2_MetaFunction = () => [{ title: "Remix@Edge | New Remix App" }];
|
||||
|
||||
export default function Edge() {
|
||||
return (
|
||||
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
import type { V2_MetaFunction } from "@vercel/remix";
|
||||
|
||||
export const meta: V2_MetaFunction = () => [{ title: "New Remix App" }];
|
||||
|
||||
export default function Index() {
|
||||
return (
|
||||
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
|
||||
@@ -3,28 +3,24 @@
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"build": "remix build",
|
||||
"dev": "remix dev",
|
||||
"start": "remix-serve build",
|
||||
"typecheck": "tsc"
|
||||
"dev": "remix dev"
|
||||
},
|
||||
"dependencies": {
|
||||
"@remix-run/css-bundle": "^1.18.0",
|
||||
"@remix-run/node": "^1.18.0",
|
||||
"@remix-run/react": "^1.18.0",
|
||||
"@remix-run/serve": "^1.18.0",
|
||||
"@remix-run/node": "^1.15.0",
|
||||
"@remix-run/react": "^1.15.0",
|
||||
"@remix-run/serve": "^1.15.0",
|
||||
"@vercel/analytics": "^0.1.11",
|
||||
"@vercel/remix": "^1.18.0",
|
||||
"isbot": "^3.6.8",
|
||||
"@vercel/remix": "^1.15.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@remix-run/dev": "^1.18.0",
|
||||
"@remix-run/eslint-config": "^1.18.0",
|
||||
"@remix-run/dev": "^1.15.0",
|
||||
"@remix-run/eslint-config": "^1.15.0",
|
||||
"@types/react": "^18.0.25",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"eslint": "^8.28.0",
|
||||
"typescript": "^5.1.3"
|
||||
"typescript": "^4.9.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
|
||||
7492
examples/remix/pnpm-lock.yaml
generated
Normal file
7492
examples/remix/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,8 @@
|
||||
/** @type {import('@remix-run/dev').AppConfig} */
|
||||
/**
|
||||
* @type {import('@remix-run/dev').AppConfig}
|
||||
*/
|
||||
module.exports = {
|
||||
future: {
|
||||
v2_dev: true,
|
||||
v2_errorBoundary: true,
|
||||
v2_headers: true,
|
||||
v2_meta: true,
|
||||
v2_normalizeFormMethod: true,
|
||||
v2_routeConvention: true,
|
||||
},
|
||||
ignoredRouteFiles: ["**/.*"],
|
||||
serverModuleFormat: "cjs",
|
||||
ignoredRouteFiles: ['**/.*'],
|
||||
// appDirectory: "app",
|
||||
// assetsBuildDirectory: "public/build",
|
||||
// serverBuildPath: "build/index.js",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Saber Example
|
||||
|
||||
This directory is a brief example of a [Saber](https://saber.egoist.dev) site that can be deployed to Vercel with zero configuration.
|
||||
This directory is a brief example of a [Saber](https://saber.land) site that can be deployed to Vercel with zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
|
||||
@@ -5,4 +5,4 @@ layout: page
|
||||
|
||||
This is the Saber port of the base Jekyll theme. Check out the [GitHub project](https://github.com/egoist/saber-theme-minima) for detailed usages.
|
||||
|
||||
You can find out more info about customizing your theme, as well as basic Saber usage documentation at https://saber.egoist.dev
|
||||
You can find out more info about customizing your theme, as well as basic Saber usage documentation at https://saber.land
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
# @vercel-internals/constants
|
||||
|
||||
## 1.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`346892210`](https://github.com/vercel/vercel/commit/3468922108f411482a72acd0331f0f2ee52a6d4c)]:
|
||||
- @vercel/build-utils@6.8.0
|
||||
|
||||
## 1.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/constants",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.2",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.8.0",
|
||||
"@vercel/build-utils": "6.7.5",
|
||||
"@vercel/routing-utils": "2.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
# @vercel-internals/types
|
||||
|
||||
## 1.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`346892210`](https://github.com/vercel/vercel/commit/3468922108f411482a72acd0331f0f2ee52a6d4c)]:
|
||||
- @vercel/build-utils@6.8.0
|
||||
- @vercel-internals/constants@1.0.3
|
||||
|
||||
## 1.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/types",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.2",
|
||||
"types": "index.d.ts",
|
||||
"main": "index.d.ts",
|
||||
"dependencies": {
|
||||
"@types/node": "14.14.31",
|
||||
"@vercel-internals/constants": "1.0.3",
|
||||
"@vercel/build-utils": "6.8.0",
|
||||
"@vercel-internals/constants": "1.0.2",
|
||||
"@vercel/build-utils": "6.7.5",
|
||||
"@vercel/routing-utils": "2.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
13
lerna.json
Normal file
13
lerna.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"npmClient": "pnpm",
|
||||
"useWorkspaces": true,
|
||||
"packages": ["packages/*"],
|
||||
"command": {
|
||||
"publish": {
|
||||
"npmClient": "npm",
|
||||
"allowBranch": ["main"],
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
}
|
||||
},
|
||||
"version": "independent"
|
||||
}
|
||||
@@ -32,7 +32,7 @@
|
||||
"source-map-support": "0.5.12",
|
||||
"ts-eager": "2.0.2",
|
||||
"ts-jest": "29.1.0",
|
||||
"turbo": "1.10.6",
|
||||
"turbo": "1.10.1",
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
# @vercel/build-utils
|
||||
|
||||
## 6.8.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Add `getNodeBinPaths()` and `traverseUpDirectories()` functions ([#10150](https://github.com/vercel/vercel/pull/10150))
|
||||
|
||||
## 6.7.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "6.8.0",
|
||||
"version": "6.7.5",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
|
||||
@@ -44,33 +44,23 @@ export interface ScanParentDirsResult {
|
||||
lockfileVersion?: number;
|
||||
}
|
||||
|
||||
export interface TraverseUpDirectoriesProps {
|
||||
/**
|
||||
* The directory to start iterating from, typically the same directory of the entrypoint.
|
||||
*/
|
||||
start: string;
|
||||
export interface WalkParentDirsProps {
|
||||
/**
|
||||
* The highest directory, typically the workPath root of the project.
|
||||
* If this directory is reached and it doesn't contain the file, null is returned.
|
||||
*/
|
||||
base?: string;
|
||||
}
|
||||
|
||||
export interface WalkParentDirsProps
|
||||
extends Required<TraverseUpDirectoriesProps> {
|
||||
base: string;
|
||||
/**
|
||||
* The directory to start searching, typically the same directory of the entrypoint.
|
||||
* If this directory doesn't contain the file, the parent is checked, etc.
|
||||
*/
|
||||
start: string;
|
||||
/**
|
||||
* The name of the file to search for, typically `package.json` or `Gemfile`.
|
||||
*/
|
||||
filename: string;
|
||||
}
|
||||
|
||||
export interface WalkParentDirsMultiProps
|
||||
extends Required<TraverseUpDirectoriesProps> {
|
||||
/**
|
||||
* The name of the file to search for, typically `package.json` or `Gemfile`.
|
||||
*/
|
||||
filenames: string[];
|
||||
}
|
||||
|
||||
export interface SpawnOptionsExtended extends SpawnOptions {
|
||||
/**
|
||||
* Pretty formatted command that is being spawned for logging purposes.
|
||||
@@ -141,24 +131,6 @@ export async function execCommand(command: string, options: SpawnOptions = {}) {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function* traverseUpDirectories({
|
||||
start,
|
||||
base,
|
||||
}: TraverseUpDirectoriesProps) {
|
||||
let current: string | undefined = path.normalize(start);
|
||||
const normalizedRoot = base ? path.normalize(base) : undefined;
|
||||
while (current) {
|
||||
yield current;
|
||||
if (current === normalizedRoot) break;
|
||||
// Go up one directory
|
||||
const next = path.join(current, '..');
|
||||
current = next === current ? undefined : next;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `getNodeBinPaths()` instead.
|
||||
*/
|
||||
export async function getNodeBinPath({
|
||||
cwd,
|
||||
}: {
|
||||
@@ -169,15 +141,6 @@ export async function getNodeBinPath({
|
||||
return path.join(dir, 'node_modules', '.bin');
|
||||
}
|
||||
|
||||
export function getNodeBinPaths({
|
||||
start,
|
||||
base,
|
||||
}: TraverseUpDirectoriesProps): string[] {
|
||||
return Array.from(traverseUpDirectories({ start, base })).map(dir =>
|
||||
path.join(dir, 'node_modules/.bin')
|
||||
);
|
||||
}
|
||||
|
||||
async function chmodPlusX(fsPath: string) {
|
||||
const s = await fs.stat(fsPath);
|
||||
const newMode = s.mode | 64 | 8 | 1; // eslint-disable-line no-bitwise
|
||||
@@ -334,14 +297,22 @@ export async function walkParentDirs({
|
||||
}: WalkParentDirsProps): Promise<string | null> {
|
||||
assert(path.isAbsolute(base), 'Expected "base" to be absolute path');
|
||||
assert(path.isAbsolute(start), 'Expected "start" to be absolute path');
|
||||
let parent = '';
|
||||
|
||||
for (const dir of traverseUpDirectories({ start, base })) {
|
||||
const fullPath = path.join(dir, filename);
|
||||
for (let current = start; base.length <= current.length; current = parent) {
|
||||
const fullPath = path.join(current, filename);
|
||||
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
if (await fs.pathExists(fullPath)) {
|
||||
return fullPath;
|
||||
}
|
||||
|
||||
parent = path.dirname(current);
|
||||
|
||||
if (parent === current) {
|
||||
// Reached root directory of the filesystem
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -351,9 +322,14 @@ async function walkParentDirsMulti({
|
||||
base,
|
||||
start,
|
||||
filenames,
|
||||
}: WalkParentDirsMultiProps): Promise<(string | undefined)[]> {
|
||||
for (const dir of traverseUpDirectories({ start, base })) {
|
||||
const fullPaths = filenames.map(f => path.join(dir, f));
|
||||
}: {
|
||||
base: string;
|
||||
start: string;
|
||||
filenames: string[];
|
||||
}): Promise<(string | undefined)[]> {
|
||||
let parent = '';
|
||||
for (let current = start; base.length <= current.length; current = parent) {
|
||||
const fullPaths = filenames.map(f => path.join(current, f));
|
||||
const existResults = await Promise.all(
|
||||
fullPaths.map(f => fs.pathExists(f))
|
||||
);
|
||||
@@ -362,6 +338,13 @@ async function walkParentDirsMulti({
|
||||
if (foundOneOrMore) {
|
||||
return fullPaths.map((f, i) => (existResults[i] ? f : undefined));
|
||||
}
|
||||
|
||||
parent = path.dirname(current);
|
||||
|
||||
if (parent === current) {
|
||||
// Reached root directory of the filesystem
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
|
||||
@@ -30,9 +30,7 @@ import {
|
||||
getNodeVersion,
|
||||
getSpawnOptions,
|
||||
getNodeBinPath,
|
||||
getNodeBinPaths,
|
||||
scanParentDirs,
|
||||
traverseUpDirectories,
|
||||
} from './fs/run-user-scripts';
|
||||
import {
|
||||
getLatestNodeVersion,
|
||||
@@ -70,7 +68,6 @@ export {
|
||||
spawnCommand,
|
||||
walkParentDirs,
|
||||
getNodeBinPath,
|
||||
getNodeBinPaths,
|
||||
runNpmInstall,
|
||||
runBundleInstall,
|
||||
runPipInstall,
|
||||
@@ -92,7 +89,6 @@ export {
|
||||
getIgnoreFilter,
|
||||
cloneEnv,
|
||||
hardLinkDir,
|
||||
traverseUpDirectories,
|
||||
validateNpmrc,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import { join } from 'path';
|
||||
import { getNodeBinPaths } from '../src/fs/run-user-scripts';
|
||||
|
||||
describe('getNodeBinPaths()', () => {
|
||||
const cwd = process.cwd();
|
||||
|
||||
it('should return array of `node_modules/.bin` paths', () => {
|
||||
const start = join(cwd, 'foo/bar/baz');
|
||||
const paths = getNodeBinPaths({ start, base: cwd });
|
||||
expect(paths).toEqual([
|
||||
join(cwd, 'foo/bar/baz/node_modules/.bin'),
|
||||
join(cwd, 'foo/bar/node_modules/.bin'),
|
||||
join(cwd, 'foo/node_modules/.bin'),
|
||||
join(cwd, 'node_modules/.bin'),
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -1,50 +0,0 @@
|
||||
import { traverseUpDirectories } from '../src/fs/run-user-scripts';
|
||||
|
||||
const isWindows = process.platform === 'win32';
|
||||
|
||||
describe('traverseUpDirectories()', () => {
|
||||
test.each(
|
||||
isWindows
|
||||
? [
|
||||
{
|
||||
start: 'C:\\foo\\bar\\baz',
|
||||
expected: ['C:\\foo\\bar\\baz', 'C:\\foo\\bar', 'C:\\foo', 'C:\\'],
|
||||
},
|
||||
{
|
||||
start: 'C:\\foo\\..\\bar\\.\\baz',
|
||||
expected: ['C:\\bar\\baz', 'C:\\bar', 'C:\\'],
|
||||
},
|
||||
{
|
||||
start: 'C:\\foo\\bar\\baz\\another',
|
||||
base: 'C:\\foo\\bar',
|
||||
expected: [
|
||||
'C:\\foo\\bar\\baz\\another',
|
||||
'C:\\foo\\bar\\baz',
|
||||
'C:\\foo\\bar',
|
||||
],
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
start: '/foo/bar/baz',
|
||||
expected: ['/foo/bar/baz', '/foo/bar', '/foo', '/'],
|
||||
},
|
||||
{
|
||||
start: '/foo/../bar/./baz',
|
||||
expected: ['/bar/baz', '/bar', '/'],
|
||||
},
|
||||
{
|
||||
start: '/foo/bar/baz/another',
|
||||
base: '/foo/bar',
|
||||
expected: ['/foo/bar/baz/another', '/foo/bar/baz', '/foo/bar'],
|
||||
},
|
||||
]
|
||||
)(
|
||||
'should traverse start="$start", base="$base"',
|
||||
({ start, base, expected }) => {
|
||||
expect(Array.from(traverseUpDirectories({ start, base }))).toEqual(
|
||||
expected
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -1,57 +1,5 @@
|
||||
# vercel
|
||||
|
||||
## 31.0.0
|
||||
|
||||
### Major Changes
|
||||
|
||||
- Update `vc dev` redirect response to match production behavior ([#10143](https://github.com/vercel/vercel/pull/10143))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- require `--yes` to promote preview deployment ([#10135](https://github.com/vercel/vercel/pull/10135))
|
||||
|
||||
- [cli] Optimize write build result for vc build ([#10154](https://github.com/vercel/vercel/pull/10154))
|
||||
|
||||
- Only show relevant Project matches in Project selector ([#10114](https://github.com/vercel/vercel/pull/10114))
|
||||
|
||||
- [cli] Fix error message when token is invalid ([#10131](https://github.com/vercel/vercel/pull/10131))
|
||||
|
||||
- Updated dependencies [[`e4895d979`](https://github.com/vercel/vercel/commit/e4895d979b57e369e0618481c5974243887d72cc), [`346892210`](https://github.com/vercel/vercel/commit/3468922108f411482a72acd0331f0f2ee52a6d4c), [`346892210`](https://github.com/vercel/vercel/commit/3468922108f411482a72acd0331f0f2ee52a6d4c), [`a6de052ed`](https://github.com/vercel/vercel/commit/a6de052ed2f09cc80bf4c2d0f06bedd267a63cdc)]:
|
||||
- @vercel/next@3.8.7
|
||||
- @vercel/static-build@1.3.38
|
||||
- @vercel/build-utils@6.8.0
|
||||
- @vercel/remix-builder@1.8.15
|
||||
- @vercel/node@2.15.3
|
||||
|
||||
## 30.2.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [cli] do not force auto-assign value on deployments ([#10110](https://github.com/vercel/vercel/pull/10110))
|
||||
|
||||
- Updated dependencies [[`91406abdb`](https://github.com/vercel/vercel/commit/91406abdb0c332152fc6c7c1e4bd3a872b084434), [`2230ea6cc`](https://github.com/vercel/vercel/commit/2230ea6cc1b84c1f03227a4e197b7684635b5955), [`8b3a4146a`](https://github.com/vercel/vercel/commit/8b3a4146af68d2b7288c80a5b919d832dba929b5)]:
|
||||
- @vercel/node@2.15.2
|
||||
- @vercel/remix-builder@1.8.14
|
||||
- @vercel/static-build@1.3.37
|
||||
|
||||
## 30.2.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [cli] vc env pull should add `.env*.local` to `.gitignore` ([#10085](https://github.com/vercel/vercel/pull/10085))
|
||||
|
||||
- [cli] Fix team validation bug where you are apart of a team ([#10092](https://github.com/vercel/vercel/pull/10092))
|
||||
|
||||
- Add support for `vc dev` command with repo link ([#10082](https://github.com/vercel/vercel/pull/10082))
|
||||
|
||||
- Add support for `vc deploy --prebuilt` command with repo link ([#10083](https://github.com/vercel/vercel/pull/10083))
|
||||
|
||||
- Move readme copy logic to a helper function for `vc link` ([#10084](https://github.com/vercel/vercel/pull/10084))
|
||||
|
||||
- Add support for `vc pull` command with repo link ([#10078](https://github.com/vercel/vercel/pull/10078))
|
||||
|
||||
- Add support for `vc build` command with repo link ([#10075](https://github.com/vercel/vercel/pull/10075))
|
||||
|
||||
## 30.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "31.0.0",
|
||||
"version": "30.2.1",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -32,20 +32,20 @@
|
||||
"node": ">= 14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.8.0",
|
||||
"@vercel/build-utils": "6.7.5",
|
||||
"@vercel/go": "2.5.1",
|
||||
"@vercel/hydrogen": "0.0.64",
|
||||
"@vercel/next": "3.8.7",
|
||||
"@vercel/node": "2.15.3",
|
||||
"@vercel/next": "3.8.6",
|
||||
"@vercel/node": "2.15.1",
|
||||
"@vercel/python": "3.1.60",
|
||||
"@vercel/redwood": "1.1.15",
|
||||
"@vercel/remix-builder": "1.8.15",
|
||||
"@vercel/remix-builder": "1.8.13",
|
||||
"@vercel/ruby": "1.3.76",
|
||||
"@vercel/static-build": "1.3.38"
|
||||
"@vercel/static-build": "1.3.36"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alex_neo/jest-expect-message": "1.0.5",
|
||||
"@edge-runtime/node-utils": "2.1.0",
|
||||
"@edge-runtime/node-utils": "2.0.3",
|
||||
"@next/env": "11.1.2",
|
||||
"@sentry/node": "5.5.0",
|
||||
"@sindresorhus/slugify": "0.11.0",
|
||||
@@ -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": "1.0.3",
|
||||
"@vercel-internals/constants": "1.0.2",
|
||||
"@vercel-internals/get-package-json": "1.0.0",
|
||||
"@vercel-internals/types": "1.0.3",
|
||||
"@vercel/client": "12.6.3",
|
||||
"@vercel-internals/types": "1.0.2",
|
||||
"@vercel/client": "12.6.2",
|
||||
"@vercel/error-utils": "1.0.10",
|
||||
"@vercel/frameworks": "1.4.3",
|
||||
"@vercel/fs-detectors": "4.0.1",
|
||||
"@vercel/frameworks": "1.4.2",
|
||||
"@vercel/fs-detectors": "3.9.3",
|
||||
"@vercel/fun": "1.0.4",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"@vercel/routing-utils": "2.2.1",
|
||||
|
||||
@@ -134,7 +134,7 @@ const help = () => {
|
||||
|
||||
export default async function main(client: Client): Promise<number> {
|
||||
let { cwd } = client;
|
||||
const { output } = client;
|
||||
const { output, spaces } = client;
|
||||
|
||||
// Ensure that `vc build` is not being invoked recursively
|
||||
if (process.env.__VERCEL_BUILD_RUNNING) {
|
||||
@@ -231,6 +231,8 @@ export default async function main(client: Client): Promise<number> {
|
||||
project = await readProjectSettings(vercelDir);
|
||||
}
|
||||
|
||||
await spaces.createRun({ project });
|
||||
|
||||
// Delete output directory from potential previous build
|
||||
const defaultOutputDir = join(cwd, projectRootDirectory, OUTPUT_DIR);
|
||||
const outputDir = argv['--output']
|
||||
@@ -566,6 +568,12 @@ async function doBuild(
|
||||
// Store the build result to generate the final `config.json` after
|
||||
// all builds have completed
|
||||
buildResults.set(build, buildResult);
|
||||
await client.spaces.createTask({
|
||||
key: `${builderPkg.name}:${builder.version}`,
|
||||
name: `${builderPkg.name}:build`,
|
||||
workspace: pkg?.name ?? 'unknown',
|
||||
log: 'Coming Soon',
|
||||
});
|
||||
|
||||
// Start flushing the file outputs to the filesystem asynchronously
|
||||
ops.push(
|
||||
|
||||
@@ -203,6 +203,56 @@ export default async (client: Client): Promise<number> => {
|
||||
return target;
|
||||
}
|
||||
|
||||
// build `--prebuilt`
|
||||
if (argv['--prebuilt']) {
|
||||
const prebuiltExists = await fs.pathExists(join(cwd, '.vercel/output'));
|
||||
if (!prebuiltExists) {
|
||||
error(
|
||||
`The ${param(
|
||||
'--prebuilt'
|
||||
)} option was used, but no prebuilt output found in ".vercel/output". Run ${getCommandName(
|
||||
'build'
|
||||
)} to generate a local build.`
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const prebuiltBuild = await getPrebuiltJson(cwd);
|
||||
|
||||
// Ensure that there was not a build error
|
||||
const prebuiltError =
|
||||
prebuiltBuild?.error ||
|
||||
prebuiltBuild?.builds?.find(build => 'error' in build)?.error;
|
||||
if (prebuiltError) {
|
||||
output.log(
|
||||
`Prebuilt deployment cannot be created because ${getCommandName(
|
||||
'build'
|
||||
)} failed with error:\n`
|
||||
);
|
||||
prettyError(prebuiltError);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Ensure that the deploy target matches the build target
|
||||
const assumedTarget = target || 'preview';
|
||||
if (prebuiltBuild?.target && prebuiltBuild.target !== assumedTarget) {
|
||||
let specifyTarget = '';
|
||||
if (prebuiltBuild.target === 'production') {
|
||||
specifyTarget = ` --prod`;
|
||||
}
|
||||
|
||||
prettyError({
|
||||
message: `The ${param(
|
||||
'--prebuilt'
|
||||
)} option was used with the target environment "${assumedTarget}", but the prebuilt output found in ".vercel/output" was built with target environment "${
|
||||
prebuiltBuild.target
|
||||
}". Please run ${getCommandName(`--prebuilt${specifyTarget}`)}.`,
|
||||
link: 'https://vercel.link/prebuilt-environment-mismatch',
|
||||
});
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
const archive = argv['--archive'];
|
||||
if (typeof archive === 'string' && !isValidArchive(archive)) {
|
||||
output.error(`Format must be one of: ${VALID_ARCHIVE_FORMATS.join(', ')}`);
|
||||
@@ -305,66 +355,6 @@ export default async (client: Client): Promise<number> => {
|
||||
throw new Error(`"org" is not defined`);
|
||||
}
|
||||
|
||||
// build `--prebuilt`
|
||||
if (argv['--prebuilt']) {
|
||||
// For repo-style linking, update `cwd` to be the Project
|
||||
// subdirectory when `rootDirectory` setting is defined
|
||||
if (
|
||||
link.status === 'linked' &&
|
||||
link.repoRoot &&
|
||||
link.project.rootDirectory
|
||||
) {
|
||||
cwd = join(cwd, link.project.rootDirectory);
|
||||
}
|
||||
|
||||
const prebuiltExists = await fs.pathExists(join(cwd, '.vercel/output'));
|
||||
if (!prebuiltExists) {
|
||||
error(
|
||||
`The ${param(
|
||||
'--prebuilt'
|
||||
)} option was used, but no prebuilt output found in ".vercel/output". Run ${getCommandName(
|
||||
'build'
|
||||
)} to generate a local build.`
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const prebuiltBuild = await getPrebuiltJson(cwd);
|
||||
|
||||
// Ensure that there was not a build error
|
||||
const prebuiltError =
|
||||
prebuiltBuild?.error ||
|
||||
prebuiltBuild?.builds?.find(build => 'error' in build)?.error;
|
||||
if (prebuiltError) {
|
||||
output.log(
|
||||
`Prebuilt deployment cannot be created because ${getCommandName(
|
||||
'build'
|
||||
)} failed with error:\n`
|
||||
);
|
||||
prettyError(prebuiltError);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Ensure that the deploy target matches the build target
|
||||
const assumedTarget = target || 'preview';
|
||||
if (prebuiltBuild?.target && prebuiltBuild.target !== assumedTarget) {
|
||||
let specifyTarget = '';
|
||||
if (prebuiltBuild.target === 'production') {
|
||||
specifyTarget = ` --prod`;
|
||||
}
|
||||
|
||||
prettyError({
|
||||
message: `The ${param(
|
||||
'--prebuilt'
|
||||
)} option was used with the target environment "${assumedTarget}", but the prebuilt output found in ".vercel/output" was built with target environment "${
|
||||
prebuiltBuild.target
|
||||
}". Please run ${getCommandName(`--prebuilt${specifyTarget}`)}.`,
|
||||
link: 'https://vercel.link/prebuilt-environment-mismatch',
|
||||
});
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the `contextName` and `currentTeam` as specified by the
|
||||
// Project Settings, so that API calls happen with the proper scope
|
||||
const contextName = org.slug;
|
||||
@@ -521,8 +511,7 @@ export default async (client: Client): Promise<number> => {
|
||||
}
|
||||
|
||||
try {
|
||||
// if this flag is not set, use `undefined` to allow the project setting to be used
|
||||
const autoAssignCustomDomains = argv['--skip-domain'] ? false : undefined;
|
||||
const autoAssignCustomDomains = !argv['--skip-domain'];
|
||||
|
||||
const createArgs: CreateOptions = {
|
||||
name,
|
||||
|
||||
@@ -73,8 +73,6 @@ export default async (client: Client): Promise<number> => {
|
||||
return 2;
|
||||
}
|
||||
|
||||
const yes = argv['--yes'] ?? false;
|
||||
|
||||
// validate the timeout
|
||||
let timeout = argv['--timeout'];
|
||||
if (timeout && ms(timeout) === undefined) {
|
||||
@@ -105,7 +103,6 @@ export default async (client: Client): Promise<number> => {
|
||||
client,
|
||||
deployId: actionOrDeployId,
|
||||
timeout,
|
||||
yes,
|
||||
});
|
||||
} catch (err) {
|
||||
if (isErrnoException(err)) {
|
||||
|
||||
@@ -4,7 +4,6 @@ import { getCommandName } from '../../util/pkg-name';
|
||||
import getProjectByDeployment from '../../util/projects/get-project-by-deployment';
|
||||
import ms from 'ms';
|
||||
import promoteStatus from './status';
|
||||
import confirm from '../../util/input/confirm';
|
||||
|
||||
/**
|
||||
* Requests a promotion and waits for it complete.
|
||||
@@ -17,12 +16,10 @@ export default async function requestPromote({
|
||||
client,
|
||||
deployId,
|
||||
timeout,
|
||||
yes,
|
||||
}: {
|
||||
client: Client;
|
||||
deployId: string;
|
||||
timeout?: string;
|
||||
yes: boolean;
|
||||
}): Promise<number> {
|
||||
const { output } = client;
|
||||
|
||||
@@ -32,16 +29,6 @@ export default async function requestPromote({
|
||||
output: client.output,
|
||||
});
|
||||
|
||||
if (deployment.target !== 'production' && !yes) {
|
||||
const question =
|
||||
'This deployment does not target production, therefore promotion will not apply production environment variables. Are you sure you want to continue?';
|
||||
const answer = await confirm(client, question, false);
|
||||
if (!answer) {
|
||||
output.error('Canceled');
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// request the promotion
|
||||
await client.fetch(`/v9/projects/${project.id}/promote/${deployment.id}`, {
|
||||
body: {}, // required
|
||||
|
||||
@@ -624,6 +624,9 @@ const main = async () => {
|
||||
.send();
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
// close any inprogress runs
|
||||
await client.spaces.finishRun({ exitCode: 1 });
|
||||
|
||||
if (isErrnoException(err) && err.code === 'ENOTFOUND') {
|
||||
// Error message will look like the following:
|
||||
// "request to https://api.vercel.com/v2/user failed, reason: getaddrinfo ENOTFOUND api.vercel.com"
|
||||
@@ -704,6 +707,9 @@ const main = async () => {
|
||||
metric.event(eventCategory, `${exitCode}`, pkg.version).send();
|
||||
}
|
||||
|
||||
client.stopLogCapture();
|
||||
await client.spaces.finishRun({ exitCode });
|
||||
|
||||
return exitCode;
|
||||
};
|
||||
|
||||
|
||||
@@ -131,7 +131,6 @@ async function writeBuildResultV2(
|
||||
|
||||
const lambdas = new Map<Lambda, string>();
|
||||
const overrides: Record<string, PathOverride> = {};
|
||||
|
||||
for (const [path, output] of Object.entries(buildResult.output)) {
|
||||
const normalizedPath = stripDuplicateSlashes(path);
|
||||
if (isLambda(output)) {
|
||||
@@ -157,26 +156,11 @@ async function writeBuildResultV2(
|
||||
const ext = getFileExtension(fallback);
|
||||
const fallbackName = `${normalizedPath}.prerender-fallback${ext}`;
|
||||
const fallbackPath = join(outputDir, 'functions', fallbackName);
|
||||
|
||||
// if file is already on the disk we can hard link
|
||||
// instead of creating a new copy
|
||||
let usedHardLink = false;
|
||||
if ('fsPath' in fallback) {
|
||||
try {
|
||||
await fs.link(fallback.fsPath, fallbackPath);
|
||||
usedHardLink = true;
|
||||
} catch (_) {
|
||||
// if link fails we continue attempting to copy
|
||||
}
|
||||
}
|
||||
|
||||
if (!usedHardLink) {
|
||||
const stream = fallback.toStream();
|
||||
await pipe(
|
||||
stream,
|
||||
fs.createWriteStream(fallbackPath, { mode: fallback.mode })
|
||||
);
|
||||
}
|
||||
const stream = fallback.toStream();
|
||||
await pipe(
|
||||
stream,
|
||||
fs.createWriteStream(fallbackPath, { mode: fallback.mode })
|
||||
);
|
||||
fallback = new FileFsRef({
|
||||
...output.fallback,
|
||||
fsPath: basename(fallbackName),
|
||||
@@ -304,14 +288,6 @@ async function writeStaticFile(
|
||||
const dest = join(outputDir, 'static', fsPath);
|
||||
await fs.mkdirp(dirname(dest));
|
||||
|
||||
// if already on disk hard link instead of copying
|
||||
if ('fsPath' in file) {
|
||||
try {
|
||||
return await fs.link(file.fsPath, dest);
|
||||
} catch (_) {
|
||||
// if link fails we continue attempting to copy
|
||||
}
|
||||
}
|
||||
await downloadFile(file, dest);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ import { APIError } from './errors-ts';
|
||||
import { normalizeError } from '@vercel/error-utils';
|
||||
import type { Agent } from 'http';
|
||||
import sleep from './sleep';
|
||||
import { interceptor } from './interceptor';
|
||||
import Spaces from './spaces';
|
||||
|
||||
const isSAMLError = (v: any): v is SAMLError => {
|
||||
return v && v.saml;
|
||||
@@ -48,6 +50,7 @@ export interface ClientOptions extends Stdio {
|
||||
localConfig?: VercelConfig;
|
||||
localConfigPath?: string;
|
||||
agent?: Agent;
|
||||
spaceId?: string;
|
||||
}
|
||||
|
||||
export const isJSONObject = (v: any): v is JSONObject => {
|
||||
@@ -68,6 +71,12 @@ export default class Client extends EventEmitter implements Stdio {
|
||||
localConfigPath?: string;
|
||||
prompt!: inquirer.PromptModule;
|
||||
requestIdCounter: number;
|
||||
spaces: Spaces;
|
||||
logs: {
|
||||
restore?: () => void;
|
||||
stdout: string[];
|
||||
stderr: string[];
|
||||
};
|
||||
|
||||
constructor(opts: ClientOptions) {
|
||||
super();
|
||||
@@ -83,7 +92,14 @@ export default class Client extends EventEmitter implements Stdio {
|
||||
this.localConfig = opts.localConfig;
|
||||
this.localConfigPath = opts.localConfigPath;
|
||||
this.requestIdCounter = 1;
|
||||
this.spaces = new Spaces({ client: this, spaceId: opts.spaceId });
|
||||
this.logs = {
|
||||
stdout: [],
|
||||
stderr: [],
|
||||
};
|
||||
|
||||
this._createPromptModule();
|
||||
this._startLogCapture();
|
||||
}
|
||||
|
||||
retry<T>(fn: RetryFunction<T>, { retries = 3, maxTimeout = Infinity } = {}) {
|
||||
@@ -242,4 +258,19 @@ export default class Client extends EventEmitter implements Stdio {
|
||||
set cwd(v: string) {
|
||||
process.chdir(v);
|
||||
}
|
||||
|
||||
_startLogCapture() {
|
||||
this.logs.restore = interceptor({
|
||||
stdout: log => this.logs.stdout.push(log.toString()),
|
||||
stderr: log => this.logs.stderr.push(log.toString()),
|
||||
});
|
||||
}
|
||||
|
||||
stopLogCapture() {
|
||||
this.logs.restore?.();
|
||||
this.logs = {
|
||||
stdout: [],
|
||||
stderr: [],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1131,7 +1131,7 @@ export default class DevServer {
|
||||
body = redirectTemplate({ location, statusCode });
|
||||
} else {
|
||||
res.setHeader('content-type', 'text/plain; charset=utf-8');
|
||||
body = `Redirecting...\n`;
|
||||
body = `Redirecting to ${location} (${statusCode})\n`;
|
||||
}
|
||||
res.end(body);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ export interface CreateOptions {
|
||||
projectSettings?: any;
|
||||
skipAutoDetectionConfirmation?: boolean;
|
||||
noWait?: boolean;
|
||||
autoAssignCustomDomains?: boolean;
|
||||
autoAssignCustomDomains: boolean;
|
||||
}
|
||||
|
||||
export interface RemoveOptions {
|
||||
|
||||
48
packages/cli/src/util/interceptor.ts
Normal file
48
packages/cli/src/util/interceptor.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { WriteStream } from 'tty';
|
||||
|
||||
type InterceptReceiver = (data: Buffer) => void;
|
||||
|
||||
export function interceptor({
|
||||
stdout,
|
||||
stderr,
|
||||
opts = {
|
||||
passthrough: true,
|
||||
},
|
||||
}: {
|
||||
stdout: InterceptReceiver;
|
||||
stderr: InterceptReceiver;
|
||||
opts?: {
|
||||
passthrough?: boolean;
|
||||
};
|
||||
}): () => void {
|
||||
const originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
||||
const originalStderrWrite = process.stderr.write.bind(process.stderr);
|
||||
|
||||
function injectedWrite(
|
||||
stream: WriteStream,
|
||||
callback: (data: Buffer) => void
|
||||
) {
|
||||
return (
|
||||
buffer: Buffer | string,
|
||||
encoding?: any,
|
||||
cb?: () => void
|
||||
): boolean => {
|
||||
const data =
|
||||
typeof buffer === 'string' ? Buffer.from(buffer, encoding) : buffer;
|
||||
callback(data);
|
||||
|
||||
if (opts.passthrough) {
|
||||
return originalStdoutWrite.call(stream, buffer, encoding, cb);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
process.stdout.write = injectedWrite(process.stdout, stdout);
|
||||
process.stderr.write = injectedWrite(process.stderr, stderr);
|
||||
|
||||
return () => {
|
||||
process.stdout.write = originalStdoutWrite;
|
||||
process.stderr.write = originalStderrWrite;
|
||||
};
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import chalk from 'chalk';
|
||||
import pluralize from 'pluralize';
|
||||
import { homedir } from 'os';
|
||||
import { join, normalize } from 'path';
|
||||
import { normalizePath, traverseUpDirectories } from '@vercel/build-utils';
|
||||
import { normalizePath } from '@vercel/build-utils';
|
||||
import { lstat, readJSON, outputJSON } from 'fs-extra';
|
||||
import confirm from '../input/confirm';
|
||||
import toHumanPath from '../humanize-path';
|
||||
@@ -40,12 +40,9 @@ export interface RepoLink {
|
||||
* and returns the parsed `.vercel/repo.json` file if the repository
|
||||
* has already been linked.
|
||||
*/
|
||||
export async function getRepoLink(
|
||||
client: Client,
|
||||
cwd: string
|
||||
): Promise<RepoLink | undefined> {
|
||||
export async function getRepoLink(cwd: string): Promise<RepoLink | undefined> {
|
||||
// Determine where the root of the repo is
|
||||
const rootPath = await findRepoRoot(client, cwd);
|
||||
const rootPath = await findRepoRoot(cwd);
|
||||
if (!rootPath) return undefined;
|
||||
|
||||
// Read the `repo.json`, if this repo has already been linked
|
||||
@@ -66,7 +63,7 @@ export async function ensureRepoLink(
|
||||
): Promise<RepoLink | undefined> {
|
||||
const { output } = client;
|
||||
|
||||
const repoLink = await getRepoLink(client, cwd);
|
||||
const repoLink = await getRepoLink(cwd);
|
||||
if (repoLink) {
|
||||
output.debug(`Found Git repository root directory: ${repoLink.rootPath}`);
|
||||
} else {
|
||||
@@ -221,47 +218,45 @@ export async function ensureRepoLink(
|
||||
* 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(
|
||||
client: Client,
|
||||
start: string
|
||||
): Promise<string | undefined> {
|
||||
const { debug } = client.output;
|
||||
const REPO_JSON_PATH = join(VERCEL_DIR, VERCEL_DIR_REPO);
|
||||
const GIT_CONFIG_PATH = normalize('.git/config');
|
||||
|
||||
for (const current of traverseUpDirectories({ start })) {
|
||||
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.
|
||||
debug('Arrived at home directory');
|
||||
break;
|
||||
}
|
||||
|
||||
// if `.vercel/repo.json` exists (already linked),
|
||||
// then consider this the repo root
|
||||
const repoConfigPath = join(current, REPO_JSON_PATH);
|
||||
const repoConfigPath = join(current, VERCEL_DIR, VERCEL_DIR_REPO);
|
||||
let stat = await lstat(repoConfigPath).catch(err => {
|
||||
if (err.code !== 'ENOENT') throw err;
|
||||
});
|
||||
if (stat) {
|
||||
debug(`Found "${REPO_JSON_PATH}" - detected "${current}" as repo root`);
|
||||
return current;
|
||||
}
|
||||
|
||||
// if `.git/config` exists (unlinked),
|
||||
// then consider this the repo root
|
||||
const gitConfigPath = join(current, GIT_CONFIG_PATH);
|
||||
const gitConfigPath = join(current, '.git/config');
|
||||
stat = await lstat(gitConfigPath).catch(err => {
|
||||
if (err.code !== 'ENOENT') throw err;
|
||||
});
|
||||
if (stat) {
|
||||
debug(`Found "${GIT_CONFIG_PATH}" - detected "${current}" as repo root`);
|
||||
return current;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debug('Aborting search for repo root');
|
||||
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 {
|
||||
@@ -280,7 +275,7 @@ export function findProjectsFromPath(
|
||||
path: string
|
||||
): RepoProjectConfig[] {
|
||||
const normalizedPath = normalizePath(path);
|
||||
const matches = projects
|
||||
return projects
|
||||
.slice()
|
||||
.sort(sortByDirectory)
|
||||
.filter(project => {
|
||||
@@ -293,9 +288,14 @@ export function findProjectsFromPath(
|
||||
normalizedPath.startsWith(`${project.directory}/`)
|
||||
);
|
||||
});
|
||||
// If there are multiple matches, we only want the most relevant
|
||||
// selections (with the deepest directory depth), so pick the first
|
||||
// one and filter on those matches.
|
||||
const firstMatch = matches[0];
|
||||
return matches.filter(match => match.directory === firstMatch.directory);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: remove
|
||||
*/
|
||||
export function findProjectFromPath(
|
||||
projects: RepoProjectConfig[],
|
||||
path: string
|
||||
): RepoProjectConfig | undefined {
|
||||
return findProjectsFromPath(projects, path)[0];
|
||||
}
|
||||
|
||||
@@ -74,7 +74,9 @@ export default async function getProjectByDeployment({
|
||||
err.code = 'ERR_INVALID_TEAM';
|
||||
throw err;
|
||||
}
|
||||
} else if (team) {
|
||||
}
|
||||
|
||||
if (team) {
|
||||
const err: NodeJS.ErrnoException = new Error(
|
||||
`Deployment doesn't belong to current team ${chalk.bold(contextName)}`
|
||||
);
|
||||
|
||||
@@ -83,7 +83,7 @@ async function getProjectLinkFromRepoLink(
|
||||
client: Client,
|
||||
path: string
|
||||
): Promise<ProjectLink | null> {
|
||||
const repoLink = await getRepoLink(client, path);
|
||||
const repoLink = await getRepoLink(path);
|
||||
if (!repoLink?.repoConfig) {
|
||||
return null;
|
||||
}
|
||||
@@ -95,13 +95,11 @@ async function getProjectLinkFromRepoLink(
|
||||
if (projects.length === 1) {
|
||||
project = projects[0];
|
||||
} else {
|
||||
const selectableProjects =
|
||||
projects.length > 0 ? projects : repoLink.repoConfig.projects;
|
||||
const { p } = await client.prompt({
|
||||
name: 'p',
|
||||
type: 'list',
|
||||
message: `Please select a Project:`,
|
||||
choices: selectableProjects.map(p => ({
|
||||
choices: repoLink.repoConfig.projects.map(p => ({
|
||||
value: p,
|
||||
name: p.name,
|
||||
})),
|
||||
@@ -169,7 +167,6 @@ async function getOrgById(client: Client, orgId: string): Promise<Org | null> {
|
||||
}
|
||||
|
||||
async function hasProjectLink(
|
||||
client: Client,
|
||||
projectLink: ProjectLink,
|
||||
path: string
|
||||
): Promise<boolean> {
|
||||
@@ -184,7 +181,7 @@ async function hasProjectLink(
|
||||
}
|
||||
|
||||
// linked via `repo.json`?
|
||||
const repoLink = await getRepoLink(client, path);
|
||||
const repoLink = await getRepoLink(path);
|
||||
if (
|
||||
repoLink?.repoConfig?.orgId === projectLink.orgId &&
|
||||
repoLink.repoConfig.projects.find(p => p.id === projectLink.projectId)
|
||||
@@ -246,7 +243,7 @@ export async function getLinkedProject(
|
||||
if (isAPIError(err) && err.status === 403) {
|
||||
output.stopSpinner();
|
||||
|
||||
if (err.missingToken || err.invalidToken) {
|
||||
if (err.missingToken) {
|
||||
throw new InvalidToken();
|
||||
} else {
|
||||
throw new NowBuildError({
|
||||
@@ -304,7 +301,7 @@ export async function linkFolderToProject(
|
||||
successEmoji: EmojiLabel = 'link'
|
||||
) {
|
||||
// if the project is already linked, we skip linking
|
||||
if (await hasProjectLink(client, projectLink, path)) {
|
||||
if (await hasProjectLink(projectLink, path)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
188
packages/cli/src/util/spaces/index.ts
Normal file
188
packages/cli/src/util/spaces/index.ts
Normal file
@@ -0,0 +1,188 @@
|
||||
import fetch, { Headers } from 'node-fetch';
|
||||
import pkg from '../../../package.json';
|
||||
import Client from '../client';
|
||||
import ua from '../ua';
|
||||
import { ProjectLinkAndSettings } from '../projects/project-settings';
|
||||
|
||||
const HOST = 'https://vercel.com/api';
|
||||
|
||||
class Run {
|
||||
id: string;
|
||||
url: string;
|
||||
startTime = Date.now();
|
||||
|
||||
constructor({ id, url }: { id: string; url: string }) {
|
||||
this.id = id;
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Ordering of requests:
|
||||
1. Create run (POST)
|
||||
2. Create tasks (POST)
|
||||
3. Finish run (PATCH)
|
||||
|
||||
*/
|
||||
|
||||
export default class Spaces {
|
||||
version: string = 'v0';
|
||||
type: string = 'VERCEL-CLI';
|
||||
spaceId: string;
|
||||
client: Client;
|
||||
run: Run | undefined;
|
||||
|
||||
constructor({ spaceId, client }: { spaceId?: string; client: Client }) {
|
||||
// TODO: remove default spaceId (vercel-site)
|
||||
this.spaceId = spaceId || 'space_FwOT2idkmZ5PIDvgK5xY3YpD';
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
private runsEndpoint({ runId }: { runId?: string } = {}) {
|
||||
if (runId) {
|
||||
return `spaces/${this.spaceId}/runs/${runId}`;
|
||||
}
|
||||
return `spaces/${this.spaceId}/runs`;
|
||||
}
|
||||
|
||||
private tasksEndpoint({ runId }: { runId: string }) {
|
||||
return `spaces/${this.spaceId}/runs/${runId}/tasks`;
|
||||
}
|
||||
|
||||
private async gitMetaData() {
|
||||
return {
|
||||
gitBranch: 'TODO',
|
||||
gitSha: 'TODO',
|
||||
};
|
||||
}
|
||||
|
||||
private async fetch({
|
||||
method,
|
||||
body,
|
||||
endpoint,
|
||||
}: {
|
||||
method: 'POST' | 'PATCH';
|
||||
body: string;
|
||||
endpoint: string;
|
||||
}) {
|
||||
const url = new URL(`${HOST}/${this.version}/${endpoint}`);
|
||||
if (this.client.config.currentTeam) {
|
||||
url.searchParams.set('teamId', this.client.config.currentTeam);
|
||||
}
|
||||
|
||||
const headers = new Headers();
|
||||
headers.set('user-agent', ua);
|
||||
if (this.client.authConfig.token) {
|
||||
headers.set('authorization', `Bearer ${this.client.authConfig.token}`);
|
||||
}
|
||||
|
||||
return fetch(url, {
|
||||
method,
|
||||
body,
|
||||
headers,
|
||||
});
|
||||
}
|
||||
|
||||
async finishRun({ exitCode }: { exitCode: number }) {
|
||||
if (!this.spaceId) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.run) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// patch with node-fetch
|
||||
await this.fetch({
|
||||
endpoint: this.runsEndpoint({ runId: this.run.id }),
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify({
|
||||
status: 'completed',
|
||||
endTime: Date.now(),
|
||||
exitCode,
|
||||
}),
|
||||
});
|
||||
console.log(`✅ Run saved to ${this.run.url}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
// reset the run
|
||||
this.run = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
async createRun({ project }: { project: ProjectLinkAndSettings }) {
|
||||
if (!this.spaceId) {
|
||||
return;
|
||||
}
|
||||
if (this.run) {
|
||||
console.error(
|
||||
`Existing run in progress, cannot start a new run before finishing the current run.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const data = {
|
||||
status: 'running',
|
||||
startTime: Date.now(),
|
||||
type: this.type,
|
||||
context: 'LOCAL',
|
||||
client: {
|
||||
id: 'vercel-cli',
|
||||
name: 'Vercel CLI',
|
||||
version: pkg.version,
|
||||
},
|
||||
meta: JSON.stringify({ project }),
|
||||
repositoryPath: 'TODO',
|
||||
command: project.settings.buildCommand ?? '',
|
||||
...this.gitMetaData(),
|
||||
};
|
||||
|
||||
try {
|
||||
const res = await this.fetch({
|
||||
endpoint: this.runsEndpoint(),
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
|
||||
const json = await res.json();
|
||||
console.log(`Created run: ${json.url}`);
|
||||
|
||||
// track the run
|
||||
this.run = new Run({ id: json.id, url: json.url });
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
async createTask(data: {
|
||||
key: string;
|
||||
name: string;
|
||||
workspace: string;
|
||||
log: string;
|
||||
}) {
|
||||
if (!this.spaceId) {
|
||||
return;
|
||||
}
|
||||
if (!this.run) {
|
||||
console.error(
|
||||
`No run in progress, must start a new run before creating tasks.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await this.fetch({
|
||||
endpoint: this.tasksEndpoint({ runId: this.run.id }),
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
|
||||
const json = await res.json();
|
||||
console.log(`Added task: ${json}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,10 +88,10 @@ test(
|
||||
async (testPath: any) => {
|
||||
const vcRobots = `https://vercel.com/robots.txt`;
|
||||
await testPath(200, '/rewrite', /User-Agent: \*/m);
|
||||
await testPath(308, '/redirect', `Redirecting...`, {
|
||||
await testPath(308, '/redirect', `Redirecting to ${vcRobots} (308)`, {
|
||||
Location: vcRobots,
|
||||
});
|
||||
await testPath(307, '/tempRedirect', `Redirecting...`, {
|
||||
await testPath(307, '/tempRedirect', `Redirecting to ${vcRobots} (307)`, {
|
||||
Location: vcRobots,
|
||||
});
|
||||
}
|
||||
@@ -103,10 +103,10 @@ test(
|
||||
testFixtureStdio('test-routing-case-sensitive', async (testPath: any) => {
|
||||
await testPath(200, '/Path', 'UPPERCASE');
|
||||
await testPath(200, '/path', 'lowercase');
|
||||
await testPath(308, '/GoTo', 'Redirecting...', {
|
||||
await testPath(308, '/GoTo', 'Redirecting to /upper.html (308)', {
|
||||
Location: '/upper.html',
|
||||
});
|
||||
await testPath(308, '/goto', 'Redirecting...', {
|
||||
await testPath(308, '/goto', 'Redirecting to /lower.html (308)', {
|
||||
Location: '/lower.html',
|
||||
});
|
||||
})
|
||||
|
||||
@@ -233,7 +233,7 @@ test(
|
||||
expect(res.headers.get('location')).toBe(
|
||||
`http://localhost:${port}/?foo=bar`
|
||||
);
|
||||
expect(body).toBe('Redirecting...\n');
|
||||
expect(body).toBe('Redirecting to /?foo=bar (301)\n');
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -197,18 +197,21 @@ test(
|
||||
await testPath(200, '/sub', 'Sub Index Page');
|
||||
await testPath(200, '/sub/another', 'Sub Another Page');
|
||||
await testPath(200, '/style.css', 'body { color: green }');
|
||||
await testPath(308, '/index.html', 'Redirecting...', {
|
||||
await testPath(308, '/index.html', 'Redirecting to / (308)', {
|
||||
Location: '/',
|
||||
});
|
||||
await testPath(308, '/about.html', 'Redirecting...', {
|
||||
await testPath(308, '/about.html', 'Redirecting to /about (308)', {
|
||||
Location: '/about',
|
||||
});
|
||||
await testPath(308, '/sub/index.html', 'Redirecting...', {
|
||||
await testPath(308, '/sub/index.html', 'Redirecting to /sub (308)', {
|
||||
Location: '/sub',
|
||||
});
|
||||
await testPath(308, '/sub/another.html', 'Redirecting...', {
|
||||
Location: '/sub/another',
|
||||
});
|
||||
await testPath(
|
||||
308,
|
||||
'/sub/another.html',
|
||||
'Redirecting to /sub/another (308)',
|
||||
{ Location: '/sub/another' }
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -222,18 +225,21 @@ test(
|
||||
await testPath(200, '/sub', 'Sub Index Page');
|
||||
await testPath(200, '/sub/another', 'Sub Another Page');
|
||||
await testPath(200, '/style.css', 'body { color: green }');
|
||||
await testPath(308, '/index.html', 'Redirecting...', {
|
||||
await testPath(308, '/index.html', 'Redirecting to / (308)', {
|
||||
Location: '/',
|
||||
});
|
||||
await testPath(308, '/about.html', 'Redirecting...', {
|
||||
await testPath(308, '/about.html', 'Redirecting to /about (308)', {
|
||||
Location: '/about',
|
||||
});
|
||||
await testPath(308, '/sub/index.html', 'Redirecting...', {
|
||||
await testPath(308, '/sub/index.html', 'Redirecting to /sub (308)', {
|
||||
Location: '/sub',
|
||||
});
|
||||
await testPath(308, '/sub/another.html', 'Redirecting...', {
|
||||
Location: '/sub/another',
|
||||
});
|
||||
await testPath(
|
||||
308,
|
||||
'/sub/another.html',
|
||||
'Redirecting to /sub/another (308)',
|
||||
{ Location: '/sub/another' }
|
||||
);
|
||||
}
|
||||
)
|
||||
);
|
||||
@@ -258,16 +264,21 @@ test(
|
||||
await testPath(200, '/sub/another/', 'Sub Another Page');
|
||||
await testPath(200, '/style.css', 'body { color: green }');
|
||||
//TODO: fix this test so that location is `/` instead of `//`
|
||||
//await testPath(308, '/index.html', 'Redirecting...', { Location: '/' });
|
||||
await testPath(308, '/about.html', 'Redirecting...', {
|
||||
//await testPath(308, '/index.html', 'Redirecting to / (308)', { Location: '/' });
|
||||
await testPath(308, '/about.html', 'Redirecting to /about/ (308)', {
|
||||
Location: '/about/',
|
||||
});
|
||||
await testPath(308, '/sub/index.html', 'Redirecting...', {
|
||||
await testPath(308, '/sub/index.html', 'Redirecting to /sub/ (308)', {
|
||||
Location: '/sub/',
|
||||
});
|
||||
await testPath(308, '/sub/another.html', 'Redirecting...', {
|
||||
Location: '/sub/another/',
|
||||
});
|
||||
await testPath(
|
||||
308,
|
||||
'/sub/another.html',
|
||||
'Redirecting to /sub/another/ (308)',
|
||||
{
|
||||
Location: '/sub/another/',
|
||||
}
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -304,13 +315,13 @@ test(
|
||||
await testPath(200, '/sub/index.html', 'Sub Index Page');
|
||||
await testPath(200, '/sub/another.html', 'Sub Another Page');
|
||||
await testPath(200, '/style.css', 'body { color: green }');
|
||||
await testPath(308, '/about.html/', 'Redirecting...', {
|
||||
await testPath(308, '/about.html/', 'Redirecting to /about.html (308)', {
|
||||
Location: '/about.html',
|
||||
});
|
||||
await testPath(308, '/style.css/', 'Redirecting...', {
|
||||
await testPath(308, '/style.css/', 'Redirecting to /style.css (308)', {
|
||||
Location: '/style.css',
|
||||
});
|
||||
await testPath(308, '/sub', 'Redirecting...', {
|
||||
await testPath(308, '/sub', 'Redirecting to /sub/ (308)', {
|
||||
Location: '/sub/',
|
||||
});
|
||||
})
|
||||
@@ -336,15 +347,20 @@ test(
|
||||
await testPath(200, '/sub/index.html', 'Sub Index Page');
|
||||
await testPath(200, '/sub/another.html', 'Sub Another Page');
|
||||
await testPath(200, '/style.css', 'body { color: green }');
|
||||
await testPath(308, '/about.html/', 'Redirecting...', {
|
||||
await testPath(308, '/about.html/', 'Redirecting to /about.html (308)', {
|
||||
Location: '/about.html',
|
||||
});
|
||||
await testPath(308, '/sub/', 'Redirecting...', {
|
||||
await testPath(308, '/sub/', 'Redirecting to /sub (308)', {
|
||||
Location: '/sub',
|
||||
});
|
||||
await testPath(308, '/sub/another.html/', 'Redirecting...', {
|
||||
Location: '/sub/another.html',
|
||||
});
|
||||
await testPath(
|
||||
308,
|
||||
'/sub/another.html/',
|
||||
'Redirecting to /sub/another.html (308)',
|
||||
{
|
||||
Location: '/sub/another.html',
|
||||
}
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
@@ -44,9 +44,7 @@ function fetchWithRetry(url, opts = {}) {
|
||||
if (res.status !== opts.status) {
|
||||
const text = await res.text();
|
||||
throw new Error(
|
||||
`Failed to fetch "${url}", received ${res.status}, expected ${
|
||||
opts.status
|
||||
}, id: ${res.headers.get('x-vercel-id')}:\n\n${text}\n\n`
|
||||
`Failed to fetch ${url} with status ${res.status} (expected ${opts.status}):\n\n${text}\n\n`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"orgId": "team_dummy",
|
||||
"projectId": "build-output-api-failed-before-builds"
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"orgId": "team_dummy",
|
||||
"projectId": "build-output-api-failed-within-build"
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"orgId": "team_dummy",
|
||||
"projectId": "build-output-api-preview"
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"orgId": "team_dummy",
|
||||
"projectId": "build-output-api-production"
|
||||
}
|
||||
4
packages/cli/test/integration-1.test.ts
vendored
4
packages/cli/test/integration-1.test.ts
vendored
@@ -32,9 +32,7 @@ function fetchTokenInformation(token: string, retries = 3) {
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(
|
||||
`Failed to fetch "${url}", status: ${
|
||||
res.status
|
||||
}, id: ${res.headers.get('x-vercel-id')}`
|
||||
`Failed to fetch ${url}, received status ${res.status}`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
4
packages/cli/test/integration-2.test.ts
vendored
4
packages/cli/test/integration-2.test.ts
vendored
@@ -43,9 +43,7 @@ function fetchTokenInformation(token: string, retries = 3) {
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(
|
||||
`Failed to fetch "${url}", status: ${
|
||||
res.status
|
||||
}, id: ${res.headers.get('x-vercel-id')}`
|
||||
`Failed to fetch ${url}, received status ${res.status}`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
4
packages/cli/test/integration-3.test.ts
vendored
4
packages/cli/test/integration-3.test.ts
vendored
@@ -47,9 +47,7 @@ function fetchTokenInformation(token: string, retries = 3) {
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(
|
||||
`Failed to fetch "${url}", status: ${
|
||||
res.status
|
||||
}, id: ${res.headers.get('x-vercel-id')}`
|
||||
`Failed to fetch ${url}, received status ${res.status}`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ export function useDeployment({
|
||||
state = 'READY',
|
||||
createdAt,
|
||||
project = defaultProject,
|
||||
target = 'production',
|
||||
}: {
|
||||
creator: Pick<User, 'id' | 'email' | 'name' | 'username'>;
|
||||
state?:
|
||||
@@ -30,7 +29,6 @@ export function useDeployment({
|
||||
| 'CANCELED';
|
||||
createdAt?: number;
|
||||
project: any; // FIX ME: Use `Project` once PR #9956 is merged
|
||||
target?: Deployment['target'];
|
||||
}) {
|
||||
setupDeploymentEndpoints();
|
||||
|
||||
@@ -65,7 +63,7 @@ export function useDeployment({
|
||||
regions: [],
|
||||
routes: [],
|
||||
status: state,
|
||||
target,
|
||||
target: 'production',
|
||||
type: 'LAMBDAS',
|
||||
url: url.hostname,
|
||||
version: 2,
|
||||
|
||||
@@ -5,11 +5,9 @@ export function useTeams(
|
||||
teamId?: string,
|
||||
options: {
|
||||
failMissingToken?: boolean;
|
||||
failInvalidToken?: boolean;
|
||||
failNoAccess?: boolean;
|
||||
} = {
|
||||
failMissingToken: false,
|
||||
failInvalidToken: false,
|
||||
failNoAccess: false,
|
||||
}
|
||||
) {
|
||||
@@ -36,15 +34,6 @@ export function useTeams(
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (options.failInvalidToken) {
|
||||
res.statusCode = 403;
|
||||
res.json({
|
||||
message: 'Not authorized',
|
||||
code: 'forbidden',
|
||||
invalidToken: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (options.failNoAccess) {
|
||||
res.statusCode = 403;
|
||||
|
||||
@@ -45,14 +45,6 @@ describe('deploy', () => {
|
||||
it('should reject deploying when `--prebuilt` is used and `vc build` failed before Builders', async () => {
|
||||
const cwd = setupUnitFixture('build-output-api-failed-before-builds');
|
||||
|
||||
useUser();
|
||||
useTeams('team_dummy');
|
||||
useProject({
|
||||
...defaultProject,
|
||||
id: 'build-output-api-failed-before-builds',
|
||||
name: 'build-output-api-failed-before-builds',
|
||||
});
|
||||
|
||||
client.setArgv('deploy', cwd, '--prebuilt');
|
||||
const exitCodePromise = deploy(client);
|
||||
await expect(client.stderr).toOutput(
|
||||
@@ -64,14 +56,6 @@ describe('deploy', () => {
|
||||
it('should reject deploying when `--prebuilt` is used and `vc build` failed within a Builder', async () => {
|
||||
const cwd = setupUnitFixture('build-output-api-failed-within-build');
|
||||
|
||||
useUser();
|
||||
useTeams('team_dummy');
|
||||
useProject({
|
||||
...defaultProject,
|
||||
id: 'build-output-api-failed-within-build',
|
||||
name: 'build-output-api-failed-within-build',
|
||||
});
|
||||
|
||||
client.setArgv('deploy', cwd, '--prebuilt');
|
||||
const exitCodePromise = deploy(client);
|
||||
await expect(client.stderr).toOutput(
|
||||
@@ -81,16 +65,7 @@ describe('deploy', () => {
|
||||
});
|
||||
|
||||
it('should reject deploying a directory that does not contain ".vercel/output" when `--prebuilt` is used', async () => {
|
||||
useUser();
|
||||
useTeams('team_dummy');
|
||||
useProject({
|
||||
...defaultProject,
|
||||
name: 'static',
|
||||
id: 'static',
|
||||
});
|
||||
|
||||
client.cwd = setupUnitFixture('commands/deploy/static');
|
||||
client.setArgv('deploy', '--prebuilt');
|
||||
client.setArgv('deploy', __dirname, '--prebuilt');
|
||||
const exitCodePromise = deploy(client);
|
||||
await expect(client.stderr).toOutput(
|
||||
'Error: The "--prebuilt" option was used, but no prebuilt output found in ".vercel/output". Run `vercel build` to generate a local build.\n'
|
||||
@@ -127,8 +102,8 @@ describe('deploy', () => {
|
||||
useTeams('team_dummy');
|
||||
useProject({
|
||||
...defaultProject,
|
||||
id: 'build-output-api-production',
|
||||
name: 'build-output-api-production',
|
||||
id: 'build-output-api-preview',
|
||||
name: 'build-output-api-preview',
|
||||
});
|
||||
|
||||
client.setArgv('deploy', cwd, '--prebuilt');
|
||||
|
||||
@@ -101,71 +101,6 @@ describe('promote', () => {
|
||||
await expect(exitCodePromise).resolves.toEqual(0);
|
||||
});
|
||||
|
||||
it('should fail to promote a preview deployment when user says no', async () => {
|
||||
const { cwd, previousDeployment } = initPromoteTest({
|
||||
deploymentTarget: 'preview',
|
||||
});
|
||||
client.cwd = cwd;
|
||||
client.setArgv('promote', previousDeployment.url);
|
||||
const exitCodePromise = promote(client);
|
||||
|
||||
await expect(client.stderr).toOutput(
|
||||
`Fetching deployment "${previousDeployment.url}" in ${previousDeployment.creator?.username}`
|
||||
);
|
||||
await expect(client.stderr).toOutput(
|
||||
'? This deployment does not target production, therefore promotion will not apply\n production environment variables. Are you sure you want to continue?'
|
||||
);
|
||||
|
||||
// say "no" to the prompt
|
||||
client.stdin.write('n\n');
|
||||
|
||||
await expect(client.stderr).toOutput('Error: Canceled');
|
||||
|
||||
await expect(exitCodePromise).resolves.toEqual(0);
|
||||
});
|
||||
|
||||
it('should promote a preview deployment when user says yes', async () => {
|
||||
const { cwd, previousDeployment } = initPromoteTest({
|
||||
deploymentTarget: 'preview',
|
||||
});
|
||||
client.cwd = cwd;
|
||||
client.setArgv('promote', previousDeployment.url);
|
||||
const exitCodePromise = promote(client);
|
||||
|
||||
await expect(client.stderr).toOutput(
|
||||
`Fetching deployment "${previousDeployment.url}" in ${previousDeployment.creator?.username}`
|
||||
);
|
||||
await expect(client.stderr).toOutput(
|
||||
'? This deployment does not target production, therefore promotion will not apply\n production environment variables. Are you sure you want to continue?'
|
||||
);
|
||||
|
||||
// say "yes" to the prompt
|
||||
client.stdin.write('y\n');
|
||||
|
||||
await expect(exitCodePromise).resolves.toEqual(0);
|
||||
});
|
||||
|
||||
it('should promote a preview deployment with --yes', async () => {
|
||||
const { cwd, previousDeployment } = initPromoteTest({
|
||||
deploymentTarget: 'preview',
|
||||
});
|
||||
client.cwd = cwd;
|
||||
client.setArgv('promote', previousDeployment.url, '--yes');
|
||||
const exitCodePromise = promote(client);
|
||||
|
||||
await expect(client.stderr).toOutput(
|
||||
`Fetching deployment "${previousDeployment.url}" in ${previousDeployment.creator?.username}`
|
||||
);
|
||||
await expect(client.stderr).toOutput('Promote in progress');
|
||||
await expect(client.stderr).toOutput(
|
||||
`Success! ${chalk.bold('vercel-promote')} was promoted to ${
|
||||
previousDeployment.url
|
||||
} (${previousDeployment.id})`
|
||||
);
|
||||
|
||||
await expect(exitCodePromise).resolves.toEqual(0);
|
||||
});
|
||||
|
||||
it('should get status while promoting', async () => {
|
||||
const { cwd, previousDeployment, project } = initPromoteTest({
|
||||
promotePollCount: 10,
|
||||
@@ -343,13 +278,11 @@ function initPromoteTest({
|
||||
promoteJobStatus = 'succeeded',
|
||||
promotePollCount = 2,
|
||||
promoteStatusCode,
|
||||
deploymentTarget,
|
||||
}: {
|
||||
promoteAliases?: DeploymentAlias[];
|
||||
promoteJobStatus?: LastAliasRequest['jobStatus'];
|
||||
promotePollCount?: number;
|
||||
promoteStatusCode?: number;
|
||||
deploymentTarget?: Deployment['target'];
|
||||
} = {}) {
|
||||
const cwd = setupUnitFixture('commands/promote/simple-next-site');
|
||||
const user = useUser();
|
||||
@@ -361,11 +294,7 @@ function initPromoteTest({
|
||||
});
|
||||
|
||||
const currentDeployment = useDeployment({ creator: user, project });
|
||||
const previousDeployment = useDeployment({
|
||||
creator: user,
|
||||
project,
|
||||
target: deploymentTarget,
|
||||
});
|
||||
const previousDeployment = useDeployment({ creator: user, project });
|
||||
|
||||
let pollCounter = 0;
|
||||
let lastAliasRequest: LastAliasRequest | null = null;
|
||||
|
||||
@@ -1,62 +1,91 @@
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join, sep } from 'node:path';
|
||||
import {
|
||||
findProjectsFromPath,
|
||||
findProjectFromPath,
|
||||
findRepoRoot,
|
||||
RepoProjectConfig,
|
||||
traverseUpDirectories,
|
||||
} from '../../../../src/util/link/repo';
|
||||
import { client } from '../../../mocks/client';
|
||||
|
||||
const isWindows = process.platform === 'win32';
|
||||
|
||||
// Root of `vercel/vercel` repo
|
||||
const vercelRepoRoot = join(__dirname, '../../../../../..');
|
||||
|
||||
describe('findRepoRoot()', () => {
|
||||
it('should find Git repo root from root', async () => {
|
||||
const repoRoot = await findRepoRoot(client, vercelRepoRoot);
|
||||
const repoRoot = await findRepoRoot(vercelRepoRoot);
|
||||
expect(repoRoot).toEqual(vercelRepoRoot);
|
||||
});
|
||||
|
||||
it('should find Git repo root sub directory', async () => {
|
||||
const repoRoot = await findRepoRoot(client, __dirname);
|
||||
const repoRoot = await findRepoRoot(__dirname);
|
||||
expect(repoRoot).toEqual(vercelRepoRoot);
|
||||
});
|
||||
|
||||
it('should return `undefined` when no Git root found', async () => {
|
||||
const repoRoot = await findRepoRoot(client, tmpdir());
|
||||
const repoRoot = await findRepoRoot(tmpdir());
|
||||
expect(repoRoot).toEqual(undefined);
|
||||
});
|
||||
});
|
||||
|
||||
describe('findProjectsFromPath()', () => {
|
||||
describe('traverseUpDirectories()', () => {
|
||||
test.each(
|
||||
isWindows
|
||||
? [
|
||||
{
|
||||
input: 'C:\\foo\\bar\\baz',
|
||||
expected: ['C:\\foo\\bar\\baz', 'C:\\foo\\bar', 'C:\\foo', 'C:\\'],
|
||||
},
|
||||
{
|
||||
input: 'C:\\foo\\..\\bar\\.\\baz',
|
||||
expected: ['C:\\bar\\baz', 'C:\\bar', 'C:\\'],
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
input: '/foo/bar/baz',
|
||||
expected: ['/foo/bar/baz', '/foo/bar', '/foo', '/'],
|
||||
},
|
||||
{
|
||||
input: '/foo/../bar/./baz',
|
||||
expected: ['/bar/baz', '/bar', '/'],
|
||||
},
|
||||
]
|
||||
)('should traverse "$input"', ({ input, expected }) => {
|
||||
expect(Array.from(traverseUpDirectories(input))).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('findProjectFromPath()', () => {
|
||||
const projects: RepoProjectConfig[] = [
|
||||
{ id: 'root', name: 'r', directory: '.' },
|
||||
{ id: 'site', name: 'a', directory: 'apps/site' },
|
||||
{ id: 'site2', name: 'a', directory: 'apps/site2' },
|
||||
{ id: 'other', name: 'b', directory: 'apps/other' },
|
||||
{ id: 'duplicate', name: 'd', directory: 'apps/other' },
|
||||
{ id: 'nested', name: 'n', directory: 'apps/other/nested' },
|
||||
];
|
||||
|
||||
it.each([
|
||||
{ ids: ['root'], path: '.' },
|
||||
{ ids: ['root'], path: 'lib' },
|
||||
{ ids: ['root'], path: 'lib' },
|
||||
{ ids: ['site'], path: `apps${sep}site` },
|
||||
{ ids: ['site'], path: `apps${sep}site` },
|
||||
{ ids: ['site'], path: `apps${sep}site${sep}components` },
|
||||
{ ids: ['site2'], path: `apps${sep}site2` },
|
||||
{ ids: ['site2'], path: `apps${sep}site2${sep}inner` },
|
||||
{ ids: ['other', 'duplicate'], path: `apps${sep}other` },
|
||||
{ ids: ['other', 'duplicate'], path: `apps${sep}other${sep}lib` },
|
||||
{ ids: ['nested'], path: `apps${sep}other${sep}nested` },
|
||||
{ ids: ['nested'], path: `apps${sep}other${sep}nested${sep}foo` },
|
||||
])('should find Project "$id" for path "$path"', ({ path, ids }) => {
|
||||
const actual = findProjectsFromPath(projects, path);
|
||||
expect(actual.map(a => a.id)).toEqual(ids);
|
||||
{ id: 'root', path: '.' },
|
||||
{ id: 'root', path: 'lib' },
|
||||
{ id: 'root', path: 'lib' },
|
||||
{ id: 'site', path: `apps${sep}site` },
|
||||
{ id: 'site', path: `apps${sep}site` },
|
||||
{ id: 'site', path: `apps${sep}site${sep}components` },
|
||||
{ id: 'site2', path: `apps${sep}site2` },
|
||||
{ id: 'site2', path: `apps${sep}site2${sep}inner` },
|
||||
{ id: 'other', path: `apps${sep}other` },
|
||||
{ id: 'other', path: `apps${sep}other${sep}lib` },
|
||||
{ id: 'nested', path: `apps${sep}other${sep}nested` },
|
||||
{ id: 'nested', path: `apps${sep}other${sep}nested${sep}foo` },
|
||||
])('should find Project "$id" for path "$path"', ({ path, id }) => {
|
||||
const actual = findProjectFromPath(projects, path);
|
||||
expect(actual?.id).toEqual(id);
|
||||
});
|
||||
|
||||
it('should return empty array when there are no matching Projects', () => {
|
||||
const actual = findProjectsFromPath([projects[1]], '.');
|
||||
expect(actual).toHaveLength(0);
|
||||
it('should return `undefined` when there are no matching Projects', () => {
|
||||
const actual = findProjectFromPath([projects[1]], '.');
|
||||
expect(actual).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
import { client } from '../../../mocks/client';
|
||||
import getProjectByDeployment from '../../../../src/util/projects/get-project-by-deployment';
|
||||
import { useTeams } from '../../../mocks/team';
|
||||
import { useUser } from '../../../mocks/user';
|
||||
import { useDeployment } from '../../../mocks/deployment';
|
||||
import { defaultProject, useProject } from '../../../mocks/project';
|
||||
|
||||
describe('getProjectByDeployment', () => {
|
||||
it('should get project and deployment', async () => {
|
||||
const user = useUser();
|
||||
const { project: p } = useProject({
|
||||
...defaultProject,
|
||||
id: 'foo',
|
||||
name: 'foo',
|
||||
});
|
||||
const d = useDeployment({
|
||||
creator: user,
|
||||
createdAt: Date.now(),
|
||||
project: p,
|
||||
});
|
||||
|
||||
const { deployment, project } = await getProjectByDeployment({
|
||||
client,
|
||||
deployId: d.id,
|
||||
output: client.output,
|
||||
});
|
||||
|
||||
expect(project.id).toBe(p.id);
|
||||
expect(deployment.id).toBe(d.id);
|
||||
});
|
||||
|
||||
it('should get project and deployment associated to a team', async () => {
|
||||
const [team] = useTeams('team_dummy');
|
||||
const user = useUser();
|
||||
const { project: p } = useProject({
|
||||
...defaultProject,
|
||||
id: 'foo',
|
||||
name: 'foo',
|
||||
});
|
||||
const d = useDeployment({
|
||||
creator: {
|
||||
id: team.id,
|
||||
name: team.name,
|
||||
email: user.email,
|
||||
username: team.slug,
|
||||
},
|
||||
createdAt: Date.now(),
|
||||
project: p,
|
||||
});
|
||||
|
||||
client.config.currentTeam = team.id;
|
||||
d.team = team;
|
||||
|
||||
const { deployment, project } = await getProjectByDeployment({
|
||||
client,
|
||||
deployId: d.id,
|
||||
output: client.output,
|
||||
});
|
||||
|
||||
expect(project.id).toBe(p.id);
|
||||
expect(deployment.id).toBe(d.id);
|
||||
});
|
||||
|
||||
it("should error if deployment team doesn't match current user's team", async () => {
|
||||
const [team] = useTeams('team_dummy');
|
||||
const user = useUser();
|
||||
const { project: p } = useProject({
|
||||
...defaultProject,
|
||||
id: 'foo',
|
||||
name: 'foo',
|
||||
});
|
||||
const d = useDeployment({
|
||||
creator: {
|
||||
id: team.id,
|
||||
name: team.name,
|
||||
email: user.email,
|
||||
username: team.slug,
|
||||
},
|
||||
createdAt: Date.now(),
|
||||
project: p,
|
||||
});
|
||||
|
||||
client.config.currentTeam = team.id;
|
||||
|
||||
await expect(
|
||||
getProjectByDeployment({
|
||||
client,
|
||||
deployId: d.id,
|
||||
output: client.output,
|
||||
})
|
||||
).rejects.toThrowError("Deployment doesn't belong to current team");
|
||||
|
||||
client.config.currentTeam = undefined;
|
||||
d.team = team;
|
||||
|
||||
await expect(
|
||||
getProjectByDeployment({
|
||||
client,
|
||||
deployId: d.id,
|
||||
output: client.output,
|
||||
})
|
||||
).rejects.toThrowError('Deployment belongs to a different team');
|
||||
});
|
||||
});
|
||||
@@ -41,35 +41,6 @@ describe('getLinkedProject', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('should fail to return a link when token is invalid', async () => {
|
||||
const cwd = fixture('vercel-pull-next');
|
||||
|
||||
useUser();
|
||||
useTeams('team_dummy', { failInvalidToken: true });
|
||||
useProject({
|
||||
...defaultProject,
|
||||
id: 'vercel-pull-next',
|
||||
name: 'vercel-pull-next',
|
||||
});
|
||||
|
||||
let link: UnPromisify<ReturnType<typeof getLinkedProject>> | undefined;
|
||||
let error: Error | undefined;
|
||||
try {
|
||||
link = await getLinkedProject(client, cwd);
|
||||
} catch (err) {
|
||||
error = err as Error;
|
||||
}
|
||||
|
||||
expect(link).toBeUndefined();
|
||||
|
||||
if (!error) {
|
||||
throw new Error(`Expected an error to be thrown.`);
|
||||
}
|
||||
expect(error.message).toBe(
|
||||
'The specified token is not valid. Use `vercel login` to generate a new token.'
|
||||
);
|
||||
});
|
||||
|
||||
it('should fail to return a link when no access to team', async () => {
|
||||
const cwd = fixture('vercel-pull-next');
|
||||
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
# @vercel/client
|
||||
|
||||
## 12.6.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`346892210`](https://github.com/vercel/vercel/commit/3468922108f411482a72acd0331f0f2ee52a6d4c)]:
|
||||
- @vercel/build-utils@6.8.0
|
||||
|
||||
## 12.6.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/client",
|
||||
"version": "12.6.3",
|
||||
"version": "12.6.2",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"homepage": "https://vercel.com",
|
||||
@@ -35,7 +35,7 @@
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.8.0",
|
||||
"@vercel/build-utils": "6.7.5",
|
||||
"@vercel/routing-utils": "2.2.1",
|
||||
"@zeit/fetch": "5.2.0",
|
||||
"async-retry": "1.2.3",
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"build:docs": "typedoc && node scripts/fix-links.js && prettier --write docs/**/*.md docs/*.md"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@edge-runtime/jest-environment": "2.2.3",
|
||||
"@edge-runtime/jest-environment": "2.0.0",
|
||||
"@types/jest": "27.4.1",
|
||||
"ts-node": "8.9.1",
|
||||
"tsup": "6.1.2",
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# @vercel/frameworks
|
||||
|
||||
## 1.4.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [frameworks] Update `saber.land` to `saber.egoist.dev` ([#10148](https://github.com/vercel/vercel/pull/10148))
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/frameworks",
|
||||
"version": "1.4.3",
|
||||
"version": "1.4.2",
|
||||
"main": "./dist/frameworks.js",
|
||||
"types": "./dist/frameworks.d.ts",
|
||||
"files": [
|
||||
|
||||
@@ -1291,7 +1291,7 @@ export const frameworks = [
|
||||
tagline:
|
||||
'Saber is a framework for building static sites in Vue.js that supports data from any source.',
|
||||
description: 'A Saber site, created with npm init.',
|
||||
website: 'https://saber.egoist.dev',
|
||||
website: 'https://saber.land/',
|
||||
detectors: {
|
||||
every: [
|
||||
{
|
||||
|
||||
@@ -1,20 +1,5 @@
|
||||
# @vercel/fs-detectors
|
||||
|
||||
## 4.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Resolve symlinks in `LocalFileSystemDetector#readdir()` ([#10126](https://github.com/vercel/vercel/pull/10126))
|
||||
|
||||
- Updated dependencies [[`0867f11a6`](https://github.com/vercel/vercel/commit/0867f11a6a1086ef4f4701db2b98da8fcc299586)]:
|
||||
- @vercel/frameworks@1.4.3
|
||||
|
||||
## 4.0.0
|
||||
|
||||
### Major Changes
|
||||
|
||||
- `LocalFileSystemDetector#readdir()` now returns paths relative to the root dir, instead of absolute paths. This is to align with the usage of the detectors that are using the `DetectorFilesystem` interface. ([#10100](https://github.com/vercel/vercel/pull/10100))
|
||||
|
||||
## 3.9.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/fs-detectors",
|
||||
"version": "4.0.1",
|
||||
"version": "3.9.3",
|
||||
"description": "Vercel filesystem detectors",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -15,13 +15,12 @@
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "jest --env node --verbose --runInBand --bail",
|
||||
"test-unit": "pnpm test test/unit.*test.*",
|
||||
"test-e2e": "pnpm test test/integration.test.ts"
|
||||
"test": "jest --env node --verbose --runInBand --bail test/unit.*test.*",
|
||||
"test-unit": "pnpm test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/error-utils": "1.0.10",
|
||||
"@vercel/frameworks": "1.4.3",
|
||||
"@vercel/frameworks": "1.4.2",
|
||||
"@vercel/routing-utils": "2.2.1",
|
||||
"glob": "8.0.3",
|
||||
"js-yaml": "4.1.0",
|
||||
@@ -36,7 +35,7 @@
|
||||
"@types/minimatch": "3.0.5",
|
||||
"@types/node": "14.18.33",
|
||||
"@types/semver": "7.3.10",
|
||||
"@vercel/build-utils": "6.8.0",
|
||||
"@vercel/build-utils": "6.7.5",
|
||||
"typescript": "4.9.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
import fs from 'fs/promises';
|
||||
import { join, relative } from 'path';
|
||||
import type { Dirent } from 'fs';
|
||||
import path from 'path';
|
||||
import { DetectorFilesystem, DetectorFilesystemStat } from './filesystem';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
|
||||
export class LocalFileSystemDetector extends DetectorFilesystem {
|
||||
private rootPath: string;
|
||||
|
||||
constructor(rootPath: string) {
|
||||
super();
|
||||
this.rootPath = rootPath;
|
||||
}
|
||||
|
||||
async _hasPath(name: string): Promise<boolean> {
|
||||
try {
|
||||
await fs.stat(this.getFilePath(name));
|
||||
@@ -22,50 +21,37 @@ export class LocalFileSystemDetector extends DetectorFilesystem {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
_readFile(name: string): Promise<Buffer> {
|
||||
return fs.readFile(this.getFilePath(name));
|
||||
}
|
||||
|
||||
async _isFile(name: string): Promise<boolean> {
|
||||
const stat = await fs.stat(this.getFilePath(name));
|
||||
return stat.isFile();
|
||||
}
|
||||
|
||||
async _readdir(dir: string): Promise<DetectorFilesystemStat[]> {
|
||||
const dirPath = this.getFilePath(dir);
|
||||
const files = await fs.readdir(dirPath);
|
||||
return Promise.all(
|
||||
files.map(async name => {
|
||||
const absPath = join(this.rootPath, dir, name);
|
||||
const path = join(this.getRelativeFilePath(dir), name);
|
||||
|
||||
const stat = await fs.stat(absPath);
|
||||
let type: DetectorFilesystemStat['type'];
|
||||
if (stat.isFile()) {
|
||||
type = 'file';
|
||||
} else if (stat.isDirectory()) {
|
||||
type = 'dir';
|
||||
} else {
|
||||
throw new Error(`Dirent was neither file nor directory: ${path}`);
|
||||
}
|
||||
|
||||
return { name, path, type };
|
||||
})
|
||||
);
|
||||
async _readdir(name: string): Promise<DetectorFilesystemStat[]> {
|
||||
const dirPath = this.getFilePath(name);
|
||||
const dir = await fs.readdir(dirPath, {
|
||||
withFileTypes: true,
|
||||
});
|
||||
const getType = (dirent: Dirent) => {
|
||||
if (dirent.isFile()) {
|
||||
return 'file';
|
||||
} else if (dirent.isDirectory()) {
|
||||
return 'dir';
|
||||
} else {
|
||||
throw new Error(`Dirent was neither file nor directory`);
|
||||
}
|
||||
};
|
||||
return dir.map(dirent => ({
|
||||
name: dirent.name,
|
||||
path: path.join(dirPath, dirent.name),
|
||||
type: getType(dirent),
|
||||
}));
|
||||
}
|
||||
|
||||
_chdir(name: string): DetectorFilesystem {
|
||||
return new LocalFileSystemDetector(this.getFilePath(name));
|
||||
}
|
||||
|
||||
private getRelativeFilePath(name: string) {
|
||||
return name.startsWith(this.rootPath)
|
||||
? relative(this.rootPath, name)
|
||||
: name;
|
||||
}
|
||||
|
||||
private getFilePath(name: string) {
|
||||
return join(this.rootPath, this.getRelativeFilePath(name));
|
||||
return path.join(this.rootPath, name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"probes": [
|
||||
{
|
||||
"path": "/api/my-endpoint",
|
||||
"mustContain": "my-endpoint",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/api/other-endpoint",
|
||||
"mustContain": "other-endpoint",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/api/team/zeit",
|
||||
"mustContain": "team/zeit",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/api/user/myself",
|
||||
"mustContain": "user/myself",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/api/not-okay/",
|
||||
"status": 404
|
||||
},
|
||||
{
|
||||
"path": "/api",
|
||||
"status": 404
|
||||
},
|
||||
{
|
||||
"path": "/api/",
|
||||
"status": 404
|
||||
},
|
||||
{
|
||||
"path": "/",
|
||||
"mustContain": "hello from index.txt"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
{
|
||||
"probes": [
|
||||
{
|
||||
"path": "/api/not-okay",
|
||||
"status": 404
|
||||
},
|
||||
{
|
||||
"path": "/api",
|
||||
"mustContain": "hello from api/index.js",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/api/",
|
||||
"mustContain": "hello from api/index.js",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/api/index",
|
||||
"mustContain": "hello from api/index.js",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/api/index.js",
|
||||
"mustContain": "hello from api/index.js",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/api/date.js",
|
||||
"mustContain": "hello from api/date.js",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/api/date",
|
||||
"mustContain": "hello from api/date.js",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/api/date/",
|
||||
"mustContain": "hello from api/date.js",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/api/date/index",
|
||||
"mustContain": "hello from api/date/index.js",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/api/date/index.js",
|
||||
"mustContain": "hello from api/date/index.js",
|
||||
"status": 200
|
||||
},
|
||||
{
|
||||
"path": "/",
|
||||
"mustContain": "hello from index.txt"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
package.json
|
||||
136
packages/fs-detectors/test/integration.test.ts
vendored
136
packages/fs-detectors/test/integration.test.ts
vendored
@@ -1,4 +1,8 @@
|
||||
import { join } from 'path';
|
||||
import path from 'path';
|
||||
import { promises } from 'fs';
|
||||
import { glob } from '@vercel/build-utils';
|
||||
import { detectBuilders } from '../src';
|
||||
const fs = promises;
|
||||
|
||||
import {
|
||||
testDeployment,
|
||||
@@ -8,13 +12,139 @@ import {
|
||||
jest.setTimeout(4 * 60 * 1000);
|
||||
|
||||
it('Test `detectBuilders` and `detectRoutes`', async () => {
|
||||
const fixture = join(__dirname, 'fixtures', '01-zero-config-api');
|
||||
const fixture = path.join(__dirname, 'fixtures', '01-zero-config-api');
|
||||
const json = await fs.readFile(path.join(fixture, 'package.json'), 'utf8');
|
||||
const pkg = JSON.parse(json);
|
||||
const fileList = await glob('**', { cwd: fixture });
|
||||
const files = Object.keys(fileList);
|
||||
|
||||
const probes = [
|
||||
{
|
||||
path: '/api/my-endpoint',
|
||||
mustContain: 'my-endpoint',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
path: '/api/other-endpoint',
|
||||
mustContain: 'other-endpoint',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
path: '/api/team/zeit',
|
||||
mustContain: 'team/zeit',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
path: '/api/user/myself',
|
||||
mustContain: 'user/myself',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
path: '/api/not-okay/',
|
||||
status: 404,
|
||||
},
|
||||
{
|
||||
path: '/api',
|
||||
status: 404,
|
||||
},
|
||||
{
|
||||
path: '/api/',
|
||||
status: 404,
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
mustContain: 'hello from index.txt',
|
||||
},
|
||||
];
|
||||
|
||||
const { builders, defaultRoutes } = await detectBuilders(files, pkg);
|
||||
|
||||
const nowConfig = { builds: builders, routes: defaultRoutes, probes };
|
||||
|
||||
await fs.writeFile(
|
||||
path.join(fixture, 'now.json'),
|
||||
JSON.stringify(nowConfig, null, 2)
|
||||
);
|
||||
|
||||
const deployment = await testDeployment(fixture);
|
||||
expect(deployment).toBeDefined();
|
||||
});
|
||||
|
||||
it('Test `detectBuilders` with `index` files', async () => {
|
||||
const fixture = join(__dirname, 'fixtures', '02-zero-config-api');
|
||||
const fixture = path.join(__dirname, 'fixtures', '02-zero-config-api');
|
||||
const json = await fs.readFile(path.join(fixture, 'package.json'), 'utf8');
|
||||
const pkg = JSON.parse(json);
|
||||
const fileList = await glob('**', fixture);
|
||||
const files = Object.keys(fileList);
|
||||
|
||||
const probes = [
|
||||
{
|
||||
path: '/api/not-okay',
|
||||
status: 404,
|
||||
},
|
||||
{
|
||||
path: '/api',
|
||||
mustContain: 'hello from api/index.js',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
path: '/api/',
|
||||
mustContain: 'hello from api/index.js',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
path: '/api/index',
|
||||
mustContain: 'hello from api/index.js',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
path: '/api/index.js',
|
||||
mustContain: 'hello from api/index.js',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
path: '/api/date.js',
|
||||
mustContain: 'hello from api/date.js',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
// Someone might expect this to be `date.js`,
|
||||
// but I doubt that there is any case were both
|
||||
// `date/index.js` and `date.js` exists,
|
||||
// so it is not special cased
|
||||
path: '/api/date',
|
||||
mustContain: 'hello from api/date/index.js',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
path: '/api/date/',
|
||||
mustContain: 'hello from api/date/index.js',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
path: '/api/date/index',
|
||||
mustContain: 'hello from api/date/index.js',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
path: '/api/date/index.js',
|
||||
mustContain: 'hello from api/date/index.js',
|
||||
status: 200,
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
mustContain: 'hello from index.txt',
|
||||
},
|
||||
];
|
||||
|
||||
const { builders, defaultRoutes } = await detectBuilders(files, pkg);
|
||||
|
||||
const nowConfig = { builds: builders, routes: defaultRoutes, probes };
|
||||
await fs.writeFile(
|
||||
path.join(fixture, 'now.json'),
|
||||
JSON.stringify(nowConfig, null, 2)
|
||||
);
|
||||
|
||||
const deployment = await testDeployment(fixture);
|
||||
expect(deployment).toBeDefined();
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import path from 'path';
|
||||
import { LocalFileSystemDetector } from '../src';
|
||||
import { detectFramework } from '../src/detect-framework';
|
||||
import monorepoManagers from '../src/monorepos/monorepo-managers';
|
||||
import { FixtureFilesystem } from './utils/fixture-filesystem';
|
||||
|
||||
describe('monorepo-managers', () => {
|
||||
describe.each([
|
||||
@@ -17,7 +17,7 @@ describe('monorepo-managers', () => {
|
||||
|
||||
it(testName, async () => {
|
||||
const fixture = path.join(__dirname, 'fixtures', fixturePath);
|
||||
const fs = new LocalFileSystemDetector(fixture);
|
||||
const fs = new FixtureFilesystem(fixture);
|
||||
|
||||
const result = await detectFramework({
|
||||
fs,
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import path from 'path';
|
||||
import {
|
||||
packageManagers,
|
||||
detectFramework,
|
||||
LocalFileSystemDetector,
|
||||
} from '../src';
|
||||
import { packageManagers, detectFramework } from '../src';
|
||||
import { FixtureFilesystem } from './utils/fixture-filesystem';
|
||||
|
||||
describe('package-managers', () => {
|
||||
describe.each([
|
||||
@@ -19,7 +16,7 @@ describe('package-managers', () => {
|
||||
|
||||
it(testName, async () => {
|
||||
const fixture = path.join(__dirname, 'fixtures', fixturePath);
|
||||
const fs = new LocalFileSystemDetector(fixture);
|
||||
const fs = new FixtureFilesystem(fixture);
|
||||
|
||||
const result = await detectFramework({
|
||||
fs,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import path from 'path';
|
||||
import { LocalFileSystemDetector } from '../src';
|
||||
import { detectFramework } from '../src/detect-framework';
|
||||
import workspaceManagers from '../src/workspaces/workspace-managers';
|
||||
import { FixtureFilesystem } from './utils/fixture-filesystem';
|
||||
|
||||
describe('workspace-managers', () => {
|
||||
describe.each([
|
||||
@@ -19,7 +19,7 @@ describe('workspace-managers', () => {
|
||||
|
||||
it(testName, async () => {
|
||||
const fixture = path.join(__dirname, 'fixtures', fixturePath);
|
||||
const fs = new LocalFileSystemDetector(fixture);
|
||||
const fs = new FixtureFilesystem(fixture);
|
||||
|
||||
const result = await detectFramework({
|
||||
fs,
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import frameworkList from '@vercel/frameworks';
|
||||
import { detectFramework, LocalFileSystemDetector } from '../src';
|
||||
import { detectFramework } from '../src';
|
||||
import { FixtureFilesystem } from './utils/fixture-filesystem';
|
||||
import { getExamples } from '../../../examples/__tests__/test-utils';
|
||||
|
||||
describe('examples should be detected', () => {
|
||||
it.each(getExamples())(
|
||||
'should detect $exampleName',
|
||||
async ({ exampleName, examplePath }) => {
|
||||
const fs = new LocalFileSystemDetector(examplePath);
|
||||
const fs = new FixtureFilesystem(examplePath);
|
||||
const framework = await detectFramework({ fs, frameworkList });
|
||||
if (!framework) {
|
||||
throw new Error(`Framework not detected for example "${exampleName}".`);
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import { mkdtempSync } from 'fs';
|
||||
import {
|
||||
getMonorepoDefaultSettings,
|
||||
LocalFileSystemDetector,
|
||||
MissingBuildPipeline,
|
||||
MissingBuildTarget,
|
||||
} from '../src';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import { FixtureFilesystem } from './utils/fixture-filesystem';
|
||||
|
||||
describe('getMonorepoDefaultSettings', () => {
|
||||
test('MissingBuildTarget is an error', () => {
|
||||
@@ -68,7 +69,7 @@ describe('getMonorepoDefaultSettings', () => {
|
||||
},
|
||||
};
|
||||
|
||||
const fs = new LocalFileSystemDetector(
|
||||
const ffs = new FixtureFilesystem(
|
||||
path.join(
|
||||
__dirname,
|
||||
'fixtures',
|
||||
@@ -80,16 +81,16 @@ describe('getMonorepoDefaultSettings', () => {
|
||||
packageName,
|
||||
isRoot ? '/' : 'packages/app-1',
|
||||
isRoot ? '/' : '../..',
|
||||
fs
|
||||
ffs
|
||||
);
|
||||
expect(result).toStrictEqual(expectedResultMap[expectedResultKey]);
|
||||
}
|
||||
);
|
||||
|
||||
test('returns null when neither nx nor turbo is detected', async () => {
|
||||
const dir = mkdtempSync(path.join(os.tmpdir(), 'monorepo-test-'));
|
||||
const fs = new LocalFileSystemDetector(dir);
|
||||
const result = await getMonorepoDefaultSettings('', '', '', fs);
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'monorepo-test-'));
|
||||
const lfs = new LocalFileSystemDetector(dir);
|
||||
const result = await getMonorepoDefaultSettings('', '', '', lfs);
|
||||
expect(result).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import path from 'path';
|
||||
import { normalizePath } from '@vercel/build-utils';
|
||||
import { getProjectPaths, ProjectPath } from '../src/get-project-paths';
|
||||
import { LocalFileSystemDetector } from '../src';
|
||||
import { FixtureFilesystem } from './utils/fixture-filesystem';
|
||||
|
||||
describe.each<{
|
||||
fixturePath: string;
|
||||
@@ -52,7 +52,7 @@ describe.each<{
|
||||
|
||||
it(testName, async () => {
|
||||
const fixture = path.join(__dirname, 'fixtures', fixturePath);
|
||||
const fs = new LocalFileSystemDetector(fixture);
|
||||
const fs = new FixtureFilesystem(fixture);
|
||||
const mockReaddir = jest.fn().mockImplementation(fs.readdir);
|
||||
const mockHasPath = jest.fn().mockImplementation(fs.hasPath);
|
||||
fs.readdir = mockReaddir;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import path from 'path';
|
||||
import { getWorkspaces } from '../src/workspaces/get-workspaces';
|
||||
import { getWorkspacePackagePaths } from '../src/workspaces/get-workspace-package-paths';
|
||||
import { LocalFileSystemDetector } from '../src';
|
||||
import { FixtureFilesystem } from './utils/fixture-filesystem';
|
||||
|
||||
describe.each<[string, string[]]>([
|
||||
['21-npm-workspaces', ['/a', '/b']],
|
||||
@@ -32,7 +32,7 @@ describe.each<[string, string[]]>([
|
||||
|
||||
it(testName, async () => {
|
||||
const fixture = path.join(__dirname, 'fixtures', fixturePath);
|
||||
const fs = new LocalFileSystemDetector(fixture);
|
||||
const fs = new FixtureFilesystem(fixture);
|
||||
|
||||
const workspaces = await getWorkspaces({ fs });
|
||||
const actualPackagePaths = (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import path from 'path';
|
||||
import { LocalFileSystemDetector } from '../src';
|
||||
import { getWorkspaces, Workspace } from '../src/workspaces/get-workspaces';
|
||||
import { FixtureFilesystem } from './utils/fixture-filesystem';
|
||||
|
||||
describe.each<[string, Workspace[]]>([
|
||||
['21-npm-workspaces', [{ type: 'npm', rootPath: '/' }]],
|
||||
@@ -23,7 +23,6 @@ describe.each<[string, Workspace[]]>([
|
||||
],
|
||||
],
|
||||
['22-pnpm', []],
|
||||
['35-no-monorepo', []],
|
||||
])('`getWorkspaces()`', (fixturePath, workspaces) => {
|
||||
const expectedImplementations = workspaces.map(({ type }) => type);
|
||||
const testName =
|
||||
@@ -35,7 +34,7 @@ describe.each<[string, Workspace[]]>([
|
||||
|
||||
it(testName, async () => {
|
||||
const fixture = path.join(__dirname, 'fixtures', fixturePath);
|
||||
const fs = new LocalFileSystemDetector(fixture);
|
||||
const fs = new FixtureFilesystem(fixture);
|
||||
|
||||
const actualWorkspaces = await getWorkspaces({ fs });
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { LocalFileSystemDetector, DetectorFilesystem } from '../src';
|
||||
|
||||
const tmpdir = path.join(os.tmpdir(), 'local-file-system-test');
|
||||
|
||||
const dirs = ['', 'a', `a${path.sep}b`]; // root, single-nested, double-nested
|
||||
const dirs = ['', 'a', 'a/b']; // root, single-nested, double-nested
|
||||
const files = ['foo', 'bar'];
|
||||
const filePaths = dirs.flatMap(dir => files.map(file => path.join(dir, file)));
|
||||
|
||||
@@ -63,7 +63,12 @@ describe('LocalFileSystemDetector', () => {
|
||||
const readdirResults = await Promise.all(
|
||||
dirs.map(dir => localFileSystem.readdir(dir))
|
||||
);
|
||||
const expectedPaths = [...dirs, ...filePaths].sort().slice(1); // drop the first path since its the root
|
||||
const expectedPaths = [
|
||||
...dirs.map(dir => path.join(tmpdir, dir)),
|
||||
...filePaths.map(filePath => path.join(tmpdir, filePath)),
|
||||
]
|
||||
.sort()
|
||||
.slice(1); // drop the first path since its the root
|
||||
const actualPaths = readdirResults
|
||||
.flatMap(result => result.map(stat => stat.path))
|
||||
.sort();
|
||||
|
||||
51
packages/fs-detectors/test/utils/fixture-filesystem.ts
Normal file
51
packages/fs-detectors/test/utils/fixture-filesystem.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { promises } from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { DetectorFilesystem } from '../../src';
|
||||
import { DetectorFilesystemStat } from '../../src/detectors/filesystem';
|
||||
|
||||
const { stat, readFile, readdir } = promises;
|
||||
|
||||
export class FixtureFilesystem extends DetectorFilesystem {
|
||||
private rootPath: string;
|
||||
|
||||
constructor(fixturePath: string) {
|
||||
super();
|
||||
|
||||
this.rootPath = fixturePath;
|
||||
}
|
||||
|
||||
async _hasPath(name: string): Promise<boolean> {
|
||||
try {
|
||||
const filePath = path.join(this.rootPath, name);
|
||||
await stat(filePath);
|
||||
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
async _readFile(name: string): Promise<Buffer> {
|
||||
const filePath = path.join(this.rootPath, name);
|
||||
return readFile(filePath);
|
||||
}
|
||||
async _isFile(name: string): Promise<boolean> {
|
||||
const filePath = path.join(this.rootPath, name);
|
||||
return (await stat(filePath)).isFile();
|
||||
}
|
||||
|
||||
async _readdir(name: string): Promise<DetectorFilesystemStat[]> {
|
||||
const dirPath = path.join(this.rootPath, name);
|
||||
const files = await readdir(dirPath, { withFileTypes: true });
|
||||
|
||||
return files.map(file => ({
|
||||
name: file.name,
|
||||
type: file.isFile() ? 'file' : 'dir',
|
||||
path: path.join(name, file.name),
|
||||
}));
|
||||
}
|
||||
|
||||
_chdir(name: string): DetectorFilesystem {
|
||||
return new FixtureFilesystem(path.join(this.rootPath, name));
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,5 @@
|
||||
# @vercel/gatsby-plugin-vercel-builder
|
||||
|
||||
## 1.3.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`346892210`](https://github.com/vercel/vercel/commit/3468922108f411482a72acd0331f0f2ee52a6d4c)]:
|
||||
- @vercel/build-utils@6.8.0
|
||||
- @vercel/node@2.15.3
|
||||
|
||||
## 1.3.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`91406abdb`](https://github.com/vercel/vercel/commit/91406abdb0c332152fc6c7c1e4bd3a872b084434), [`8b3a4146a`](https://github.com/vercel/vercel/commit/8b3a4146af68d2b7288c80a5b919d832dba929b5)]:
|
||||
- @vercel/node@2.15.2
|
||||
|
||||
## 1.3.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/gatsby-plugin-vercel-builder",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.9",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -20,8 +20,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@sinclair/typebox": "0.25.24",
|
||||
"@vercel/build-utils": "6.8.0",
|
||||
"@vercel/node": "2.15.3",
|
||||
"@vercel/build-utils": "6.7.5",
|
||||
"@vercel/node": "2.15.1",
|
||||
"@vercel/routing-utils": "2.2.1",
|
||||
"esbuild": "0.14.47",
|
||||
"etag": "1.8.1",
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"@types/node-fetch": "^2.3.0",
|
||||
"@types/tar": "^4.0.0",
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vercel/build-utils": "6.8.0",
|
||||
"@vercel/build-utils": "6.7.5",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"async-retry": "1.3.1",
|
||||
"execa": "^1.0.0",
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"devDependencies": {
|
||||
"@types/jest": "27.5.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "6.8.0",
|
||||
"@vercel/build-utils": "6.7.5",
|
||||
"@vercel/static-config": "2.0.17",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "11.1.0",
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
# @vercel/next
|
||||
|
||||
## 3.8.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [next] Update payload flag ([#10147](https://github.com/vercel/vercel/pull/10147))
|
||||
|
||||
- Use `getNodeBinPaths()` function to improve monorepo support ([#10150](https://github.com/vercel/vercel/pull/10150))
|
||||
|
||||
## 3.8.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/next",
|
||||
"version": "3.8.7",
|
||||
"version": "3.8.6",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
||||
@@ -35,7 +35,7 @@
|
||||
"@types/semver": "6.0.0",
|
||||
"@types/text-table": "0.2.1",
|
||||
"@types/webpack-sources": "3.2.0",
|
||||
"@vercel/build-utils": "6.8.0",
|
||||
"@vercel/build-utils": "6.7.5",
|
||||
"@vercel/nft": "0.22.5",
|
||||
"@vercel/routing-utils": "2.2.1",
|
||||
"async-sema": "3.0.1",
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
runPackageJsonScript,
|
||||
execCommand,
|
||||
getEnvForPackageManager,
|
||||
getNodeBinPaths,
|
||||
getNodeBinPath,
|
||||
scanParentDirs,
|
||||
BuildV2,
|
||||
PrepareCache,
|
||||
@@ -431,11 +431,7 @@ export const build: BuildV2 = async ({
|
||||
|
||||
if (buildCommand) {
|
||||
// Add `node_modules/.bin` to PATH
|
||||
const nodeBinPaths = getNodeBinPaths({
|
||||
start: entryPath,
|
||||
base: repoRootPath,
|
||||
});
|
||||
const nodeBinPath = nodeBinPaths.join(path.delimiter);
|
||||
const nodeBinPath = await getNodeBinPath({ cwd: entryPath });
|
||||
env.PATH = `${nodeBinPath}${path.delimiter}${env.PATH}`;
|
||||
|
||||
// Yarn v2 PnP mode may be activated, so force "node-modules" linker style
|
||||
@@ -1096,7 +1092,7 @@ export const build: BuildV2 = async ({
|
||||
operationType: 'Page', // always Page because we're in legacy mode
|
||||
shouldAddHelpers: false,
|
||||
shouldAddSourcemapSupport: false,
|
||||
supportsMultiPayloads: true,
|
||||
supportsMultiPayloads: !!process.env.NEXT_PRIVATE_MULTI_PAYLOAD,
|
||||
framework: {
|
||||
slug: 'nextjs',
|
||||
version: nextVersion,
|
||||
|
||||
@@ -821,7 +821,7 @@ export async function createLambdaFromPseudoLayers({
|
||||
files,
|
||||
shouldAddHelpers: false,
|
||||
shouldAddSourcemapSupport: false,
|
||||
supportsMultiPayloads: true,
|
||||
supportsMultiPayloads: !!process.env.NEXT_PRIVATE_MULTI_PAYLOAD,
|
||||
framework: {
|
||||
slug: 'nextjs',
|
||||
version: nextVersion,
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
"version": 2,
|
||||
"uploadNowJson": true,
|
||||
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
|
||||
"build": {
|
||||
"env": {
|
||||
"NEXT_PRIVATE_MULTI_PAYLOAD": "1"
|
||||
}
|
||||
},
|
||||
"probes": [
|
||||
{
|
||||
"path": "/lambda",
|
||||
|
||||
@@ -1,20 +1,5 @@
|
||||
# @vercel/node
|
||||
|
||||
## 2.15.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`346892210`](https://github.com/vercel/vercel/commit/3468922108f411482a72acd0331f0f2ee52a6d4c)]:
|
||||
- @vercel/build-utils@6.8.0
|
||||
|
||||
## 2.15.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- add tests to getBodyParser helper ([#10109](https://github.com/vercel/vercel/pull/10109))
|
||||
|
||||
- [node] use `undici.Websocket` when is possible ([#10051](https://github.com/vercel/vercel/pull/10051))
|
||||
|
||||
## 2.15.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/node",
|
||||
"version": "2.15.3",
|
||||
"version": "2.15.1",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
|
||||
@@ -21,21 +21,22 @@
|
||||
"dependencies": {
|
||||
"@edge-runtime/node-utils": "2.0.3",
|
||||
"@edge-runtime/primitives": "2.1.2",
|
||||
"@edge-runtime/vm": "3.0.1",
|
||||
"@edge-runtime/vm": "2.0.0",
|
||||
"@types/node": "14.18.33",
|
||||
"@types/node-fetch": "2.6.3",
|
||||
"@vercel/build-utils": "6.8.0",
|
||||
"@vercel/build-utils": "6.7.5",
|
||||
"@vercel/error-utils": "1.0.10",
|
||||
"@vercel/static-config": "2.0.17",
|
||||
"async-listen": "3.0.0",
|
||||
"edge-runtime": "2.4.3",
|
||||
"edge-runtime": "2.1.4",
|
||||
"esbuild": "0.14.47",
|
||||
"exit-hook": "2.2.1",
|
||||
"node-fetch": "2.6.9",
|
||||
"path-to-regexp": "6.2.1",
|
||||
"ts-morph": "12.0.0",
|
||||
"ts-node": "10.9.1",
|
||||
"typescript": "4.9.5"
|
||||
"typescript": "4.9.5",
|
||||
"ws": "8.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.5.0",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user