mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-24 11:49:13 +00:00
Compare commits
45 Commits
@vercel/no
...
@vercel/fr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2661f56347 | ||
|
|
b1c14cde03 | ||
|
|
8dd6d021df | ||
|
|
88ec6e69d6 | ||
|
|
a6f2e7b136 | ||
|
|
e906365909 | ||
|
|
7b01a07394 | ||
|
|
ce4633fe4d | ||
|
|
fdf86fda03 | ||
|
|
56178e6a46 | ||
|
|
5439d7c0c9 | ||
|
|
c670e51712 | ||
|
|
b56639b624 | ||
|
|
12bbae098c | ||
|
|
9969f0ba18 | ||
|
|
24e1e3c3be | ||
|
|
b61674cb2d | ||
|
|
cae60155f3 | ||
|
|
a91bde5287 | ||
|
|
0750517af9 | ||
|
|
70f6782954 | ||
|
|
5f1e37ee16 | ||
|
|
680d666fdc | ||
|
|
06a5dccfed | ||
|
|
f85df894c0 | ||
|
|
e9ec779f1c | ||
|
|
4333d1e6b2 | ||
|
|
493a31091d | ||
|
|
8d7206f5b6 | ||
|
|
4bf2ca55ff | ||
|
|
5e5332fbc9 | ||
|
|
281ec776a5 | ||
|
|
ee8f9292b4 | ||
|
|
027bce00b3 | ||
|
|
ca1f41200a | ||
|
|
834b3e652b | ||
|
|
5c6941d18c | ||
|
|
761ede2482 | ||
|
|
1d01703dc3 | ||
|
|
7021279b28 | ||
|
|
28acf50bdf | ||
|
|
718bbd365a | ||
|
|
7e791ee080 | ||
|
|
13769106cb | ||
|
|
aa734efc6c |
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -7,7 +7,7 @@
|
||||
/packages/fs-detectors @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @agadzik @chloetedder
|
||||
/packages/next @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
|
||||
/packages/routing-utils @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
|
||||
/packages/edge @vercel/edge-compute
|
||||
/packages/edge @vercel/compute
|
||||
/examples @leerob
|
||||
/examples/create-react-app @Timer
|
||||
/examples/nextjs @timneutkens @ijjk @styfle
|
||||
|
||||
469
examples/nextjs/package-lock.json
generated
469
examples/nextjs/package-lock.json
generated
@@ -8,17 +8,25 @@
|
||||
"name": "nextjs",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"eslint": "8.43.0",
|
||||
"eslint-config-next": "13.4.7",
|
||||
"next": "13.4.7",
|
||||
"eslint": "8.45.0",
|
||||
"eslint-config-next": "13.4.12",
|
||||
"next": "13.4.12",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@aashutoshrathi/word-wrap": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz",
|
||||
"integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/runtime": {
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz",
|
||||
"integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==",
|
||||
"version": "7.22.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.6.tgz",
|
||||
"integrity": "sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==",
|
||||
"dependencies": {
|
||||
"regenerator-runtime": "^0.13.11"
|
||||
},
|
||||
@@ -49,13 +57,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/eslintrc": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz",
|
||||
"integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz",
|
||||
"integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==",
|
||||
"dependencies": {
|
||||
"ajv": "^6.12.4",
|
||||
"debug": "^4.3.2",
|
||||
"espree": "^9.5.2",
|
||||
"espree": "^9.6.0",
|
||||
"globals": "^13.19.0",
|
||||
"ignore": "^5.2.0",
|
||||
"import-fresh": "^3.2.1",
|
||||
@@ -71,9 +79,9 @@
|
||||
}
|
||||
},
|
||||
"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.44.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz",
|
||||
"integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==",
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
@@ -109,22 +117,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.12",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.4.12.tgz",
|
||||
"integrity": "sha512-RmHanbV21saP/6OEPBJ7yJMuys68cIf8OBBWd7+uj40LdpmswVAwe1uzeuFyUsd6SfeITWT3XnQfn6wULeKwDQ=="
|
||||
},
|
||||
"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.12",
|
||||
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.4.12.tgz",
|
||||
"integrity": "sha512-6rhK9CdxEgj/j1qvXIyLTWEaeFv7zOK8yJMulz3Owel0uek0U9MJCGzmKgYxM3aAUBo3gKeywCZKyQnJKto60A==",
|
||||
"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.12",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.4.12.tgz",
|
||||
"integrity": "sha512-deUrbCXTMZ6ZhbOoloqecnUeNpUOupi8SE2tx4jPfNS9uyUR9zK4iXBvH65opVcA/9F5I/p8vDXSYbUlbmBjZg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -137,9 +145,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.12",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.4.12.tgz",
|
||||
"integrity": "sha512-WRvH7RxgRHlC1yb5oG0ZLx8F7uci9AivM5/HGGv9ZyG2Als8Ij64GC3d+mQ5sJhWjusyU6T6V1WKTUoTmOB0zQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -152,9 +160,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.12",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.4.12.tgz",
|
||||
"integrity": "sha512-YEKracAWuxp54tKiAvvq73PUs9lok57cc8meYRibTWe/VdPB2vLgkTVWFcw31YDuRXdEhdX0fWS6Q+ESBhnEig==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -167,9 +175,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.12",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.4.12.tgz",
|
||||
"integrity": "sha512-LhJR7/RAjdHJ2Isl2pgc/JaoxNk0KtBgkVpiDJPVExVWA1c6gzY57+3zWuxuyWzTG+fhLZo2Y80pLXgIJv7g3g==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -182,9 +190,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.12",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.4.12.tgz",
|
||||
"integrity": "sha512-1DWLL/B9nBNiQRng+1aqs3OaZcxC16Nf+mOnpcrZZSdyKHek3WQh6j/fkbukObgNGwmCoVevLUa/p3UFTTqgqg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -197,9 +205,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.12",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.4.12.tgz",
|
||||
"integrity": "sha512-kEAJmgYFhp0VL+eRWmUkVxLVunn7oL9Mdue/FS8yzRBVj7Z0AnIrHpTIeIUl1bbdQq1VaoOztnKicAjfkLTRCQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -212,9 +220,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.12",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.4.12.tgz",
|
||||
"integrity": "sha512-GMLuL/loR6yIIRTnPRY6UGbLL9MBdw2anxkOnANxvLvsml4F0HNIgvnU3Ej4BjbqMTNjD4hcPFdlEow4XHPdZA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -227,9 +235,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.12",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.4.12.tgz",
|
||||
"integrity": "sha512-PhgNqN2Vnkm7XaMdRmmX0ZSwZXQAtamBVSa9A/V1dfKQCV1rjIZeiy/dbBnVYGdj63ANfsOR/30XpxP71W0eww==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -242,9 +250,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.12",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.12.tgz",
|
||||
"integrity": "sha512-Z+56e/Ljt0bUs+T+jPjhFyxYBcdY2RIq9ELFU+qAMQMteHo7ymbV7CKmlcX59RI9C4YzN8PgMgLyAoi916b5HA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -289,16 +297,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@pkgr/utils": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.1.tgz",
|
||||
"integrity": "sha512-JOqwkgFEyi+OROIyq7l4Jy28h/WwhDnG/cPkXG2Z1iFbubB6jsHW1NDvmyOzTBxHr3yg68YGirmh1JUgMqa+9w==",
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz",
|
||||
"integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==",
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.3",
|
||||
"fast-glob": "^3.2.12",
|
||||
"fast-glob": "^3.3.0",
|
||||
"is-glob": "^4.0.3",
|
||||
"open": "^9.1.0",
|
||||
"picocolors": "^1.0.0",
|
||||
"tslib": "^2.5.0"
|
||||
"tslib": "^2.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20.0 || ^14.18.0 || >=16.0.0"
|
||||
@@ -326,13 +334,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.62.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz",
|
||||
"integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==",
|
||||
"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.62.0",
|
||||
"@typescript-eslint/types": "5.62.0",
|
||||
"@typescript-eslint/typescript-estree": "5.62.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -352,12 +360,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.62.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz",
|
||||
"integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.60.0",
|
||||
"@typescript-eslint/visitor-keys": "5.60.0"
|
||||
"@typescript-eslint/types": "5.62.0",
|
||||
"@typescript-eslint/visitor-keys": "5.62.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
@@ -368,9 +376,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.62.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz",
|
||||
"integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==",
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
@@ -380,12 +388,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.62.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz",
|
||||
"integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.60.0",
|
||||
"@typescript-eslint/visitor-keys": "5.60.0",
|
||||
"@typescript-eslint/types": "5.62.0",
|
||||
"@typescript-eslint/visitor-keys": "5.62.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
@@ -406,11 +414,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "5.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.62.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz",
|
||||
"integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.60.0",
|
||||
"@typescript-eslint/types": "5.62.0",
|
||||
"eslint-visitor-keys": "^3.3.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -422,9 +430,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.10.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz",
|
||||
"integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==",
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@@ -483,9 +491,9 @@
|
||||
"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.3.0",
|
||||
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
|
||||
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
|
||||
"dependencies": {
|
||||
"dequal": "^2.0.3"
|
||||
}
|
||||
@@ -574,6 +582,25 @@
|
||||
"get-intrinsic": "^1.1.3"
|
||||
}
|
||||
},
|
||||
"node_modules/arraybuffer.prototype.slice": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz",
|
||||
"integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==",
|
||||
"dependencies": {
|
||||
"array-buffer-byte-length": "^1.0.0",
|
||||
"call-bind": "^1.0.2",
|
||||
"define-properties": "^1.2.0",
|
||||
"get-intrinsic": "^1.2.1",
|
||||
"is-array-buffer": "^3.0.2",
|
||||
"is-shared-array-buffer": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/ast-types-flow": {
|
||||
"version": "0.0.7",
|
||||
"resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz",
|
||||
@@ -696,9 +723,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.30001517",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz",
|
||||
"integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@@ -900,17 +927,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/es-abstract": {
|
||||
"version": "1.21.2",
|
||||
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz",
|
||||
"integrity": "sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==",
|
||||
"version": "1.22.1",
|
||||
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz",
|
||||
"integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==",
|
||||
"dependencies": {
|
||||
"array-buffer-byte-length": "^1.0.0",
|
||||
"arraybuffer.prototype.slice": "^1.0.1",
|
||||
"available-typed-arrays": "^1.0.5",
|
||||
"call-bind": "^1.0.2",
|
||||
"es-set-tostringtag": "^2.0.1",
|
||||
"es-to-primitive": "^1.2.1",
|
||||
"function.prototype.name": "^1.1.5",
|
||||
"get-intrinsic": "^1.2.0",
|
||||
"get-intrinsic": "^1.2.1",
|
||||
"get-symbol-description": "^1.0.0",
|
||||
"globalthis": "^1.0.3",
|
||||
"gopd": "^1.0.1",
|
||||
@@ -930,14 +958,18 @@
|
||||
"object-inspect": "^1.12.3",
|
||||
"object-keys": "^1.1.1",
|
||||
"object.assign": "^4.1.4",
|
||||
"regexp.prototype.flags": "^1.4.3",
|
||||
"regexp.prototype.flags": "^1.5.0",
|
||||
"safe-array-concat": "^1.0.0",
|
||||
"safe-regex-test": "^1.0.0",
|
||||
"string.prototype.trim": "^1.2.7",
|
||||
"string.prototype.trimend": "^1.0.6",
|
||||
"string.prototype.trimstart": "^1.0.6",
|
||||
"typed-array-buffer": "^1.0.0",
|
||||
"typed-array-byte-length": "^1.0.0",
|
||||
"typed-array-byte-offset": "^1.0.0",
|
||||
"typed-array-length": "^1.0.4",
|
||||
"unbox-primitive": "^1.0.2",
|
||||
"which-typed-array": "^1.1.9"
|
||||
"which-typed-array": "^1.1.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -995,14 +1027,14 @@
|
||||
}
|
||||
},
|
||||
"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.45.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.45.0.tgz",
|
||||
"integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.2.0",
|
||||
"@eslint-community/regexpp": "^4.4.0",
|
||||
"@eslint/eslintrc": "^2.0.3",
|
||||
"@eslint/js": "8.43.0",
|
||||
"@eslint/eslintrc": "^2.1.0",
|
||||
"@eslint/js": "8.44.0",
|
||||
"@humanwhocodes/config-array": "^0.11.10",
|
||||
"@humanwhocodes/module-importer": "^1.0.1",
|
||||
"@nodelib/fs.walk": "^1.2.8",
|
||||
@@ -1014,7 +1046,7 @@
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"eslint-scope": "^7.2.0",
|
||||
"eslint-visitor-keys": "^3.4.1",
|
||||
"espree": "^9.5.2",
|
||||
"espree": "^9.6.0",
|
||||
"esquery": "^1.4.2",
|
||||
"esutils": "^2.0.2",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
@@ -1024,7 +1056,6 @@
|
||||
"globals": "^13.19.0",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.0",
|
||||
"import-fresh": "^3.0.0",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"is-glob": "^4.0.0",
|
||||
"is-path-inside": "^3.0.3",
|
||||
@@ -1034,9 +1065,8 @@
|
||||
"lodash.merge": "^4.6.2",
|
||||
"minimatch": "^3.1.2",
|
||||
"natural-compare": "^1.4.0",
|
||||
"optionator": "^0.9.1",
|
||||
"optionator": "^0.9.3",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"strip-json-comments": "^3.1.0",
|
||||
"text-table": "^0.2.0"
|
||||
},
|
||||
"bin": {
|
||||
@@ -1050,11 +1080,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.12",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.4.12.tgz",
|
||||
"integrity": "sha512-ZF0r5vxKaVazyZH/37Au/XItiG7qUOBw+HaH3PeyXltIMwXorsn6bdrl0Nn9N5v5v9spc+6GM2ryjugbjF6X2g==",
|
||||
"dependencies": {
|
||||
"@next/eslint-plugin-next": "13.4.7",
|
||||
"@next/eslint-plugin-next": "13.4.12",
|
||||
"@rushstack/eslint-patch": "^1.1.3",
|
||||
"@typescript-eslint/parser": "^5.42.0",
|
||||
"eslint-import-resolver-node": "^0.3.6",
|
||||
@@ -1062,7 +1092,7 @@
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.5.1",
|
||||
"eslint-plugin-react": "^7.31.7",
|
||||
"eslint-plugin-react-hooks": "^4.5.0"
|
||||
"eslint-plugin-react-hooks": "5.0.0-canary-7118f5dd7-20230705"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^7.23.0 || ^8.0.0",
|
||||
@@ -1118,13 +1148,13 @@
|
||||
}
|
||||
},
|
||||
"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.2.2",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz",
|
||||
"integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==",
|
||||
"dependencies": {
|
||||
"dir-glob": "^3.0.1",
|
||||
"fast-glob": "^3.2.11",
|
||||
"ignore": "^5.2.0",
|
||||
"fast-glob": "^3.3.0",
|
||||
"ignore": "^5.2.4",
|
||||
"merge2": "^1.4.1",
|
||||
"slash": "^4.0.0"
|
||||
},
|
||||
@@ -1218,9 +1248,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-import/node_modules/semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
}
|
||||
@@ -1255,17 +1285,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jsx-a11y/node_modules/semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-react": {
|
||||
"version": "7.32.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.32.2.tgz",
|
||||
"integrity": "sha512-t2fBMa+XzonrrNkyVirzKlvn5RXzzPwRHtMvLAtVZrt8oxgnTQaYbU6SXTOO1mwQgp1y5+toMSKInnzGr0Knqg==",
|
||||
"version": "7.33.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.0.tgz",
|
||||
"integrity": "sha512-qewL/8P34WkY8jAqdQxsiL82pDUeT7nhs8IsuXgfgnsEloKCT4miAV9N9kGtx7/KM9NH/NCGUE7Edt9iGxLXFw==",
|
||||
"dependencies": {
|
||||
"array-includes": "^3.1.6",
|
||||
"array.prototype.flatmap": "^1.3.1",
|
||||
@@ -1280,7 +1310,7 @@
|
||||
"object.values": "^1.1.6",
|
||||
"prop-types": "^15.8.1",
|
||||
"resolve": "^2.0.0-next.4",
|
||||
"semver": "^6.3.0",
|
||||
"semver": "^6.3.1",
|
||||
"string.prototype.matchall": "^4.0.8"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1291,9 +1321,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-react-hooks": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz",
|
||||
"integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==",
|
||||
"version": "5.0.0-canary-7118f5dd7-20230705",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.0.0-canary-7118f5dd7-20230705.tgz",
|
||||
"integrity": "sha512-AZYbMo/NW9chdL7vk6HQzQhT+PvTAEVqWk9ziruUoW2kAOcN5qNyelv70e0F1VNQAbvutOC9oc+xfWycI9FxDw==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
@@ -1329,17 +1359,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-react/node_modules/semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-scope": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz",
|
||||
"integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==",
|
||||
"version": "7.2.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.1.tgz",
|
||||
"integrity": "sha512-CvefSOsDdaYYvxChovdrPo/ZGt8d5lrJWleAc1diXRKhHGiTYEI26cvo8Kle/wGnsizoCJjK73FMg1/IkIwiNA==",
|
||||
"dependencies": {
|
||||
"esrecurse": "^4.3.0",
|
||||
"estraverse": "^5.2.0"
|
||||
@@ -1363,11 +1393,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/espree": {
|
||||
"version": "9.5.2",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz",
|
||||
"integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==",
|
||||
"version": "9.6.1",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
|
||||
"integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
|
||||
"dependencies": {
|
||||
"acorn": "^8.8.0",
|
||||
"acorn": "^8.9.0",
|
||||
"acorn-jsx": "^5.3.2",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
@@ -1444,9 +1474,9 @@
|
||||
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
|
||||
},
|
||||
"node_modules/fast-glob": {
|
||||
"version": "3.2.12",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz",
|
||||
"integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==",
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz",
|
||||
"integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==",
|
||||
"dependencies": {
|
||||
"@nodelib/fs.stat": "^2.0.2",
|
||||
"@nodelib/fs.walk": "^1.2.3",
|
||||
@@ -1625,9 +1655,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==",
|
||||
"version": "4.6.2",
|
||||
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.6.2.tgz",
|
||||
"integrity": "sha512-E5XrT4CbbXcXWy+1jChlZmrmCwd5KGx502kDCXJJ7y898TtWW9FwoG5HfOLVRKmlmDGkWN2HM9Ho+/Y8F0sJDg==",
|
||||
"dependencies": {
|
||||
"resolve-pkg-maps": "^1.0.0"
|
||||
},
|
||||
@@ -2110,15 +2140,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/is-typed-array": {
|
||||
"version": "1.1.10",
|
||||
"resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz",
|
||||
"integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==",
|
||||
"version": "1.1.12",
|
||||
"resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz",
|
||||
"integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==",
|
||||
"dependencies": {
|
||||
"available-typed-arrays": "^1.0.5",
|
||||
"call-bind": "^1.0.2",
|
||||
"for-each": "^0.3.3",
|
||||
"gopd": "^1.0.1",
|
||||
"has-tostringtag": "^1.0.0"
|
||||
"which-typed-array": "^1.1.11"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -2163,6 +2189,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",
|
||||
@@ -2206,12 +2237,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/jsx-ast-utils": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz",
|
||||
"integrity": "sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.4.tgz",
|
||||
"integrity": "sha512-fX2TVdCViod6HwKEtSWGHs57oFhVfCMwieb9PuRDgjDPh5XeqJiHFFFJCHxU5cnTc3Bu/GRL+kPiFmw8XWOfKw==",
|
||||
"dependencies": {
|
||||
"array-includes": "^3.1.5",
|
||||
"object.assign": "^4.1.3"
|
||||
"array-includes": "^3.1.6",
|
||||
"array.prototype.flat": "^1.3.1",
|
||||
"object.assign": "^4.1.4",
|
||||
"object.values": "^1.1.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
@@ -2366,11 +2399,11 @@
|
||||
"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.12",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.4.12.tgz",
|
||||
"integrity": "sha512-eHfnru9x6NRmTMcjQp6Nz0J4XH9OubmzOa7CkWL+AUrUxpibub3vWwttjduu9No16dug1kq04hiUUpo7J3m3Xw==",
|
||||
"dependencies": {
|
||||
"@next/env": "13.4.7",
|
||||
"@next/env": "13.4.12",
|
||||
"@swc/helpers": "0.5.1",
|
||||
"busboy": "1.6.0",
|
||||
"caniuse-lite": "^1.0.30001406",
|
||||
@@ -2386,15 +2419,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.12",
|
||||
"@next/swc-darwin-x64": "13.4.12",
|
||||
"@next/swc-linux-arm64-gnu": "13.4.12",
|
||||
"@next/swc-linux-arm64-musl": "13.4.12",
|
||||
"@next/swc-linux-x64-gnu": "13.4.12",
|
||||
"@next/swc-linux-x64-musl": "13.4.12",
|
||||
"@next/swc-win32-arm64-msvc": "13.4.12",
|
||||
"@next/swc-win32-ia32-msvc": "13.4.12",
|
||||
"@next/swc-win32-x64-msvc": "13.4.12"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@opentelemetry/api": "^1.1.0",
|
||||
@@ -2578,16 +2611,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/optionator": {
|
||||
"version": "0.9.1",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
|
||||
"integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
|
||||
"version": "0.9.3",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz",
|
||||
"integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==",
|
||||
"dependencies": {
|
||||
"@aashutoshrathi/word-wrap": "^1.2.3",
|
||||
"deep-is": "^0.1.3",
|
||||
"fast-levenshtein": "^2.0.6",
|
||||
"levn": "^0.4.1",
|
||||
"prelude-ls": "^1.2.1",
|
||||
"type-check": "^0.4.0",
|
||||
"word-wrap": "^1.2.3"
|
||||
"type-check": "^0.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
@@ -2975,6 +3008,23 @@
|
||||
"queue-microtask": "^1.2.2"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-array-concat": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz",
|
||||
"integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"get-intrinsic": "^1.2.0",
|
||||
"has-symbols": "^1.0.3",
|
||||
"isarray": "^2.0.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-regex-test": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz",
|
||||
@@ -2997,9 +3047,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.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
@@ -3278,9 +3328,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.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz",
|
||||
"integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA=="
|
||||
},
|
||||
"node_modules/tsutils": {
|
||||
"version": "3.21.0",
|
||||
@@ -3323,6 +3373,54 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/typed-array-buffer": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz",
|
||||
"integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"get-intrinsic": "^1.2.1",
|
||||
"is-typed-array": "^1.1.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/typed-array-byte-length": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz",
|
||||
"integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"for-each": "^0.3.3",
|
||||
"has-proto": "^1.0.1",
|
||||
"is-typed-array": "^1.1.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/typed-array-byte-offset": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz",
|
||||
"integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==",
|
||||
"dependencies": {
|
||||
"available-typed-arrays": "^1.0.5",
|
||||
"call-bind": "^1.0.2",
|
||||
"for-each": "^0.3.3",
|
||||
"has-proto": "^1.0.1",
|
||||
"is-typed-array": "^1.1.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/typed-array-length": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz",
|
||||
@@ -3337,9 +3435,9 @@
|
||||
}
|
||||
},
|
||||
"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.1.6",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz",
|
||||
"integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
@@ -3421,16 +3519,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/which-typed-array": {
|
||||
"version": "1.1.9",
|
||||
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz",
|
||||
"integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==",
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz",
|
||||
"integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==",
|
||||
"dependencies": {
|
||||
"available-typed-arrays": "^1.0.5",
|
||||
"call-bind": "^1.0.2",
|
||||
"for-each": "^0.3.3",
|
||||
"gopd": "^1.0.1",
|
||||
"has-tostringtag": "^1.0.0",
|
||||
"is-typed-array": "^1.1.10"
|
||||
"has-tostringtag": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -3439,14 +3536,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/word-wrap": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
||||
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint": "8.43.0",
|
||||
"eslint-config-next": "13.4.7",
|
||||
"next": "13.4.7",
|
||||
"eslint": "8.45.0",
|
||||
"eslint-config-next": "13.4.12",
|
||||
"next": "13.4.12",
|
||||
"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.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @vercel-internals/constants
|
||||
|
||||
## 1.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Create new help output and arg parsing for deploy command ([#10090](https://github.com/vercel/vercel/pull/10090))
|
||||
|
||||
## 1.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/constants",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.8.0",
|
||||
"@vercel/routing-utils": "2.2.1"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@vercel-internals/tsconfig": "1.0.0",
|
||||
"@vercel/style-guide": "4.0.2",
|
||||
|
||||
@@ -3,3 +3,7 @@ export const PROJECT_ENV_TARGET = [
|
||||
'preview',
|
||||
'development',
|
||||
] as const;
|
||||
|
||||
export const LOGO = '▲' as const;
|
||||
export const NAME = 'vercel' as const;
|
||||
export const TITLE = 'Vercel' as const;
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
# @vercel-internals/types
|
||||
|
||||
## 1.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`0750517af`](https://github.com/vercel/vercel/commit/0750517af99aea41410d4f1f772ce427699554e7)]:
|
||||
- @vercel/build-utils@6.8.2
|
||||
|
||||
## 1.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`7021279b2`](https://github.com/vercel/vercel/commit/7021279b284f314a4d1bdbb4306b4c22291efa08), [`718bbd365`](https://github.com/vercel/vercel/commit/718bbd365a50271a980bdca231ca801a0eead32b)]:
|
||||
- @vercel/build-utils@6.8.1
|
||||
- @vercel-internals/constants@1.0.4
|
||||
|
||||
## 1.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
5
internals/types/index.d.ts
vendored
5
internals/types/index.d.ts
vendored
@@ -1,5 +1,6 @@
|
||||
import type { BuilderFunctions } from '@vercel/build-utils';
|
||||
import type { Readable, Writable } from 'stream';
|
||||
import type * as tty from 'tty';
|
||||
import type { Route } from '@vercel/routing-utils';
|
||||
import { PROJECT_ENV_TARGET } from '@vercel-internals/constants';
|
||||
|
||||
@@ -631,6 +632,6 @@ export interface WritableTTY extends Writable {
|
||||
|
||||
export interface Stdio {
|
||||
stdin: ReadableTTY;
|
||||
stdout: WritableTTY;
|
||||
stderr: WritableTTY;
|
||||
stdout: tty.WriteStream;
|
||||
stderr: tty.WriteStream;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/types",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.5",
|
||||
"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.4",
|
||||
"@vercel/build-utils": "6.8.2",
|
||||
"@vercel/routing-utils": "2.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -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.9",
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# @vercel/build-utils
|
||||
|
||||
## 6.8.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Push back `nodejs16.x` discontinue date to `2024-02-06` ([#10209](https://github.com/vercel/vercel/pull/10209))
|
||||
|
||||
## 6.8.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Revert "[build-utils] Allow file-ref sema to be controlled through env flag" ([#10167](https://github.com/vercel/vercel/pull/10167))
|
||||
|
||||
## 6.8.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "6.8.0",
|
||||
"version": "6.8.2",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
|
||||
@@ -5,13 +5,7 @@ import path from 'path';
|
||||
import Sema from 'async-sema';
|
||||
import { FileBase } from './types';
|
||||
|
||||
const DEFAULT_SEMA = 20;
|
||||
const semaToPreventEMFILE = new Sema(
|
||||
parseInt(
|
||||
process.env.VERCEL_INTERNAL_FILE_FS_REF_SEMA || String(DEFAULT_SEMA),
|
||||
10
|
||||
) || DEFAULT_SEMA
|
||||
);
|
||||
const semaToPreventEMFILE = new Sema(20);
|
||||
|
||||
interface FileFsRefOptions {
|
||||
mode?: number;
|
||||
|
||||
@@ -12,13 +12,7 @@ interface FileRefOptions {
|
||||
mutable?: boolean;
|
||||
}
|
||||
|
||||
const DEFAULT_SEMA = 5;
|
||||
const semaToDownloadFromS3 = new Sema(
|
||||
parseInt(
|
||||
process.env.VERCEL_INTERNAL_FILE_REF_SEMA || String(DEFAULT_SEMA),
|
||||
10
|
||||
) || DEFAULT_SEMA
|
||||
);
|
||||
const semaToDownloadFromS3 = new Sema(5);
|
||||
|
||||
class BailableError extends Error {
|
||||
public bail: boolean;
|
||||
|
||||
@@ -10,7 +10,7 @@ function getOptions() {
|
||||
major: 16,
|
||||
range: '16.x',
|
||||
runtime: 'nodejs16.x',
|
||||
discontinueDate: new Date('2023-08-15'),
|
||||
discontinueDate: new Date('2024-02-06'),
|
||||
},
|
||||
{
|
||||
major: 14,
|
||||
|
||||
6
packages/build-utils/test/unit.test.ts
vendored
6
packages/build-utils/test/unit.test.ts
vendored
@@ -238,7 +238,7 @@ it('should get latest node version', async () => {
|
||||
it('should throw for discontinued versions', async () => {
|
||||
// Mock a future date so that Node 8 and 10 become discontinued
|
||||
const realDateNow = Date.now.bind(global.Date);
|
||||
global.Date.now = () => new Date('2023-10-01').getTime();
|
||||
global.Date.now = () => new Date('2024-02-13').getTime();
|
||||
|
||||
expect(getSupportedNodeVersion('8.10.x', false)).rejects.toThrow();
|
||||
expect(getSupportedNodeVersion('8.10.x', true)).rejects.toThrow();
|
||||
@@ -306,8 +306,8 @@ it('should warn for deprecated versions, soon to be discontinued', async () => {
|
||||
'Error: Node.js version 12.x has reached End-of-Life. Deployments created on or after 2022-10-03 will fail to build. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.',
|
||||
'Error: Node.js version 14.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.',
|
||||
'Error: Node.js version 14.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.',
|
||||
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.',
|
||||
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.',
|
||||
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2024-02-06 will fail to build. Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.',
|
||||
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2024-02-06 will fail to build. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.',
|
||||
]);
|
||||
|
||||
global.Date.now = realDateNow;
|
||||
|
||||
@@ -1,5 +1,79 @@
|
||||
# vercel
|
||||
|
||||
## 31.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Add 'Environment' column to 'vc list' with new '--environment' filter and pipe URLs to stdout ([#10239](https://github.com/vercel/vercel/pull/10239))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Update `proxy-agent` to v6.3.0 ([#10226](https://github.com/vercel/vercel/pull/10226))
|
||||
|
||||
- Use `getNodeBinPaths()` in `vc dev` ([#10225](https://github.com/vercel/vercel/pull/10225))
|
||||
|
||||
- Updated dependencies [[`b1c14cde0`](https://github.com/vercel/vercel/commit/b1c14cde03f94b2c15ba12c9be9d19c72df2fdbb), [`ce4633fe4`](https://github.com/vercel/vercel/commit/ce4633fe4d00cb5c251cdabbfab08f39ec3f3b5f)]:
|
||||
- @vercel/next@3.9.1
|
||||
- @vercel/static-build@1.3.42
|
||||
|
||||
## 31.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Detect multiple frameworks within the same root directory during `vc link --repo` ([#10203](https://github.com/vercel/vercel/pull/10203))
|
||||
|
||||
- Updated dependencies [[`b56639b62`](https://github.com/vercel/vercel/commit/b56639b624e9ad1df048a4c85083e26888696060), [`cae60155f`](https://github.com/vercel/vercel/commit/cae60155f34883f08a5e4f51b547e2a1a5fee694), [`c670e5171`](https://github.com/vercel/vercel/commit/c670e51712022193e078bd68b055f7e61013015d), [`5439d7c0c`](https://github.com/vercel/vercel/commit/5439d7c0c9b79e7161bf4fa84ffdb357365f9e7e)]:
|
||||
- @vercel/node@2.15.6
|
||||
- @vercel/next@3.9.0
|
||||
- @vercel/remix-builder@1.8.18
|
||||
- @vercel/static-build@1.3.41
|
||||
|
||||
## 31.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix redeploy target to be undefined when null ([#10201](https://github.com/vercel/vercel/pull/10201))
|
||||
|
||||
- Respect forbidden API responses ([#10178](https://github.com/vercel/vercel/pull/10178))
|
||||
|
||||
- Update `supports-hyperlinks` to v3 ([#10208](https://github.com/vercel/vercel/pull/10208))
|
||||
|
||||
- Updated dependencies [[`0750517af`](https://github.com/vercel/vercel/commit/0750517af99aea41410d4f1f772ce427699554e7)]:
|
||||
- @vercel/build-utils@6.8.2
|
||||
- @vercel/static-build@1.3.40
|
||||
- @vercel/node@2.15.5
|
||||
- @vercel/remix-builder@1.8.17
|
||||
|
||||
## 31.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Allow additional project settings in `createProject()` ([#10172](https://github.com/vercel/vercel/pull/10172))
|
||||
|
||||
- Run local Project detection during `vc link --repo`. ([#10094](https://github.com/vercel/vercel/pull/10094))
|
||||
This allows for creation of new Projects that do not yet exist under the selected scope.
|
||||
|
||||
- Redeploy command no longer redeploys preview deployments to production ([#10186](https://github.com/vercel/vercel/pull/10186))
|
||||
|
||||
- Added trailing new line at end of help output ([#10170](https://github.com/vercel/vercel/pull/10170))
|
||||
|
||||
- Create new help output and arg parsing for deploy command ([#10090](https://github.com/vercel/vercel/pull/10090))
|
||||
|
||||
- [cli] Remove `preinstall` script ([#10157](https://github.com/vercel/vercel/pull/10157))
|
||||
|
||||
- Updated dependencies [[`7021279b2`](https://github.com/vercel/vercel/commit/7021279b284f314a4d1bdbb4306b4c22291efa08), [`5e5332fbc`](https://github.com/vercel/vercel/commit/5e5332fbc9317a8f3cc4ed0b72ec1a2c76020891), [`027bce00b`](https://github.com/vercel/vercel/commit/027bce00b3821d9b4a8f7ec320cd1c43ab9f4215)]:
|
||||
- @vercel/build-utils@6.8.1
|
||||
- @vercel/node@2.15.4
|
||||
- @vercel/remix-builder@1.8.16
|
||||
- @vercel/static-build@1.3.39
|
||||
|
||||
## 31.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`aa734efc6`](https://github.com/vercel/vercel/commit/aa734efc6c42badd4aa9bf64487904aa64e9bd49)]:
|
||||
- @vercel/next@3.8.8
|
||||
|
||||
## 31.0.0
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "31.0.0",
|
||||
"version": "31.1.0",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -11,7 +11,6 @@
|
||||
"directory": "packages/cli"
|
||||
},
|
||||
"scripts": {
|
||||
"preinstall": "node ./scripts/preinstall.js",
|
||||
"test": "jest --env node --verbose --bail",
|
||||
"test-unit": "pnpm test test/unit/",
|
||||
"test-e2e": "rimraf test/fixtures/integration && pnpm test test/integration-1.test.ts test/integration-2.test.ts test/integration-3.test.ts",
|
||||
@@ -32,16 +31,16 @@
|
||||
"node": ">= 14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.8.0",
|
||||
"@vercel/build-utils": "6.8.2",
|
||||
"@vercel/go": "2.5.1",
|
||||
"@vercel/hydrogen": "0.0.64",
|
||||
"@vercel/next": "3.8.7",
|
||||
"@vercel/node": "2.15.3",
|
||||
"@vercel/next": "3.9.1",
|
||||
"@vercel/node": "2.15.6",
|
||||
"@vercel/python": "3.1.60",
|
||||
"@vercel/redwood": "1.1.15",
|
||||
"@vercel/remix-builder": "1.8.15",
|
||||
"@vercel/remix-builder": "1.8.18",
|
||||
"@vercel/ruby": "1.3.76",
|
||||
"@vercel/static-build": "1.3.38"
|
||||
"@vercel/static-build": "1.3.42"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alex_neo/jest-expect-message": "1.0.5",
|
||||
@@ -85,13 +84,13 @@
|
||||
"@types/which": "3.0.0",
|
||||
"@types/write-json-file": "2.2.1",
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vercel-internals/constants": "1.0.3",
|
||||
"@vercel-internals/constants": "1.0.4",
|
||||
"@vercel-internals/get-package-json": "1.0.0",
|
||||
"@vercel-internals/types": "1.0.3",
|
||||
"@vercel/client": "12.6.3",
|
||||
"@vercel-internals/types": "1.0.5",
|
||||
"@vercel/client": "12.6.5",
|
||||
"@vercel/error-utils": "1.0.10",
|
||||
"@vercel/frameworks": "1.4.3",
|
||||
"@vercel/fs-detectors": "4.0.1",
|
||||
"@vercel/frameworks": "1.5.0",
|
||||
"@vercel/fs-detectors": "4.1.1",
|
||||
"@vercel/fun": "1.0.4",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"@vercel/routing-utils": "2.2.1",
|
||||
@@ -150,7 +149,7 @@
|
||||
"pluralize": "7.0.0",
|
||||
"promisepipe": "3.0.0",
|
||||
"proxy": "2.0.0",
|
||||
"proxy-agent": "6.1.1",
|
||||
"proxy-agent": "6.3.0",
|
||||
"psl": "1.1.31",
|
||||
"qr-image": "3.2.0",
|
||||
"raw-body": "2.4.1",
|
||||
@@ -159,7 +158,7 @@
|
||||
"serve-handler": "6.1.1",
|
||||
"strip-ansi": "6.0.1",
|
||||
"stripe": "5.1.0",
|
||||
"supports-hyperlinks": "2.2.0",
|
||||
"supports-hyperlinks": "3.0.0",
|
||||
"tar-fs": "1.16.3",
|
||||
"test-listen": "1.1.0",
|
||||
"text-table": "0.2.0",
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
const { join } = require('path');
|
||||
const { statSync } = require('fs');
|
||||
const pkg = require('../package');
|
||||
|
||||
function error(command) {
|
||||
console.error('> Error:', command);
|
||||
}
|
||||
|
||||
function debug(str) {
|
||||
if (
|
||||
process.argv.find(str => str === '--debug') ||
|
||||
process.env.PREINSTALL_DEBUG
|
||||
) {
|
||||
console.log(`[debug] [${new Date().toISOString()}]`, str);
|
||||
}
|
||||
}
|
||||
|
||||
function isYarn() {
|
||||
return process.env.npm_config_heading !== 'npm';
|
||||
}
|
||||
|
||||
function isGlobal() {
|
||||
const cmd = JSON.parse(process.env.npm_config_argv || '{ "original": [] }');
|
||||
|
||||
return isYarn()
|
||||
? cmd.original.includes('global')
|
||||
: Boolean(process.env.npm_config_global);
|
||||
}
|
||||
|
||||
function isVercel() {
|
||||
return pkg.name === 'vercel';
|
||||
}
|
||||
|
||||
function validateNodeVersion() {
|
||||
let semver = '>= 0';
|
||||
let major = '1';
|
||||
|
||||
try {
|
||||
major = process.versions.node.split('.')[0];
|
||||
const pkg = require('../package.json');
|
||||
semver = pkg.engines.node;
|
||||
} catch (e) {
|
||||
debug('Failed to read package.json engines');
|
||||
}
|
||||
|
||||
const isValid = eval(`${major} ${semver}`);
|
||||
return { isValid, expected: semver, actual: process.versions.node };
|
||||
}
|
||||
|
||||
function isInNodeModules(name) {
|
||||
try {
|
||||
const nodeModules = join(__dirname, '..', '..');
|
||||
const stat = statSync(join(nodeModules, name));
|
||||
return stat.isDirectory();
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
if (!isGlobal()) {
|
||||
debug('Skipping preinstall since Vercel CLI is being installed locally');
|
||||
return;
|
||||
}
|
||||
|
||||
const ver = validateNodeVersion();
|
||||
|
||||
if (!ver.isValid) {
|
||||
error(
|
||||
`Detected unsupported Node.js version.\n` +
|
||||
`Expected "${ver.expected}" but found "${ver.actual}".\n` +
|
||||
`Please update to the latest Node.js LTS version to install Vercel CLI.`
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (isVercel() && isInNodeModules('now')) {
|
||||
const uninstall = isYarn()
|
||||
? 'yarn global remove now'
|
||||
: 'npm uninstall -g now';
|
||||
console.error(`NOTE: Run \`${uninstall}\` to uninstall \`now\`\n`);
|
||||
}
|
||||
}
|
||||
|
||||
process.on('unhandledRejection', err => {
|
||||
console.error('Unhandled Rejection:');
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on('uncaughtException', err => {
|
||||
console.error('Uncaught Exception:');
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
main().catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -1,50 +0,0 @@
|
||||
import chalk from 'chalk';
|
||||
import logo from '../../util/output/logo';
|
||||
import { getPkgName } from '../../util/pkg-name';
|
||||
|
||||
export const help = () => {
|
||||
return `
|
||||
${chalk.bold(`${logo} ${getPkgName()} [deploy]`)} [path-to-project] [options]
|
||||
|
||||
--prod Create a production deployment
|
||||
-p, --public Deployment is public (${chalk.dim(
|
||||
'`/_src`'
|
||||
)} is exposed)
|
||||
-e, --env Include an env var during run time (e.g.: ${chalk.dim(
|
||||
'`-e KEY=value`'
|
||||
)}). Can appear many times.
|
||||
-b, --build-env Similar to ${chalk.dim(
|
||||
'`--env`'
|
||||
)} but for build time only.
|
||||
-m, --meta Add metadata for the deployment (e.g.: ${chalk.dim(
|
||||
'`-m KEY=value`'
|
||||
)}). Can appear many times.
|
||||
--no-wait Don't wait for the deployment to finish
|
||||
-f, --force Force a new deployment even if nothing has changed
|
||||
--with-cache Retain build cache when using "--force"
|
||||
--regions Set default regions to enable the deployment on
|
||||
|
||||
${chalk.dim('Examples:')}
|
||||
|
||||
${chalk.gray('–')} Deploy the current directory
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()}`)}
|
||||
|
||||
${chalk.gray('–')} Deploy a custom path
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} /usr/src/project`)}
|
||||
|
||||
${chalk.gray('–')} Deploy with Environment Variables
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} -e NODE_ENV=production`)}
|
||||
|
||||
${chalk.gray('–')} Deploy with prebuilt outputs
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} build`)}
|
||||
${chalk.cyan(`$ ${getPkgName()} deploy --prebuilt`)}
|
||||
|
||||
${chalk.gray('–')} Write Deployment URL to a file
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} > deployment-url.txt`)}
|
||||
`;
|
||||
};
|
||||
181
packages/cli/src/commands/deploy/command.ts
Normal file
181
packages/cli/src/commands/deploy/command.ts
Normal file
@@ -0,0 +1,181 @@
|
||||
import { Command } from '../help';
|
||||
|
||||
export const deployCommand: Command = {
|
||||
name: 'deploy',
|
||||
description:
|
||||
'Deploy your project to Vercel. The `deploy` command is the default command for the Vercel CLI, and can be omitted (`vc deploy my-app` equals `vc my-app`).',
|
||||
arguments: [
|
||||
{
|
||||
name: 'project-path',
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'force',
|
||||
shorthand: 'f',
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: 'Force a new deployment even if nothing has changed',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'with-cache',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: 'Retain build cache when using "--force"',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'public',
|
||||
shorthand: 'p',
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: 'Deployment is public (`/_src`) is exposed)',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'env',
|
||||
shorthand: 'e',
|
||||
type: 'string',
|
||||
argument: 'key=value',
|
||||
deprecated: false,
|
||||
multi: true,
|
||||
description:
|
||||
'Specify environment variables during run-time (e.g. `-e KEY1=value1 -e KEY2=value2`)',
|
||||
},
|
||||
{
|
||||
name: 'build-env',
|
||||
shorthand: 'b',
|
||||
type: 'string',
|
||||
argument: 'key=value',
|
||||
deprecated: false,
|
||||
multi: true,
|
||||
description:
|
||||
'Specify environment variables during build-time (e.g. `-b KEY1=value1 -b KEY2=value2`)',
|
||||
},
|
||||
{
|
||||
name: 'meta',
|
||||
shorthand: 'm',
|
||||
type: 'string',
|
||||
argument: 'key=value',
|
||||
deprecated: false,
|
||||
multi: true,
|
||||
description:
|
||||
'Specify metadata for the deployment (e.g. `-m KEY1=value1 -m KEY2=value2`)',
|
||||
},
|
||||
{
|
||||
name: 'regions',
|
||||
shorthand: null,
|
||||
type: 'string',
|
||||
deprecated: false,
|
||||
description: 'Set default regions to enable the deployment on',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'prebuilt',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description:
|
||||
'Use in combination with `vc build`. Deploy an existing build',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'prod',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: 'Create a production deployment',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'archive',
|
||||
shorthand: null,
|
||||
type: 'string',
|
||||
deprecated: false,
|
||||
description:
|
||||
'Compress the deployment code into a file before uploading it',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'no-wait',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: "Don't wait for the deployment to finish",
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'skip-domain',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: undefined,
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'yes',
|
||||
shorthand: 'y',
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: 'Use default options to skip all prompts',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'name',
|
||||
shorthand: 'n',
|
||||
type: 'string',
|
||||
deprecated: true,
|
||||
description: 'Provide a Vercel Project name',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'no-clipboard',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: true,
|
||||
description: 'Do not copy deployment URL to clipboard',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'target',
|
||||
shorthand: null,
|
||||
type: 'string',
|
||||
deprecated: true,
|
||||
description: 'Specify the target deployment environment',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'confirm',
|
||||
shorthand: 'c',
|
||||
type: 'boolean',
|
||||
deprecated: true,
|
||||
description: 'Use default options to skip all prompts',
|
||||
multi: false,
|
||||
},
|
||||
],
|
||||
examples: [
|
||||
{
|
||||
name: 'Deploy the current directory',
|
||||
value: 'vercel',
|
||||
},
|
||||
{
|
||||
name: 'Deploy a custom path',
|
||||
value: 'vercel /usr/src/project',
|
||||
},
|
||||
{
|
||||
name: 'Deploy with run-time Environment Variables',
|
||||
value: 'vercel -e NODE_ENV=production',
|
||||
},
|
||||
{
|
||||
name: 'Deploy with prebuilt outputs',
|
||||
value: ['vercel build', 'vercel deploy --prebuilt'],
|
||||
},
|
||||
{
|
||||
name: 'Write Deployment URL to a file',
|
||||
value: 'vercel > deployment-url.txt',
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -59,7 +59,6 @@ import validatePaths, {
|
||||
} from '../../util/validate-paths';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
import { Output } from '../../util/output';
|
||||
import { help } from './args';
|
||||
import { getDeploymentChecks } from '../../util/deploy/get-deployment-checks';
|
||||
import parseTarget from '../../util/deploy/parse-target';
|
||||
import getPrebuiltJson from '../../util/deploy/get-prebuilt-json';
|
||||
@@ -69,44 +68,38 @@ import { parseEnv } from '../../util/parse-env';
|
||||
import { errorToString, isErrnoException, isError } from '@vercel/error-utils';
|
||||
import { pickOverrides } from '../../util/projects/project-settings';
|
||||
import { printDeploymentStatus } from '../../util/deploy/print-deployment-status';
|
||||
import { help } from '../help';
|
||||
import { deployCommand } from './command';
|
||||
|
||||
export default async (client: Client): Promise<number> => {
|
||||
const { output } = client;
|
||||
|
||||
let argv = null;
|
||||
|
||||
try {
|
||||
argv = getArgs(client.argv.slice(2), {
|
||||
'--force': Boolean,
|
||||
'--with-cache': Boolean,
|
||||
'--public': Boolean,
|
||||
'--env': [String],
|
||||
'--build-env': [String],
|
||||
'--meta': [String],
|
||||
// This is not an array in favor of matching
|
||||
// the config property name.
|
||||
'--regions': String,
|
||||
'--prebuilt': Boolean,
|
||||
'--prod': Boolean,
|
||||
'--archive': String,
|
||||
'--no-wait': Boolean,
|
||||
'--skip-domain': Boolean,
|
||||
'--yes': Boolean,
|
||||
'-f': '--force',
|
||||
'-p': '--public',
|
||||
'-e': '--env',
|
||||
'-b': '--build-env',
|
||||
'-m': '--meta',
|
||||
'-y': '--yes',
|
||||
const argOptions: {
|
||||
[k: string]:
|
||||
| BooleanConstructor
|
||||
| StringConstructor
|
||||
| string
|
||||
| [StringConstructor];
|
||||
} = {};
|
||||
for (const option of deployCommand.options) {
|
||||
argOptions[`--${option.name}`] =
|
||||
option.type === 'boolean' ? Boolean : String;
|
||||
if (option.shorthand) {
|
||||
argOptions[`-${option.shorthand}`] = `--${option.name}`;
|
||||
}
|
||||
if (
|
||||
option.name === 'env' ||
|
||||
option.name === 'build-env' ||
|
||||
option.name === 'meta'
|
||||
) {
|
||||
argOptions[`--${option.name}`] = [String];
|
||||
}
|
||||
}
|
||||
|
||||
// deprecated
|
||||
'--name': String,
|
||||
'-n': '--name',
|
||||
'--no-clipboard': Boolean,
|
||||
'--target': String,
|
||||
'--confirm': Boolean,
|
||||
'-c': '--confirm',
|
||||
});
|
||||
try {
|
||||
argv = getArgs(client.argv.slice(2), argOptions);
|
||||
|
||||
if ('--confirm' in argv) {
|
||||
output.warn('`--confirm` is deprecated, please use `--yes` instead');
|
||||
@@ -118,7 +111,7 @@ export default async (client: Client): Promise<number> => {
|
||||
}
|
||||
|
||||
if (argv['--help']) {
|
||||
output.print(help());
|
||||
output.print(help(deployCommand, { columns: client.stderr.columns }));
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,12 +57,13 @@ export default async function dev(
|
||||
|
||||
let projectSettings: ProjectSettings | undefined;
|
||||
let envValues: Record<string, string> = {};
|
||||
let repoRoot: string | undefined;
|
||||
if (link.status === 'linked') {
|
||||
const { project, org, repoRoot } = link;
|
||||
const { project, org } = link;
|
||||
|
||||
// If repo linked, update `cwd` to the repo root
|
||||
if (repoRoot) {
|
||||
cwd = repoRoot;
|
||||
if (link.repoRoot) {
|
||||
repoRoot = cwd = link.repoRoot;
|
||||
}
|
||||
|
||||
client.config.currentTeam = org.type === 'team' ? org.id : undefined;
|
||||
@@ -82,6 +83,7 @@ export default async function dev(
|
||||
output,
|
||||
projectSettings,
|
||||
envValues,
|
||||
repoRoot,
|
||||
});
|
||||
|
||||
// listen to SIGTERM for graceful shutdown
|
||||
|
||||
229
packages/cli/src/commands/help.ts
Normal file
229
packages/cli/src/commands/help.ts
Normal file
@@ -0,0 +1,229 @@
|
||||
import chalk from 'chalk';
|
||||
import stripAnsi from 'strip-ansi';
|
||||
import { LOGO, NAME } from '@vercel-internals/constants';
|
||||
|
||||
const INDENT = ' '.repeat(2);
|
||||
const NEWLINE = '\n';
|
||||
|
||||
export interface CommandOption {
|
||||
name: string;
|
||||
shorthand: string | null;
|
||||
type: 'boolean' | 'string';
|
||||
argument?: string;
|
||||
deprecated: boolean;
|
||||
description?: string;
|
||||
multi: boolean;
|
||||
}
|
||||
export interface CommandArgument {
|
||||
name: string;
|
||||
required: boolean;
|
||||
}
|
||||
export interface CommandExample {
|
||||
name: string;
|
||||
value: string | string[];
|
||||
}
|
||||
export interface Command {
|
||||
name: string;
|
||||
description: string;
|
||||
arguments: CommandArgument[];
|
||||
options: CommandOption[];
|
||||
examples: CommandExample[];
|
||||
}
|
||||
|
||||
export function calcLineLength(line: string[]) {
|
||||
return stripAnsi(lineToString(line)).length;
|
||||
}
|
||||
|
||||
// Insert spaces in between non-whitespace items only
|
||||
export function lineToString(line: string[]) {
|
||||
let string = '';
|
||||
for (let i = 0; i < line.length; i++) {
|
||||
if (i === line.length - 1) {
|
||||
string += line[i];
|
||||
} else {
|
||||
const curr = line[i];
|
||||
const next = line[i + 1];
|
||||
string += curr;
|
||||
if (curr.trim() !== '' && next.trim() !== '') {
|
||||
string += ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
export function outputArrayToString(outputArray: string[]) {
|
||||
return outputArray.join(NEWLINE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Example: `▲ vercel deploy [path] [options]`
|
||||
* @param command
|
||||
* @returns
|
||||
*/
|
||||
export function buildCommandSynopsisLine(command: Command) {
|
||||
const line: string[] = [LOGO, chalk.bold(NAME), chalk.bold(command.name)];
|
||||
if (command.arguments.length > 0) {
|
||||
for (const argument of command.arguments) {
|
||||
line.push(argument.required ? argument.name : `[${argument.name}]`);
|
||||
}
|
||||
}
|
||||
if (command.options.length > 0) {
|
||||
line.push('[options]');
|
||||
}
|
||||
return lineToString(line);
|
||||
}
|
||||
|
||||
export function buildCommandOptionLines(
|
||||
command: Command,
|
||||
options: BuildHelpOutputOptions
|
||||
) {
|
||||
// Filter out deprecated and intentionally undocumented options
|
||||
command.options = command.options.filter(
|
||||
option => !option.deprecated && option.description !== undefined
|
||||
);
|
||||
|
||||
// Initialize output array with header and empty line
|
||||
const outputArray: string[] = [chalk.dim(`Options:`), ''];
|
||||
|
||||
// Start building option lines
|
||||
const optionLines: string[][] = [];
|
||||
// Sort command options alphabetically
|
||||
command.options.sort((a, b) =>
|
||||
a.name < b.name ? -1 : a.name > b.name ? 1 : 0
|
||||
);
|
||||
// Keep track of longest "start" of an option line to determine description spacing
|
||||
let maxLineStartLength = 0;
|
||||
// Iterate over options and create the "start" of each option (e.g. ` -b, --build-env <key=value>`)
|
||||
for (const option of command.options) {
|
||||
const startLine: string[] = [INDENT];
|
||||
if (option.shorthand) {
|
||||
startLine.push(`-${option.shorthand},`);
|
||||
}
|
||||
startLine.push(`--${option.name}`);
|
||||
if (option.argument) {
|
||||
startLine.push(`<${option.argument}>`);
|
||||
}
|
||||
// the length includes the INDENT
|
||||
const lineLength = calcLineLength(startLine);
|
||||
maxLineStartLength = Math.max(lineLength, maxLineStartLength);
|
||||
optionLines.push(startLine);
|
||||
}
|
||||
/*
|
||||
* Iterate over in-progress option lines to add space-filler and description
|
||||
* For Example:
|
||||
* | --archive My description starts here.
|
||||
* |
|
||||
* | -b, --build-env <key=value> Start of description here then
|
||||
* | it wraps here.
|
||||
* |
|
||||
* | -e, --env <key=value> My description is short.
|
||||
*
|
||||
* Breaking down option lines:
|
||||
* | -b, --build-env <key=value> Start of description here then
|
||||
* |[][ ][][ ]
|
||||
* |↑ ↑ ↑ ↑
|
||||
* |1 2 3 4
|
||||
* | it wraps here.
|
||||
* |[][ ][ ]
|
||||
* |↑ ↑ ↑
|
||||
* |5 6 7
|
||||
* | 1, 5 = indent
|
||||
* | 2 = start
|
||||
* | 3, 6 = space-filler
|
||||
* | 4, 7 = description
|
||||
*/
|
||||
for (let i = 0; i < optionLines.length; i++) {
|
||||
const optionLine = optionLines[i];
|
||||
const option = command.options[i];
|
||||
// Add only 2 spaces to the longest line, and then make all shorter lines the same length.
|
||||
optionLine.push(
|
||||
' '.repeat(2 + (maxLineStartLength - calcLineLength(optionLine)))
|
||||
);
|
||||
|
||||
// Descriptions may be longer than max line length. Wrap them to the same column as the first description line
|
||||
const lines: string[][] = [optionLine];
|
||||
if (option.description) {
|
||||
for (const descriptionWord of option.description.split(' ')) {
|
||||
// insert a new line when the next word would match or exceed the maximum line length
|
||||
if (
|
||||
calcLineLength(lines[lines.length - 1]) +
|
||||
stripAnsi(descriptionWord).length >=
|
||||
options.columns
|
||||
) {
|
||||
// initialize the new line with the necessary whitespace. The INDENT is apart of `maxLineStartLength`
|
||||
lines.push([' '.repeat(maxLineStartLength + 2)]);
|
||||
}
|
||||
// insert the word to the current last line
|
||||
lines[lines.length - 1].push(descriptionWord);
|
||||
}
|
||||
}
|
||||
// for every line, transform into a string and push it to the output
|
||||
for (const line of lines) {
|
||||
outputArray.push(lineToString(line));
|
||||
}
|
||||
// add an empty line in between in each option block for readability (skip the last block)
|
||||
if (i !== optionLines.length - 1) outputArray.push('');
|
||||
}
|
||||
|
||||
// return the entire list of options as a single string after delete the last '\n' added to the option list
|
||||
return outputArrayToString(outputArray);
|
||||
}
|
||||
|
||||
export function buildCommandExampleLines(command: Command) {
|
||||
const outputArray: string[] = [chalk.dim(`Examples:`), ''];
|
||||
for (const example of command.examples) {
|
||||
const nameLine: string[] = [INDENT];
|
||||
nameLine.push(chalk.gray('-'));
|
||||
nameLine.push(example.name);
|
||||
outputArray.push(lineToString(nameLine));
|
||||
outputArray.push('');
|
||||
const buildValueLine = (value: string) => {
|
||||
return lineToString([INDENT, INDENT, chalk.cyan(`$ ${value}`)]);
|
||||
};
|
||||
if (Array.isArray(example.value)) {
|
||||
for (const line of example.value) {
|
||||
outputArray.push(buildValueLine(line));
|
||||
}
|
||||
} else {
|
||||
outputArray.push(buildValueLine(example.value));
|
||||
}
|
||||
outputArray.push('');
|
||||
}
|
||||
// delete the last newline added after examples iteration
|
||||
outputArray.splice(-1);
|
||||
|
||||
return outputArrayToString(outputArray);
|
||||
}
|
||||
|
||||
interface BuildHelpOutputOptions {
|
||||
columns: number;
|
||||
}
|
||||
|
||||
export function buildHelpOutput(
|
||||
command: Command,
|
||||
options: BuildHelpOutputOptions
|
||||
) {
|
||||
const outputArray: string[] = [
|
||||
buildCommandSynopsisLine(command),
|
||||
'',
|
||||
command.description,
|
||||
'',
|
||||
buildCommandOptionLines(command, options),
|
||||
'',
|
||||
buildCommandExampleLines(command),
|
||||
'',
|
||||
];
|
||||
|
||||
return outputArrayToString(outputArray);
|
||||
}
|
||||
|
||||
export interface HelpOptions {
|
||||
columns?: number;
|
||||
}
|
||||
|
||||
export function help(command: Command, options: HelpOptions) {
|
||||
return buildHelpOutput(command, {
|
||||
columns: options.columns ?? 80,
|
||||
});
|
||||
}
|
||||
@@ -97,7 +97,7 @@ export default async function main(client: Client) {
|
||||
client.output.warn(
|
||||
`The ${cmd('--repo')} flag is in alpha, please report issues`
|
||||
);
|
||||
await ensureRepoLink(client, cwd, yes);
|
||||
await ensureRepoLink(client, cwd, { yes, overwrite: true });
|
||||
} else {
|
||||
const link = await ensureLink('link', client, cwd, {
|
||||
autoConfirm: yes,
|
||||
|
||||
@@ -44,7 +44,9 @@ const help = () => {
|
||||
-m, --meta Filter deployments by metadata (e.g.: ${chalk.dim(
|
||||
'`-m KEY=value`'
|
||||
)}). Can appear many times.
|
||||
--prod Filter for production URLs
|
||||
--environment=${chalk.bold.underline(
|
||||
'ENVIRONMENT'
|
||||
)} Filter by environment (production|preview)
|
||||
-N, --next Show next page of results
|
||||
|
||||
${chalk.dim('Examples:')}
|
||||
@@ -76,11 +78,12 @@ export default async function main(client: Client) {
|
||||
|
||||
try {
|
||||
argv = getArgs(client.argv.slice(2), {
|
||||
'--environment': String,
|
||||
'--meta': [String],
|
||||
'-m': '--meta',
|
||||
'--next': Number,
|
||||
'-N': '--next',
|
||||
'--prod': Boolean,
|
||||
'--prod': Boolean, // this can be deprecated someday
|
||||
'--yes': Boolean,
|
||||
'-y': '--yes',
|
||||
|
||||
@@ -113,9 +116,14 @@ export default async function main(client: Client) {
|
||||
}
|
||||
|
||||
const autoConfirm = !!argv['--yes'];
|
||||
const prod = argv['--prod'] || false;
|
||||
const meta = parseMeta(argv['--meta']);
|
||||
|
||||
const target = argv['--prod']
|
||||
? 'production'
|
||||
: typeof argv['--environment'] === 'string'
|
||||
? argv['--environment'].toLowerCase()
|
||||
: undefined;
|
||||
|
||||
// retrieve `project` and `org` from .vercel
|
||||
let link = await getLinkedProject(client, cwd);
|
||||
|
||||
@@ -219,15 +227,12 @@ export default async function main(client: Client) {
|
||||
|
||||
debug('Fetching deployments');
|
||||
|
||||
const response = await now.list(
|
||||
app,
|
||||
{
|
||||
version: 6,
|
||||
meta,
|
||||
nextTimestamp,
|
||||
},
|
||||
prod
|
||||
);
|
||||
const response = await now.list(app, {
|
||||
version: 6,
|
||||
meta,
|
||||
nextTimestamp,
|
||||
target,
|
||||
});
|
||||
|
||||
let {
|
||||
deployments,
|
||||
@@ -280,9 +285,11 @@ export default async function main(client: Client) {
|
||||
}
|
||||
|
||||
log(
|
||||
`${prod ? `Production deployments` : `Deployments`} for ${chalk.bold(
|
||||
app
|
||||
)} under ${chalk.bold(contextName)} ${elapsed(Date.now() - start)}`
|
||||
`${
|
||||
target === 'production' ? `Production deployments` : `Deployments`
|
||||
} for ${chalk.bold(app)} under ${chalk.bold(contextName)} ${elapsed(
|
||||
Date.now() - start
|
||||
)}`
|
||||
);
|
||||
|
||||
// information to help the user find other deployments or instances
|
||||
@@ -292,8 +299,9 @@ export default async function main(client: Client) {
|
||||
|
||||
print('\n');
|
||||
|
||||
const headers = ['Age', 'Deployment', 'Status', 'Duration'];
|
||||
const headers = ['Age', 'Deployment', 'Status', 'Environment', 'Duration'];
|
||||
if (showUsername) headers.push('Username');
|
||||
const urls: string[] = [];
|
||||
|
||||
client.output.print(
|
||||
`${table(
|
||||
@@ -301,18 +309,17 @@ export default async function main(client: Client) {
|
||||
headers.map(header => chalk.bold(chalk.cyan(header))),
|
||||
...deployments
|
||||
.sort(sortRecent())
|
||||
.map(dep => [
|
||||
[
|
||||
.map(dep => {
|
||||
urls.push(`https://${dep.url}`);
|
||||
return [
|
||||
chalk.gray(ms(Date.now() - dep.createdAt)),
|
||||
`https://${dep.url}`,
|
||||
stateString(dep.state || ''),
|
||||
dep.target === 'production' ? 'Production' : 'Preview',
|
||||
chalk.gray(getDeploymentDuration(dep)),
|
||||
showUsername ? chalk.gray(dep.creator?.username) : '',
|
||||
],
|
||||
])
|
||||
// flatten since the previous step returns a nested
|
||||
// array of the deployment and (optionally) its instances
|
||||
.flat()
|
||||
];
|
||||
})
|
||||
.filter(app =>
|
||||
// if an app wasn't supplied to filter by,
|
||||
// we only want to render one deployment per app
|
||||
@@ -327,6 +334,11 @@ export default async function main(client: Client) {
|
||||
).replace(/^/gm, ' ')}\n\n`
|
||||
);
|
||||
|
||||
if (!client.stdout.isTTY) {
|
||||
client.stdout.write(urls.join('\n'));
|
||||
client.stdout.write('\n');
|
||||
}
|
||||
|
||||
if (pagination && pagination.count === 20) {
|
||||
const flags = getCommandFlags(argv, ['_', '--next']);
|
||||
log(
|
||||
|
||||
@@ -38,6 +38,10 @@ export default async function rm(client: Client, args: string[]) {
|
||||
client.output.error('No such project exists');
|
||||
return 1;
|
||||
}
|
||||
if (isAPIError(err) && err.status === 403) {
|
||||
client.output.error(err.message);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
const elapsed = ms(Date.now() - start);
|
||||
client.output.log(
|
||||
|
||||
@@ -35,6 +35,7 @@ const help = () => {
|
||||
'DIR'
|
||||
)} Path to the global ${'`.vercel`'} directory
|
||||
-d, --debug Debug mode [off]
|
||||
--git-branch Specify the Git branch to pull specific Environment Variables for
|
||||
--no-color No color mode [off]
|
||||
--environment [environment] Deployment environment [development]
|
||||
-y, --yes Skip questions when setting up new project using default scope and settings
|
||||
|
||||
@@ -108,7 +108,7 @@ export default async (client: Client): Promise<number> => {
|
||||
action: 'redeploy',
|
||||
},
|
||||
name: fromDeployment.name,
|
||||
target: fromDeployment.target || 'production',
|
||||
target: fromDeployment.target ?? undefined,
|
||||
},
|
||||
method: 'POST',
|
||||
});
|
||||
|
||||
@@ -18,7 +18,6 @@ import type {
|
||||
JSONObject,
|
||||
Stdio,
|
||||
ReadableTTY,
|
||||
WritableTTY,
|
||||
PaginationOptions,
|
||||
} from '@vercel-internals/types';
|
||||
import { sharedPromise } from './promise';
|
||||
@@ -26,6 +25,7 @@ import { APIError } from './errors-ts';
|
||||
import { normalizeError } from '@vercel/error-utils';
|
||||
import type { Agent } from 'http';
|
||||
import sleep from './sleep';
|
||||
import type * as tty from 'tty';
|
||||
|
||||
const isSAMLError = (v: any): v is SAMLError => {
|
||||
return v && v.saml;
|
||||
@@ -59,8 +59,8 @@ export default class Client extends EventEmitter implements Stdio {
|
||||
apiUrl: string;
|
||||
authConfig: AuthConfig;
|
||||
stdin: ReadableTTY;
|
||||
stdout: WritableTTY;
|
||||
stderr: WritableTTY;
|
||||
stdout: tty.WriteStream;
|
||||
stderr: tty.WriteStream;
|
||||
output: Output;
|
||||
config: GlobalConfig;
|
||||
agent?: Agent;
|
||||
@@ -146,7 +146,8 @@ export default class Client extends EventEmitter implements Stdio {
|
||||
if (!res.ok) {
|
||||
const error = await responseError(res);
|
||||
|
||||
if (isSAMLError(error)) {
|
||||
// we should force reauth only if error has a teamId
|
||||
if (isSAMLError(error) && error.teamId) {
|
||||
try {
|
||||
// A SAML error means the token is expired, or is not
|
||||
// designated for the requested team, so the user needs
|
||||
|
||||
@@ -234,6 +234,10 @@ export default async function processDeployment({
|
||||
return error;
|
||||
}
|
||||
|
||||
if (error.code === 'forbidden') {
|
||||
return error;
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
Builder,
|
||||
cloneEnv,
|
||||
Env,
|
||||
getNodeBinPath,
|
||||
getNodeBinPaths,
|
||||
StartDevServerResult,
|
||||
FileFsRef,
|
||||
PackageJson,
|
||||
@@ -124,6 +124,7 @@ function sortBuilders(buildA: Builder, buildB: Builder) {
|
||||
|
||||
export default class DevServer {
|
||||
public cwd: string;
|
||||
public repoRoot: string;
|
||||
public output: Output;
|
||||
public proxy: httpProxy;
|
||||
public envConfigs: EnvConfigs;
|
||||
@@ -169,6 +170,7 @@ export default class DevServer {
|
||||
|
||||
constructor(cwd: string, options: DevServerOptions) {
|
||||
this.cwd = cwd;
|
||||
this.repoRoot = options.repoRoot ?? cwd;
|
||||
this.output = options.output;
|
||||
this.envConfigs = { buildEnv: {}, runEnv: {}, allEnv: {} };
|
||||
this.envValues = options.envValues || {};
|
||||
@@ -1412,7 +1414,7 @@ export default class DevServer {
|
||||
files,
|
||||
entrypoint: middleware.entrypoint,
|
||||
workPath,
|
||||
repoRootPath: this.cwd,
|
||||
repoRootPath: this.repoRoot,
|
||||
config: middleware.config || {},
|
||||
meta: {
|
||||
isDev: true,
|
||||
@@ -1849,7 +1851,7 @@ export default class DevServer {
|
||||
entrypoint: match.entrypoint,
|
||||
workPath,
|
||||
config: match.config || {},
|
||||
repoRootPath: this.cwd,
|
||||
repoRootPath: this.repoRoot,
|
||||
meta: {
|
||||
isDev: true,
|
||||
requestPath,
|
||||
@@ -2237,7 +2239,8 @@ export default class DevServer {
|
||||
);
|
||||
|
||||
// add the node_modules/.bin directory to the PATH
|
||||
const nodeBinPath = await getNodeBinPath({ cwd });
|
||||
const nodeBinPaths = getNodeBinPaths({ base: this.repoRoot, start: cwd });
|
||||
const nodeBinPath = nodeBinPaths.join(path.delimiter);
|
||||
env.PATH = `${nodeBinPath}${path.delimiter}${env.PATH}`;
|
||||
|
||||
// This is necesary so that the dev command in the Project
|
||||
|
||||
@@ -25,6 +25,7 @@ export interface DevServerOptions {
|
||||
output: Output;
|
||||
projectSettings?: ProjectSettings;
|
||||
envValues?: Record<string, string>;
|
||||
repoRoot?: string;
|
||||
}
|
||||
|
||||
export interface EnvConfigs {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { basename } from 'path';
|
||||
import { VercelConfig } from '@vercel/client';
|
||||
|
||||
export interface GetProjectNameOptions {
|
||||
argv: { '--name'?: string };
|
||||
argv: { [k: string]: string | undefined };
|
||||
nowConfig?: VercelConfig;
|
||||
paths?: string[];
|
||||
}
|
||||
|
||||
5
packages/cli/src/util/git/repo-info-to-url.ts
Normal file
5
packages/cli/src/util/git/repo-info-to-url.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { RepoInfo } from './connect-git-provider';
|
||||
|
||||
export function repoInfoToUrl(info: RepoInfo): string {
|
||||
return `https://${info.provider}.com/${info.org}/${info.repo}`;
|
||||
}
|
||||
@@ -61,6 +61,7 @@ export interface ListOptions {
|
||||
version?: number;
|
||||
meta?: Dictionary<string>;
|
||||
nextTimestamp?: number;
|
||||
target?: string;
|
||||
}
|
||||
|
||||
export default class Now extends EventEmitter {
|
||||
@@ -339,7 +340,7 @@ export default class Now extends EventEmitter {
|
||||
|
||||
async list(
|
||||
app?: string,
|
||||
{ version = 4, meta = {}, nextTimestamp }: ListOptions = {},
|
||||
{ version = 4, meta = {}, nextTimestamp, target }: ListOptions = {},
|
||||
prod?: boolean
|
||||
) {
|
||||
const fetchRetry = async (url: string, options: FetchOptions = {}) => {
|
||||
@@ -405,6 +406,8 @@ export default class Now extends EventEmitter {
|
||||
}
|
||||
if (prod) {
|
||||
query.set('target', 'production');
|
||||
} else if (target) {
|
||||
query.set('target', target);
|
||||
}
|
||||
|
||||
const response = await fetchRetry(`/v${version}/now/deployments?${query}`);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import chalk from 'chalk';
|
||||
import inquirer from 'inquirer';
|
||||
import pluralize from 'pluralize';
|
||||
import { homedir } from 'os';
|
||||
import { join, normalize } from 'path';
|
||||
import slugify from '@sindresorhus/slugify';
|
||||
import { basename, join, normalize } from 'path';
|
||||
import { normalizePath, traverseUpDirectories } from '@vercel/build-utils';
|
||||
import { lstat, readJSON, outputJSON } from 'fs-extra';
|
||||
import confirm from '../input/confirm';
|
||||
@@ -13,7 +15,12 @@ import { emoji, prependEmoji } from '../emoji';
|
||||
import selectOrg from '../input/select-org';
|
||||
import { addToGitIgnore } from './add-to-gitignore';
|
||||
import type Client from '../client';
|
||||
import type { Framework } from '@vercel/frameworks';
|
||||
import type { Project } from '@vercel-internals/types';
|
||||
import createProject from '../projects/create-project';
|
||||
import { detectProjects } from '../projects/detect-projects';
|
||||
import { repoInfoToUrl } from '../git/repo-info-to-url';
|
||||
import { connectGitProvider, parseRepoUrl } from '../git/connect-git-provider';
|
||||
|
||||
const home = homedir();
|
||||
|
||||
@@ -35,6 +42,11 @@ export interface RepoLink {
|
||||
repoConfig?: RepoProjectsConfig;
|
||||
}
|
||||
|
||||
export interface EnsureRepoLinkOptions {
|
||||
yes: boolean;
|
||||
overwrite: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a directory path `cwd`, finds the root of the Git repository
|
||||
* and returns the parsed `.vercel/repo.json` file if the repository
|
||||
@@ -62,7 +74,7 @@ export async function getRepoLink(
|
||||
export async function ensureRepoLink(
|
||||
client: Client,
|
||||
cwd: string,
|
||||
yes = false
|
||||
{ yes, overwrite }: EnsureRepoLinkOptions
|
||||
): Promise<RepoLink | undefined> {
|
||||
const { output } = client;
|
||||
|
||||
@@ -74,7 +86,14 @@ export async function ensureRepoLink(
|
||||
}
|
||||
let { rootPath, repoConfig, repoConfigPath } = repoLink;
|
||||
|
||||
if (!repoConfig) {
|
||||
if (overwrite || !repoConfig) {
|
||||
// Detect the projects on the filesystem out of band, so that
|
||||
// they will be ready by the time the projects are listed
|
||||
const detectedProjectsPromise = detectProjects(rootPath).catch(err => {
|
||||
output.debug(`Failed to detect local projects: ${err}`);
|
||||
return new Map<string, Framework[]>();
|
||||
});
|
||||
|
||||
// Not yet linked, so prompt user to begin linking
|
||||
let shouldLink =
|
||||
yes ||
|
||||
@@ -111,41 +130,36 @@ export async function ensureRepoLink(
|
||||
remoteName = remoteNames[0];
|
||||
} else {
|
||||
// Prompt user to select which remote to use
|
||||
const originIndex = remoteNames.indexOf('origin');
|
||||
const answer = await client.prompt({
|
||||
type: 'list',
|
||||
name: 'value',
|
||||
message: 'Which Git remote should be used?',
|
||||
choices: remoteNames.map(name => {
|
||||
choices: remoteNames.sort().map(name => {
|
||||
return { name: name, value: name };
|
||||
}),
|
||||
default: originIndex === -1 ? 0 : originIndex,
|
||||
default: remoteNames.includes('origin') ? 'origin' : undefined,
|
||||
});
|
||||
remoteName = answer.value;
|
||||
}
|
||||
const repoUrl = remoteUrls[remoteName];
|
||||
const parsedRepoUrl = parseRepoUrl(repoUrl);
|
||||
if (!parsedRepoUrl) {
|
||||
throw new Error(`Failed to parse Git URL: ${repoUrl}`);
|
||||
}
|
||||
const repoUrlLink = output.link(repoUrl, repoInfoToUrl(parsedRepoUrl), {
|
||||
fallback: () => link(repoUrl),
|
||||
});
|
||||
output.spinner(
|
||||
`Fetching Projects for ${link(repoUrl)} under ${chalk.bold(org.slug)}…`
|
||||
`Fetching Projects for ${repoUrlLink} under ${chalk.bold(org.slug)}…`
|
||||
);
|
||||
let projects: Project[] = [];
|
||||
const query = new URLSearchParams({ repoUrl });
|
||||
const projectsIterator = client.fetchPaginated<{
|
||||
projects: Project[];
|
||||
}>(`/v9/projects?${query}`);
|
||||
let printedFound = false;
|
||||
const detectedProjects = await detectedProjectsPromise;
|
||||
for await (const chunk of projectsIterator) {
|
||||
projects = projects.concat(chunk.projects);
|
||||
if (!printedFound && projects.length > 0) {
|
||||
output.log(
|
||||
`${pluralize('Project', chunk.projects.length)} linked to ${link(
|
||||
repoUrl
|
||||
)} under ${chalk.bold(org.slug)}:`
|
||||
);
|
||||
printedFound = true;
|
||||
}
|
||||
for (const project of chunk.projects) {
|
||||
output.print(` * ${chalk.cyan(`${org.slug}/${project.name}\n`)}`);
|
||||
}
|
||||
if (chunk.pagination.next) {
|
||||
output.spinner(`Found ${chalk.bold(projects.length)} Projects…`, 0);
|
||||
}
|
||||
@@ -153,36 +167,126 @@ export async function ensureRepoLink(
|
||||
|
||||
if (projects.length === 0) {
|
||||
output.log(
|
||||
`No Projects are linked to ${link(repoUrl)} under ${chalk.bold(
|
||||
`No Projects are linked to ${repoUrlLink} under ${chalk.bold(
|
||||
org.slug
|
||||
)}.`
|
||||
);
|
||||
// TODO: run detection logic to find potential projects.
|
||||
// then prompt user to select valid projects.
|
||||
// then create new Projects
|
||||
} else {
|
||||
output.log(
|
||||
`Found ${pluralize(
|
||||
'Project',
|
||||
projects.length,
|
||||
true
|
||||
)} linked to ${repoUrlLink} under ${chalk.bold(org.slug)}`
|
||||
);
|
||||
}
|
||||
|
||||
shouldLink =
|
||||
yes ||
|
||||
(await confirm(
|
||||
client,
|
||||
`Link to ${
|
||||
projects.length === 1
|
||||
? 'this Project'
|
||||
: `these ${chalk.bold(projects.length)} Projects`
|
||||
}?`,
|
||||
true
|
||||
));
|
||||
// For any projects that already exists on Vercel, remove them from the
|
||||
// locally detected directories. Any remaining ones will be prompted to
|
||||
// create new Projects for.
|
||||
for (const project of projects) {
|
||||
detectedProjects.delete(project.rootDirectory ?? '');
|
||||
}
|
||||
|
||||
if (!shouldLink) {
|
||||
output.print(`Canceled. Repository not linked.\n`);
|
||||
const detectedProjectsCount = Array.from(detectedProjects.values()).reduce(
|
||||
(o, f) => o + f.length,
|
||||
0
|
||||
);
|
||||
if (detectedProjectsCount > 0) {
|
||||
output.log(
|
||||
`Detected ${pluralize(
|
||||
'new Project',
|
||||
detectedProjectsCount,
|
||||
true
|
||||
)} that may be created.`
|
||||
);
|
||||
}
|
||||
|
||||
const addSeparators = projects.length > 0 && detectedProjectsCount > 0;
|
||||
const { selected } = await client.prompt({
|
||||
type: 'checkbox',
|
||||
name: 'selected',
|
||||
message: `Which Projects should be ${
|
||||
projects.length ? 'linked to' : 'created'
|
||||
}?`,
|
||||
choices: [
|
||||
...(addSeparators
|
||||
? [new inquirer.Separator('----- Existing Projects -----')]
|
||||
: []),
|
||||
...projects.map(project => {
|
||||
return {
|
||||
name: `${org.slug}/${project.name}`,
|
||||
value: project,
|
||||
checked: true,
|
||||
};
|
||||
}),
|
||||
...(addSeparators
|
||||
? [new inquirer.Separator('----- New Projects to be created -----')]
|
||||
: []),
|
||||
...Array.from(detectedProjects.entries()).flatMap(
|
||||
([rootDirectory, frameworks]) =>
|
||||
frameworks.map((framework, i) => {
|
||||
const name = slugify(
|
||||
[
|
||||
basename(rootPath),
|
||||
basename(rootDirectory),
|
||||
i > 0 ? framework.slug : '',
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join('-')
|
||||
);
|
||||
return {
|
||||
name: `${org.slug}/${name} (${framework.name})`,
|
||||
value: {
|
||||
newProject: true,
|
||||
rootDirectory,
|
||||
name,
|
||||
framework,
|
||||
},
|
||||
// Checked by default when there are no other existing Projects
|
||||
checked: projects.length === 0,
|
||||
};
|
||||
})
|
||||
),
|
||||
],
|
||||
});
|
||||
|
||||
if (selected.length === 0) {
|
||||
output.print(`No Projects were selected. Repository not linked.\n`);
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < selected.length; i++) {
|
||||
const selection = selected[i];
|
||||
if (!selection.newProject) continue;
|
||||
const orgAndName = `${org.slug}/${selection.name}`;
|
||||
output.spinner(`Creating new Project: ${orgAndName}`);
|
||||
delete selection.newProject;
|
||||
if (!selection.rootDirectory) delete selection.rootDirectory;
|
||||
selected[i] = await createProject(client, {
|
||||
...selection,
|
||||
framework: selection.framework.slug,
|
||||
});
|
||||
await connectGitProvider(
|
||||
client,
|
||||
org,
|
||||
selected[i].id,
|
||||
parsedRepoUrl.provider,
|
||||
`${parsedRepoUrl.org}/${parsedRepoUrl.repo}`
|
||||
);
|
||||
output.log(
|
||||
`Created new Project: ${output.link(
|
||||
orgAndName,
|
||||
`https://vercel.com/${orgAndName}`,
|
||||
{ fallback: false }
|
||||
)}`
|
||||
);
|
||||
}
|
||||
|
||||
repoConfig = {
|
||||
orgId: org.id,
|
||||
remoteName,
|
||||
projects: projects.map(project => {
|
||||
projects: selected.map((project: Project) => {
|
||||
return {
|
||||
id: project.id,
|
||||
name: project.name,
|
||||
@@ -199,9 +303,11 @@ export async function ensureRepoLink(
|
||||
|
||||
output.print(
|
||||
prependEmoji(
|
||||
`Linked to ${link(repoUrl)} under ${chalk.bold(
|
||||
org.slug
|
||||
)} (created ${VERCEL_DIR}${
|
||||
`Linked to ${pluralize(
|
||||
'Project',
|
||||
selected.length,
|
||||
true
|
||||
)} under ${chalk.bold(org.slug)} (created ${VERCEL_DIR}${
|
||||
isGitIgnoreUpdated ? ' and added it to .gitignore' : ''
|
||||
})`,
|
||||
emoji('link')
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
VERCEL_DIR_PROJECT,
|
||||
} from '../projects/link';
|
||||
import createProject from '../projects/create-project';
|
||||
import updateProject from '../projects/update-project';
|
||||
import Client from '../client';
|
||||
import handleError from '../handle-error';
|
||||
import confirm from '../input/confirm';
|
||||
@@ -245,10 +244,10 @@ export default async function setupAndLink(
|
||||
settings.rootDirectory = rootDirectory;
|
||||
}
|
||||
|
||||
const project = await createProject(client, newProjectName);
|
||||
|
||||
await updateProject(client, project.id, settings);
|
||||
Object.assign(project, settings);
|
||||
const project = await createProject(client, {
|
||||
...settings,
|
||||
name: newProjectName,
|
||||
});
|
||||
|
||||
await linkFolderToProject(
|
||||
client,
|
||||
|
||||
@@ -3,9 +3,9 @@ import * as ansiEscapes from 'ansi-escapes';
|
||||
import { supportsHyperlink as detectSupportsHyperlink } from 'supports-hyperlinks';
|
||||
import renderLink from './link';
|
||||
import wait, { StopSpinner } from './wait';
|
||||
import type { WritableTTY } from '@vercel-internals/types';
|
||||
import { errorToString } from '@vercel/error-utils';
|
||||
import { removeEmoji } from '../emoji';
|
||||
import type * as tty from 'tty';
|
||||
|
||||
const IS_TEST = process.env.NODE_ENV === 'test';
|
||||
|
||||
@@ -24,7 +24,7 @@ interface LinkOptions {
|
||||
}
|
||||
|
||||
export class Output {
|
||||
stream: WritableTTY;
|
||||
stream: tty.WriteStream;
|
||||
debugEnabled: boolean;
|
||||
supportsHyperlink: boolean;
|
||||
colorDisabled: boolean;
|
||||
@@ -32,7 +32,7 @@ export class Output {
|
||||
private _spinner: StopSpinner | null;
|
||||
|
||||
constructor(
|
||||
stream: WritableTTY,
|
||||
stream: tty.WriteStream,
|
||||
{
|
||||
debug: debugEnabled = false,
|
||||
supportsHyperlink = detectSupportsHyperlink(stream),
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import Client from '../client';
|
||||
import type { Project } from '@vercel-internals/types';
|
||||
import type { Project, ProjectSettings } from '@vercel-internals/types';
|
||||
|
||||
export default async function createProject(
|
||||
client: Client,
|
||||
projectName: string
|
||||
settings: ProjectSettings & { name: string }
|
||||
) {
|
||||
const project = await client.fetch<Project>('/v1/projects', {
|
||||
method: 'POST',
|
||||
body: { name: projectName },
|
||||
body: { ...settings },
|
||||
});
|
||||
return project;
|
||||
}
|
||||
|
||||
38
packages/cli/src/util/projects/detect-projects.ts
Normal file
38
packages/cli/src/util/projects/detect-projects.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { join } from 'path';
|
||||
import frameworkList, { Framework } from '@vercel/frameworks';
|
||||
import {
|
||||
detectFrameworks,
|
||||
getWorkspacePackagePaths,
|
||||
getWorkspaces,
|
||||
LocalFileSystemDetector,
|
||||
} from '@vercel/fs-detectors';
|
||||
|
||||
export async function detectProjects(cwd: string) {
|
||||
const fs = new LocalFileSystemDetector(cwd);
|
||||
const workspaces = await getWorkspaces({ fs });
|
||||
const detectedProjects = new Map<string, Framework[]>();
|
||||
const packagePaths = (
|
||||
await Promise.all(
|
||||
workspaces.map(workspace =>
|
||||
getWorkspacePackagePaths({
|
||||
fs,
|
||||
workspace,
|
||||
})
|
||||
)
|
||||
)
|
||||
).flat();
|
||||
if (packagePaths.length === 0) {
|
||||
packagePaths.push('/');
|
||||
}
|
||||
await Promise.all(
|
||||
packagePaths.map(async p => {
|
||||
const frameworks = await detectFrameworks({
|
||||
fs: fs.chdir(join('.', p)),
|
||||
frameworkList,
|
||||
});
|
||||
if (frameworks.length === 0) return;
|
||||
detectedProjects.set(p.slice(1), frameworks);
|
||||
})
|
||||
);
|
||||
return detectedProjects;
|
||||
}
|
||||
@@ -1,26 +1,16 @@
|
||||
import Client from '../client';
|
||||
import type { JSONObject, ProjectSettings } from '@vercel-internals/types';
|
||||
|
||||
interface ProjectSettingsResponse extends ProjectSettings {
|
||||
id: string;
|
||||
name: string;
|
||||
updatedAt: number;
|
||||
createdAt: number;
|
||||
}
|
||||
import type { Project, ProjectSettings } from '@vercel-internals/types';
|
||||
|
||||
export default async function updateProject(
|
||||
client: Client,
|
||||
prjNameOrId: string,
|
||||
settings: ProjectSettings
|
||||
) {
|
||||
// `ProjectSettings` is technically compatible with JSONObject
|
||||
const body = settings as JSONObject;
|
||||
|
||||
const res = await client.fetch<ProjectSettingsResponse>(
|
||||
const res = await client.fetch<Project>(
|
||||
`/v2/projects/${encodeURIComponent(prjNameOrId)}`,
|
||||
{
|
||||
method: 'PATCH',
|
||||
body,
|
||||
body: { ...settings },
|
||||
}
|
||||
);
|
||||
return res;
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
"orgId": ".",
|
||||
"projectId": ".",
|
||||
"settings": {
|
||||
"framework": "storybook",
|
||||
"buildCommand": "npm run build-storybook",
|
||||
"outputDirectory": "storybook-static"
|
||||
"framework": "storybook"
|
||||
}
|
||||
}
|
||||
|
||||
244
packages/cli/test/unit/commands/__snapshots__/help.test.ts.snap
Normal file
244
packages/cli/test/unit/commands/__snapshots__/help.test.ts.snap
Normal file
@@ -0,0 +1,244 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`help command help output snapshots column width 40 1`] = `
|
||||
"▲ [1mvercel[22m [1mdeploy[22m [project-path] [options]
|
||||
|
||||
Deploy your project to Vercel. The \`deploy\` command is the default command for the Vercel CLI, and can be omitted (\`vc deploy my-app\` equals \`vc my-app\`).
|
||||
|
||||
[2mOptions:[22m
|
||||
|
||||
--archive Compress
|
||||
the
|
||||
deployment
|
||||
code into
|
||||
a file
|
||||
before
|
||||
uploading
|
||||
it
|
||||
|
||||
-b, --build-env <key=value> Specify
|
||||
environment
|
||||
variables
|
||||
during
|
||||
build-time
|
||||
(e.g. \`-b
|
||||
KEY1=value1
|
||||
-b
|
||||
KEY2=value2\`)
|
||||
|
||||
-e, --env <key=value> Specify
|
||||
environment
|
||||
variables
|
||||
during
|
||||
run-time
|
||||
(e.g. \`-e
|
||||
KEY1=value1
|
||||
-e
|
||||
KEY2=value2\`)
|
||||
|
||||
-f, --force Force a
|
||||
new
|
||||
deployment
|
||||
even if
|
||||
nothing
|
||||
has
|
||||
changed
|
||||
|
||||
-m, --meta <key=value> Specify
|
||||
metadata
|
||||
for the
|
||||
deployment
|
||||
(e.g. \`-m
|
||||
KEY1=value1
|
||||
-m
|
||||
KEY2=value2\`)
|
||||
|
||||
--no-wait Don't
|
||||
wait for
|
||||
the
|
||||
deployment
|
||||
to finish
|
||||
|
||||
--prebuilt Use in
|
||||
combination
|
||||
with \`vc
|
||||
build\`.
|
||||
Deploy an
|
||||
existing
|
||||
build
|
||||
|
||||
--prod Create a
|
||||
production
|
||||
deployment
|
||||
|
||||
-p, --public
|
||||
Deployment
|
||||
is public
|
||||
(\`/_src\`)
|
||||
is
|
||||
exposed)
|
||||
|
||||
--regions Set
|
||||
default
|
||||
regions
|
||||
to enable
|
||||
the
|
||||
deployment
|
||||
on
|
||||
|
||||
--with-cache Retain
|
||||
build
|
||||
cache
|
||||
when
|
||||
using
|
||||
"--force"
|
||||
|
||||
-y, --yes Use
|
||||
default
|
||||
options
|
||||
to skip
|
||||
all
|
||||
prompts
|
||||
|
||||
[2mExamples:[22m
|
||||
|
||||
[90m-[39m Deploy the current directory
|
||||
|
||||
[36m$ vercel[39m
|
||||
|
||||
[90m-[39m Deploy a custom path
|
||||
|
||||
[36m$ vercel /usr/src/project[39m
|
||||
|
||||
[90m-[39m Deploy with run-time Environment Variables
|
||||
|
||||
[36m$ vercel -e NODE_ENV=production[39m
|
||||
|
||||
[90m-[39m Deploy with prebuilt outputs
|
||||
|
||||
[36m$ vercel build[39m
|
||||
[36m$ vercel deploy --prebuilt[39m
|
||||
|
||||
[90m-[39m Write Deployment URL to a file
|
||||
|
||||
[36m$ vercel > deployment-url.txt[39m
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`help command help output snapshots column width 80 1`] = `
|
||||
"▲ [1mvercel[22m [1mdeploy[22m [project-path] [options]
|
||||
|
||||
Deploy your project to Vercel. The \`deploy\` command is the default command for the Vercel CLI, and can be omitted (\`vc deploy my-app\` equals \`vc my-app\`).
|
||||
|
||||
[2mOptions:[22m
|
||||
|
||||
--archive Compress the deployment code into a file before
|
||||
uploading it
|
||||
|
||||
-b, --build-env <key=value> Specify environment variables during build-time
|
||||
(e.g. \`-b KEY1=value1 -b KEY2=value2\`)
|
||||
|
||||
-e, --env <key=value> Specify environment variables during run-time
|
||||
(e.g. \`-e KEY1=value1 -e KEY2=value2\`)
|
||||
|
||||
-f, --force Force a new deployment even if nothing has
|
||||
changed
|
||||
|
||||
-m, --meta <key=value> Specify metadata for the deployment (e.g. \`-m
|
||||
KEY1=value1 -m KEY2=value2\`)
|
||||
|
||||
--no-wait Don't wait for the deployment to finish
|
||||
|
||||
--prebuilt Use in combination with \`vc build\`. Deploy an
|
||||
existing build
|
||||
|
||||
--prod Create a production deployment
|
||||
|
||||
-p, --public Deployment is public (\`/_src\`) is exposed)
|
||||
|
||||
--regions Set default regions to enable the deployment on
|
||||
|
||||
--with-cache Retain build cache when using "--force"
|
||||
|
||||
-y, --yes Use default options to skip all prompts
|
||||
|
||||
[2mExamples:[22m
|
||||
|
||||
[90m-[39m Deploy the current directory
|
||||
|
||||
[36m$ vercel[39m
|
||||
|
||||
[90m-[39m Deploy a custom path
|
||||
|
||||
[36m$ vercel /usr/src/project[39m
|
||||
|
||||
[90m-[39m Deploy with run-time Environment Variables
|
||||
|
||||
[36m$ vercel -e NODE_ENV=production[39m
|
||||
|
||||
[90m-[39m Deploy with prebuilt outputs
|
||||
|
||||
[36m$ vercel build[39m
|
||||
[36m$ vercel deploy --prebuilt[39m
|
||||
|
||||
[90m-[39m Write Deployment URL to a file
|
||||
|
||||
[36m$ vercel > deployment-url.txt[39m
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`help command help output snapshots column width 120 1`] = `
|
||||
"▲ [1mvercel[22m [1mdeploy[22m [project-path] [options]
|
||||
|
||||
Deploy your project to Vercel. The \`deploy\` command is the default command for the Vercel CLI, and can be omitted (\`vc deploy my-app\` equals \`vc my-app\`).
|
||||
|
||||
[2mOptions:[22m
|
||||
|
||||
--archive Compress the deployment code into a file before uploading it
|
||||
|
||||
-b, --build-env <key=value> Specify environment variables during build-time (e.g. \`-b KEY1=value1 -b KEY2=value2\`)
|
||||
|
||||
-e, --env <key=value> Specify environment variables during run-time (e.g. \`-e KEY1=value1 -e KEY2=value2\`)
|
||||
|
||||
-f, --force Force a new deployment even if nothing has changed
|
||||
|
||||
-m, --meta <key=value> Specify metadata for the deployment (e.g. \`-m KEY1=value1 -m KEY2=value2\`)
|
||||
|
||||
--no-wait Don't wait for the deployment to finish
|
||||
|
||||
--prebuilt Use in combination with \`vc build\`. Deploy an existing build
|
||||
|
||||
--prod Create a production deployment
|
||||
|
||||
-p, --public Deployment is public (\`/_src\`) is exposed)
|
||||
|
||||
--regions Set default regions to enable the deployment on
|
||||
|
||||
--with-cache Retain build cache when using "--force"
|
||||
|
||||
-y, --yes Use default options to skip all prompts
|
||||
|
||||
[2mExamples:[22m
|
||||
|
||||
[90m-[39m Deploy the current directory
|
||||
|
||||
[36m$ vercel[39m
|
||||
|
||||
[90m-[39m Deploy a custom path
|
||||
|
||||
[36m$ vercel /usr/src/project[39m
|
||||
|
||||
[90m-[39m Deploy with run-time Environment Variables
|
||||
|
||||
[36m$ vercel -e NODE_ENV=production[39m
|
||||
|
||||
[90m-[39m Deploy with prebuilt outputs
|
||||
|
||||
[36m$ vercel build[39m
|
||||
[36m$ vercel deploy --prebuilt[39m
|
||||
|
||||
[90m-[39m Write Deployment URL to a file
|
||||
|
||||
[36m$ vercel > deployment-url.txt[39m
|
||||
"
|
||||
`;
|
||||
71
packages/cli/test/unit/commands/help.test.ts
Normal file
71
packages/cli/test/unit/commands/help.test.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import {
|
||||
calcLineLength,
|
||||
help,
|
||||
lineToString,
|
||||
outputArrayToString,
|
||||
} from '../../../src/commands/help';
|
||||
import { deployCommand } from '../../../src/commands/deploy/command';
|
||||
|
||||
import chalk from 'chalk';
|
||||
|
||||
describe('help command', () => {
|
||||
describe('calcLineLength', () => {
|
||||
test.each([
|
||||
{
|
||||
name: 'without ansi',
|
||||
line: ['a line without ansi'],
|
||||
expectedLength: 19,
|
||||
},
|
||||
{
|
||||
name: 'with ansi',
|
||||
line: [`a line with ${chalk.red('ansi')}`],
|
||||
expectedLength: 16,
|
||||
},
|
||||
])(
|
||||
'should calculate the correct line length $name',
|
||||
({ line, expectedLength }) => {
|
||||
expect(calcLineLength(line)).toBe(expectedLength);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('lineToString', () => {
|
||||
test.each([
|
||||
{
|
||||
line: ['a', 'b', 'c'],
|
||||
expected: 'a b c',
|
||||
},
|
||||
{
|
||||
line: [' ', 'a', ' ', 'b', ' ', 'c', ' '],
|
||||
expected: ' a b c ',
|
||||
},
|
||||
{
|
||||
line: [' ', ' ', ' '],
|
||||
expected: ' ',
|
||||
},
|
||||
{
|
||||
line: ['a', ' ', ' ', 'b', 'c'],
|
||||
expected: 'a b c',
|
||||
},
|
||||
])(
|
||||
'should insert spaces between non-whitespace items only; $line',
|
||||
({ line, expected }) => {
|
||||
expect(lineToString(line)).toBe(expected);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('outputArrayToString', () => {
|
||||
test('should join a list of strings using newlines', () => {
|
||||
expect(outputArrayToString(['line 1', 'line 2', 'line 3'])).toBe(
|
||||
'line 1\nline 2\nline 3'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('help output snapshots', () => {
|
||||
test.each([40, 80, 120])('column width %i', width => {
|
||||
expect(help(deployCommand, { columns: width })).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -58,6 +58,7 @@ describe('list', () => {
|
||||
'Age',
|
||||
'Deployment',
|
||||
'Status',
|
||||
'Environment',
|
||||
'Duration',
|
||||
'Username',
|
||||
]);
|
||||
@@ -68,6 +69,7 @@ describe('list', () => {
|
||||
expect(data).toEqual([
|
||||
`https://${deployment.url}`,
|
||||
stateString(deployment.state || ''),
|
||||
deployment.target === 'production' ? 'Production' : 'Preview',
|
||||
getDeploymentDuration(deployment),
|
||||
user.username,
|
||||
]);
|
||||
@@ -107,7 +109,13 @@ describe('list', () => {
|
||||
|
||||
line = await lines.next();
|
||||
const header = parseSpacedTableRow(line.value!);
|
||||
expect(header).toEqual(['Age', 'Deployment', 'Status', 'Duration']);
|
||||
expect(header).toEqual([
|
||||
'Age',
|
||||
'Deployment',
|
||||
'Status',
|
||||
'Environment',
|
||||
'Duration',
|
||||
]);
|
||||
|
||||
line = await lines.next();
|
||||
const data = parseSpacedTableRow(line.value!);
|
||||
@@ -116,6 +124,7 @@ describe('list', () => {
|
||||
expect(data).toEqual([
|
||||
'https://' + deployment.url,
|
||||
stateString(deployment.state || ''),
|
||||
deployment.target === 'production' ? 'Production' : 'Preview',
|
||||
getDeploymentDuration(deployment),
|
||||
]);
|
||||
});
|
||||
@@ -160,6 +169,7 @@ describe('list', () => {
|
||||
'Age',
|
||||
'Deployment',
|
||||
'Status',
|
||||
'Environment',
|
||||
'Duration',
|
||||
'Username',
|
||||
]);
|
||||
@@ -170,8 +180,50 @@ describe('list', () => {
|
||||
expect(data).toEqual([
|
||||
`https://${deployment.url}`,
|
||||
stateString(deployment.state || ''),
|
||||
deployment.target === 'production' ? 'Production' : 'Preview',
|
||||
getDeploymentDuration(deployment),
|
||||
user.username,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should output deployment URLs to stdout', async () => {
|
||||
const user = useUser();
|
||||
useProject({
|
||||
...defaultProject,
|
||||
id: 'with-team',
|
||||
name: 'with-team',
|
||||
});
|
||||
const prodDeployment = useDeployment({
|
||||
creator: user,
|
||||
createdAt: Date.now() - 1000,
|
||||
target: 'production',
|
||||
});
|
||||
const previewDeployment = useDeployment({
|
||||
creator: user,
|
||||
createdAt: Date.now(),
|
||||
target: undefined,
|
||||
});
|
||||
|
||||
client.stdout.isTTY = false;
|
||||
client.cwd = fixture('with-team');
|
||||
|
||||
// run with all deployments
|
||||
let prom = list(client);
|
||||
await expect(client.stdout).toOutput(
|
||||
`https://${previewDeployment.url}\nhttps://${prodDeployment.url}`
|
||||
);
|
||||
await prom;
|
||||
|
||||
// run again with preview deployments only
|
||||
client.setArgv('--environment', 'preview');
|
||||
prom = list(client);
|
||||
await expect(client.stdout).toOutput(`https://${previewDeployment.url}`);
|
||||
await prom;
|
||||
|
||||
// run again with production deployments only
|
||||
client.setArgv('--environment', 'production');
|
||||
prom = list(client);
|
||||
await expect(client.stdout).toOutput(`https://${prodDeployment.url}`);
|
||||
await prom;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ import { setupUnitFixture } from '../../helpers/setup-unit-fixture';
|
||||
import { useDeployment } from '../../mocks/deployment';
|
||||
import { useTeams } from '../../mocks/team';
|
||||
import { useUser } from '../../mocks/user';
|
||||
import { Deployment } from '@vercel-internals/types';
|
||||
|
||||
describe('redeploy', () => {
|
||||
it('should error if missing deployment url', async () => {
|
||||
@@ -77,9 +78,20 @@ describe('redeploy', () => {
|
||||
|
||||
await expect(exitCodePromise).resolves.toEqual(0);
|
||||
});
|
||||
|
||||
it('should redeploy to preview', async () => {
|
||||
const { fromDeployment } = initRedeployTest({ target: null });
|
||||
client.setArgv('rollback', fromDeployment.id);
|
||||
const exitCodePromise = redeploy(client);
|
||||
await expect(client.stderr).toOutput(
|
||||
`Fetching deployment "${fromDeployment.id}" in ${fromDeployment.creator?.username}`
|
||||
);
|
||||
await expect(client.stderr).toOutput('Preview');
|
||||
await expect(exitCodePromise).resolves.toEqual(0);
|
||||
});
|
||||
});
|
||||
|
||||
function initRedeployTest() {
|
||||
function initRedeployTest({ target }: { target?: Deployment['target'] } = {}) {
|
||||
setupUnitFixture('commands/redeploy/simple-static');
|
||||
const user = useUser();
|
||||
useTeams('team_dummy');
|
||||
@@ -88,10 +100,18 @@ function initRedeployTest() {
|
||||
id: 'vercel-redeploy',
|
||||
name: 'vercel-redeploy',
|
||||
});
|
||||
const fromDeployment = useDeployment({ creator: user });
|
||||
const toDeployment = useDeployment({ creator: user });
|
||||
const fromDeployment = useDeployment({ creator: user, target });
|
||||
const toDeployment = useDeployment({ creator: user, target });
|
||||
|
||||
client.scenario.post(`/v13/deployments`, (req, res) => {
|
||||
const { target } = req.body;
|
||||
if (target !== undefined && typeof target !== 'string') {
|
||||
res.status(400).json({
|
||||
message: 'Invalid request: `target` should be string',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
res.json(toDeployment);
|
||||
});
|
||||
|
||||
|
||||
34
packages/cli/test/unit/util/git/repo-info-to-url.test.ts
Normal file
34
packages/cli/test/unit/util/git/repo-info-to-url.test.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { repoInfoToUrl } from '../../../../src/util/git/repo-info-to-url';
|
||||
import type { RepoInfo } from '../../../../src/util/git/connect-git-provider';
|
||||
|
||||
describe('repoInfoToUrl()', () => {
|
||||
it('should support "github" URL', () => {
|
||||
const info: RepoInfo = {
|
||||
provider: 'github',
|
||||
org: 'vercel',
|
||||
repo: 'foo',
|
||||
url: 'git@github.com:vercel/foo.git',
|
||||
};
|
||||
expect(repoInfoToUrl(info)).toEqual('https://github.com/vercel/foo');
|
||||
});
|
||||
|
||||
it('should support "gitlab" URL', () => {
|
||||
const info: RepoInfo = {
|
||||
provider: 'gitlab',
|
||||
org: 'vercel',
|
||||
repo: 'foo',
|
||||
url: 'git@gitlab.com:vercel/foo.git',
|
||||
};
|
||||
expect(repoInfoToUrl(info)).toEqual('https://gitlab.com/vercel/foo');
|
||||
});
|
||||
|
||||
it('should support "bitbucket" URL', () => {
|
||||
const info: RepoInfo = {
|
||||
provider: 'bitbucket',
|
||||
org: 'vercel',
|
||||
repo: 'foo',
|
||||
url: 'git@bitbucket.com:vercel/foo.git',
|
||||
};
|
||||
expect(repoInfoToUrl(info)).toEqual('https://bitbucket.com/vercel/foo');
|
||||
});
|
||||
});
|
||||
43
packages/cli/test/unit/util/projects/detect-projects.test.ts
Normal file
43
packages/cli/test/unit/util/projects/detect-projects.test.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { join } from 'path';
|
||||
import type { Framework } from '@vercel/frameworks';
|
||||
import { detectProjects } from '../../../../src/util/projects/detect-projects';
|
||||
|
||||
const REPO_ROOT = join(__dirname, '../../../../../..');
|
||||
const EXAMPLES_DIR = join(REPO_ROOT, 'examples');
|
||||
const FS_DETECTORS_FIXTURES = join(
|
||||
REPO_ROOT,
|
||||
'packages/fs-detectors/test/fixtures'
|
||||
);
|
||||
|
||||
function mapDetected(
|
||||
detected: Map<string, Framework[]>
|
||||
): Array<[string, string[]]> {
|
||||
return [...detected.entries()]
|
||||
.sort((a, b) => a[0].localeCompare(b[0]))
|
||||
.map(([dir, frameworks]) => [dir, frameworks.map(f => f.slug as string)]);
|
||||
}
|
||||
|
||||
describe('detectProjects()', () => {
|
||||
it('should match 1 Project in "nextjs" example', async () => {
|
||||
const dir = join(EXAMPLES_DIR, 'nextjs');
|
||||
const detected = await detectProjects(dir);
|
||||
expect(mapDetected(detected)).toEqual([['', ['nextjs']]]);
|
||||
});
|
||||
|
||||
it('should match 2 Projects in "storybook" example', async () => {
|
||||
const dir = join(EXAMPLES_DIR, 'storybook');
|
||||
const detected = await detectProjects(dir);
|
||||
expect(mapDetected(detected)).toEqual([['', ['nextjs', 'storybook']]]);
|
||||
});
|
||||
|
||||
it('should match "30-double-nested-workspaces"', async () => {
|
||||
const dir = join(FS_DETECTORS_FIXTURES, '30-double-nested-workspaces');
|
||||
const detected = await detectProjects(dir);
|
||||
expect(mapDetected(detected)).toEqual([
|
||||
['packages/backend/c', ['remix']],
|
||||
['packages/backend/d', ['nextjs']],
|
||||
['packages/frontend/a', ['hexo']],
|
||||
['packages/frontend/b', ['ember']],
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -1,4 +0,0 @@
|
||||
declare module 'supports-hyperlinks' {
|
||||
import { Writable } from 'stream';
|
||||
export function supportsHyperlink(stream: Writable): boolean;
|
||||
}
|
||||
@@ -1,5 +1,19 @@
|
||||
# @vercel/client
|
||||
|
||||
## 12.6.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`0750517af`](https://github.com/vercel/vercel/commit/0750517af99aea41410d4f1f772ce427699554e7)]:
|
||||
- @vercel/build-utils@6.8.2
|
||||
|
||||
## 12.6.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`7021279b2`](https://github.com/vercel/vercel/commit/7021279b284f314a4d1bdbb4306b4c22291efa08)]:
|
||||
- @vercel/build-utils@6.8.1
|
||||
|
||||
## 12.6.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/client",
|
||||
"version": "12.6.3",
|
||||
"version": "12.6.5",
|
||||
"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.8.2",
|
||||
"@vercel/routing-utils": "2.2.1",
|
||||
"@zeit/fetch": "5.2.0",
|
||||
"async-retry": "1.2.3",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @vercel/frameworks
|
||||
|
||||
## 1.5.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Add `ignorePackageJsonScript` configuration for Framework command settings to ignore the `package.json` script. ([#10228](https://github.com/vercel/vercel/pull/10228))
|
||||
|
||||
Enable this mode for Storybook's `buildCommand`, since it should not invoke the "build" script, which is most likely designated for the frontend app build.
|
||||
|
||||
## 1.4.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/frameworks",
|
||||
"version": "1.4.3",
|
||||
"version": "1.5.0",
|
||||
"main": "./dist/frameworks.js",
|
||||
"types": "./dist/frameworks.d.ts",
|
||||
"files": [
|
||||
|
||||
@@ -1955,6 +1955,7 @@ export const frameworks = [
|
||||
},
|
||||
buildCommand: {
|
||||
value: 'storybook build',
|
||||
ignorePackageJsonScript: true,
|
||||
},
|
||||
devCommand: {
|
||||
value: `storybook dev -p $PORT`,
|
||||
|
||||
@@ -32,11 +32,24 @@ export interface SettingPlaceholder {
|
||||
|
||||
export interface SettingValue {
|
||||
/**
|
||||
* A predefined setting for the detected framework
|
||||
* A predefined setting for the detected framework.
|
||||
* @example "next dev --port $PORT"
|
||||
*/
|
||||
value: string | null;
|
||||
/**
|
||||
* Placeholder text that may be shown in the UI when
|
||||
* the user is configuring this setting value.
|
||||
* @example "`npm run build` or `next build`"
|
||||
*/
|
||||
placeholder?: string;
|
||||
/**
|
||||
* When set to `true`, then the builder will not
|
||||
* invoke the equivalent script in `package.json`,
|
||||
* and instead will invoke the command specified in
|
||||
* configuration setting directly. When this
|
||||
* configuration is enabled, `value` must be a string.
|
||||
*/
|
||||
ignorePackageJsonScript?: boolean;
|
||||
}
|
||||
|
||||
export type Setting = SettingValue | SettingPlaceholder;
|
||||
|
||||
16
packages/frameworks/test/frameworks.unit.test.ts
vendored
16
packages/frameworks/test/frameworks.unit.test.ts
vendored
@@ -49,6 +49,22 @@ const SchemaSettings = {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'object',
|
||||
required: ['value', 'ignorePackageJsonScript'],
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
value: {
|
||||
type: 'string',
|
||||
},
|
||||
placeholder: {
|
||||
type: 'string',
|
||||
},
|
||||
ignorePackageJsonScript: {
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'object',
|
||||
required: ['placeholder'],
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# @vercel/fs-detectors
|
||||
|
||||
## 4.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`ce4633fe4`](https://github.com/vercel/vercel/commit/ce4633fe4d00cb5c251cdabbfab08f39ec3f3b5f)]:
|
||||
- @vercel/frameworks@1.5.0
|
||||
|
||||
## 4.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Add `detectFrameworks()` function ([#10195](https://github.com/vercel/vercel/pull/10195))
|
||||
|
||||
## 4.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/fs-detectors",
|
||||
"version": "4.0.1",
|
||||
"version": "4.1.1",
|
||||
"description": "Vercel filesystem detectors",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/error-utils": "1.0.10",
|
||||
"@vercel/frameworks": "1.4.3",
|
||||
"@vercel/frameworks": "1.5.0",
|
||||
"@vercel/routing-utils": "2.2.1",
|
||||
"glob": "8.0.3",
|
||||
"js-yaml": "4.1.0",
|
||||
@@ -36,7 +36,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.8.2",
|
||||
"typescript": "4.9.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,6 +151,24 @@ export async function detectFramework({
|
||||
return result.find(res => res !== null) ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects all matching Frameworks based on the given virtual filesystem.
|
||||
*/
|
||||
export async function detectFrameworks({
|
||||
fs,
|
||||
frameworkList,
|
||||
}: DetectFrameworkRecordOptions): Promise<Framework[]> {
|
||||
const result = await Promise.all(
|
||||
frameworkList.map(async frameworkMatch => {
|
||||
if (await matches(fs, frameworkMatch)) {
|
||||
return frameworkMatch;
|
||||
}
|
||||
return null;
|
||||
})
|
||||
);
|
||||
return result.filter(res => res !== null) as Framework[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Framework with a `detectedVersion` specifying the version
|
||||
* or version range of the relevant package
|
||||
|
||||
@@ -7,6 +7,7 @@ export {
|
||||
export { detectFileSystemAPI } from './detect-file-system-api';
|
||||
export {
|
||||
detectFramework,
|
||||
detectFrameworks,
|
||||
detectFrameworkRecord,
|
||||
detectFrameworkVersion,
|
||||
} from './detect-framework';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "backend-c30",
|
||||
"license": "MIT",
|
||||
"version": "0.1.0"
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "backend-d30",
|
||||
"license": "MIT",
|
||||
"version": "0.1.0",
|
||||
"devDependencies": {
|
||||
"next": "*",
|
||||
"once": "1.4.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "frontend-a30",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
@@ -10,6 +11,7 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"debug": "^4.3.2"
|
||||
"debug": "^4.3.2",
|
||||
"hexo": "*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "frontend-b30",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
@@ -10,6 +11,7 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"cowsay": "^1.5.0"
|
||||
"cowsay": "^1.5.0",
|
||||
"ember-cli": "*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import frameworkList from '@vercel/frameworks';
|
||||
import workspaceManagers from '../src/workspaces/workspace-managers';
|
||||
import { detectFramework } from '../src';
|
||||
import { detectFramework, detectFrameworks } from '../src';
|
||||
import VirtualFilesystem from './virtual-file-system';
|
||||
|
||||
describe('DetectorFilesystem', () => {
|
||||
@@ -114,12 +114,12 @@ describe('DetectorFilesystem', () => {
|
||||
expect(await packagesFs.isFile('app2')).toBe(false);
|
||||
expect(await packagesFs.isFile('app1/package.json')).toBe(true);
|
||||
expect(await packagesFs.isFile('app2/package.json')).toBe(true);
|
||||
expect(
|
||||
await (await packagesFs.readFile('app1/package.json')).toString()
|
||||
).toEqual(nextPackageJson);
|
||||
expect(
|
||||
await (await packagesFs.readFile('app2/package.json')).toString()
|
||||
).toEqual(gatsbyPackageJson);
|
||||
expect((await packagesFs.readFile('app1/package.json')).toString()).toEqual(
|
||||
nextPackageJson
|
||||
);
|
||||
expect((await packagesFs.readFile('app2/package.json')).toString()).toEqual(
|
||||
gatsbyPackageJson
|
||||
);
|
||||
|
||||
expect(await detectFramework({ fs: packagesFs, frameworkList })).toBe(null);
|
||||
|
||||
@@ -143,266 +143,294 @@ describe('DetectorFilesystem', () => {
|
||||
{ name: 'package.json', path: 'package.json', type: 'file' },
|
||||
]);
|
||||
|
||||
expect(
|
||||
await (await gatsbyAppFs.readFile('package.json')).toString()
|
||||
).toEqual(gatsbyPackageJson);
|
||||
expect((await gatsbyAppFs.readFile('package.json')).toString()).toEqual(
|
||||
gatsbyPackageJson
|
||||
);
|
||||
|
||||
expect(await detectFramework({ fs: gatsbyAppFs, frameworkList })).toBe(
|
||||
'gatsby'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#detectFramework', () => {
|
||||
it('Do not detect anything', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'README.md': '# hi',
|
||||
'api/cheese.js': 'export default (req, res) => res.end("cheese");',
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe(null);
|
||||
describe('detectFramework()', () => {
|
||||
it('Do not detect anything', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'README.md': '# hi',
|
||||
'api/cheese.js': 'export default (req, res) => res.end("cheese");',
|
||||
});
|
||||
|
||||
it('Detect nx', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'workspace.json': JSON.stringify({
|
||||
projects: { 'app-one': 'apps/app-one' },
|
||||
}),
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe(null);
|
||||
});
|
||||
|
||||
expect(
|
||||
await detectFramework({ fs, frameworkList: workspaceManagers })
|
||||
).toBe('nx');
|
||||
it('Detect nx', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'workspace.json': JSON.stringify({
|
||||
projects: { 'app-one': 'apps/app-one' },
|
||||
}),
|
||||
});
|
||||
|
||||
it('Do not detect anything', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'workspace.json': JSON.stringify({ projects: {} }),
|
||||
});
|
||||
expect(
|
||||
await detectFramework({ fs, frameworkList: workspaceManagers })
|
||||
).toBe('nx');
|
||||
});
|
||||
|
||||
expect(
|
||||
await detectFramework({ fs, frameworkList: workspaceManagers })
|
||||
).toBe(null);
|
||||
it('Do not detect anything', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'workspace.json': JSON.stringify({ projects: {} }),
|
||||
});
|
||||
|
||||
it('Detect Next.js', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
next: '9.0.0',
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(
|
||||
await detectFramework({ fs, frameworkList: workspaceManagers })
|
||||
).toBe(null);
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('nextjs');
|
||||
it('Detect Next.js', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
next: '9.0.0',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
it('Detect frameworks based on ascending order in framework list', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
next: '9.0.0',
|
||||
gatsby: '4.18.0',
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('nextjs');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('nextjs');
|
||||
it('Detect frameworks based on ascending order in framework list', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
next: '9.0.0',
|
||||
gatsby: '4.18.0',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
it('Detect Nuxt.js', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
nuxt: '1.0.0',
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('nextjs');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('nuxtjs');
|
||||
it('Detect Nuxt.js', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
nuxt: '1.0.0',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
it('Detect Nuxt.js Edge', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
'nuxt-edge': '1.0.0',
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('nuxtjs');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('nuxtjs');
|
||||
it('Detect Nuxt.js Edge', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
'nuxt-edge': '1.0.0',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
it('Detect Nuxt.js 3', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
nuxt3: '1.0.0',
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('nuxtjs');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('nuxtjs');
|
||||
it('Detect Nuxt.js 3', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
nuxt3: '1.0.0',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
it('Detect Gatsby', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
gatsby: '1.0.0',
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('nuxtjs');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('gatsby');
|
||||
it('Detect Gatsby', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
gatsby: '1.0.0',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
it('Detect Hugo #1', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'config.yaml': 'baseURL: http://example.org/',
|
||||
'content/post.md': '# hello world',
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('gatsby');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('hugo');
|
||||
it('Detect Hugo #1', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'config.yaml': 'baseURL: http://example.org/',
|
||||
'content/post.md': '# hello world',
|
||||
});
|
||||
|
||||
it('Detect Hugo #2', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'config.json': '{ "baseURL": "http://example.org/" }',
|
||||
'content/post.md': '# hello world',
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('hugo');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('hugo');
|
||||
it('Detect Hugo #2', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'config.json': '{ "baseURL": "http://example.org/" }',
|
||||
'content/post.md': '# hello world',
|
||||
});
|
||||
|
||||
it('Detect Hugo #3', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'config.toml': 'baseURL = "http://example.org/"',
|
||||
'content/post.md': '# hello world',
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('hugo');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('hugo');
|
||||
it('Detect Hugo #3', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'config.toml': 'baseURL = "http://example.org/"',
|
||||
'content/post.md': '# hello world',
|
||||
});
|
||||
|
||||
it('Detect Jekyll', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'_config.yml': 'config',
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('hugo');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('jekyll');
|
||||
it('Detect Jekyll', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'_config.yml': 'config',
|
||||
});
|
||||
|
||||
it('Detect Middleman', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'config.rb': 'config',
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('jekyll');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('middleman');
|
||||
it('Detect Middleman', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'config.rb': 'config',
|
||||
});
|
||||
|
||||
it('Detect Scully', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
'@angular/cli': 'latest',
|
||||
'@scullyio/init': 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('middleman');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('scully');
|
||||
it('Detect Scully', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
'@angular/cli': 'latest',
|
||||
'@scullyio/init': 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
it('Detect Zola', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'config.toml': 'base_url = "/"',
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('scully');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('zola');
|
||||
it('Detect Zola', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'config.toml': 'base_url = "/"',
|
||||
});
|
||||
|
||||
it('Detect Blitz.js (Legacy)', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'blitz.config.js': '// some config',
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('zola');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('blitzjs');
|
||||
it('Detect Blitz.js (Legacy)', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'blitz.config.js': '// some config',
|
||||
});
|
||||
|
||||
it('Detect Ember via `ember-source`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
'ember-source': 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('blitzjs');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('ember');
|
||||
it('Detect Ember via `ember-source`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
'ember-source': 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
it('Detect Ember via `ember-cli`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
'ember-cli': 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('ember');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('ember');
|
||||
it('Detect Ember via `ember-cli`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
'ember-cli': 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
it('Detect Brunch via `brunch`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
brunch: 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('ember');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('brunch');
|
||||
it('Detect Brunch via `brunch`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
brunch: 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
it('Detect Brunch via `brunch-config.js`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'brunch-config.js': '// some config',
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('brunch');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('brunch');
|
||||
it('Detect Brunch via `brunch-config.js`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'brunch-config.js': '// some config',
|
||||
});
|
||||
|
||||
it('Detect Hydrogen via `hydrogen.config.js`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'hydrogen.config.js': '// some config',
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('brunch');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('hydrogen');
|
||||
it('Detect Hydrogen via `hydrogen.config.js`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'hydrogen.config.js': '// some config',
|
||||
});
|
||||
|
||||
it('Detect Hydrogen via `@shopify/hydrogen`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
'@shopify/hydrogen': 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('hydrogen');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('hydrogen');
|
||||
it('Detect Hydrogen via `@shopify/hydrogen`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
'@shopify/hydrogen': 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
it('Detect Storybook via `storybook`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
storybook: 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('hydrogen');
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('storybook');
|
||||
it('Detect Storybook via `storybook`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
storybook: 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('storybook');
|
||||
});
|
||||
});
|
||||
|
||||
describe('detectFrameworks()', () => {
|
||||
it('Return empty array when there are no matches', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {},
|
||||
}),
|
||||
});
|
||||
|
||||
expect(await detectFrameworks({ fs, frameworkList })).toEqual([]);
|
||||
});
|
||||
|
||||
it('Detect `nextjs` and `storybook`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
next: 'latest',
|
||||
storybook: 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
const slugs = (await detectFrameworks({ fs, frameworkList })).map(
|
||||
f => f.slug
|
||||
);
|
||||
expect(slugs).toEqual(['nextjs', 'storybook']);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# @vercel/gatsby-plugin-vercel-builder
|
||||
|
||||
## 1.3.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`b56639b62`](https://github.com/vercel/vercel/commit/b56639b624e9ad1df048a4c85083e26888696060)]:
|
||||
- @vercel/node@2.15.6
|
||||
|
||||
## 1.3.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`0750517af`](https://github.com/vercel/vercel/commit/0750517af99aea41410d4f1f772ce427699554e7)]:
|
||||
- @vercel/build-utils@6.8.2
|
||||
- @vercel/node@2.15.5
|
||||
|
||||
## 1.3.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`7021279b2`](https://github.com/vercel/vercel/commit/7021279b284f314a4d1bdbb4306b4c22291efa08), [`5e5332fbc`](https://github.com/vercel/vercel/commit/5e5332fbc9317a8f3cc4ed0b72ec1a2c76020891)]:
|
||||
- @vercel/build-utils@6.8.1
|
||||
- @vercel/node@2.15.4
|
||||
|
||||
## 1.3.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/gatsby-plugin-vercel-builder",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.14",
|
||||
"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.8.2",
|
||||
"@vercel/node": "2.15.6",
|
||||
"@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.8.2",
|
||||
"@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.8.2",
|
||||
"@vercel/static-config": "2.0.17",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "11.1.0",
|
||||
|
||||
3
packages/next/.gitignore
vendored
3
packages/next/.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
/dist
|
||||
test/builder-info.json
|
||||
test/builder-info.json
|
||||
test/fixtures/**/tmp-contents
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
# @vercel/next
|
||||
|
||||
## 3.9.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix pages and app router i18n handling ([#10243](https://github.com/vercel/vercel/pull/10243))
|
||||
|
||||
## 3.9.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Support maxDuration in Next.js deployments ([#10069](https://github.com/vercel/vercel/pull/10069))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix 404 page in edge runtime ([#10223](https://github.com/vercel/vercel/pull/10223))
|
||||
|
||||
## 3.8.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [next] Ensure RSC paths handle basePath ([#10155](https://github.com/vercel/vercel/pull/10155))
|
||||
|
||||
## 3.8.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/next",
|
||||
"version": "3.8.7",
|
||||
"version": "3.9.1",
|
||||
"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.8.2",
|
||||
"@vercel/nft": "0.22.5",
|
||||
"@vercel/routing-utils": "2.2.1",
|
||||
"async-sema": "3.0.1",
|
||||
|
||||
@@ -90,6 +90,7 @@ import {
|
||||
validateEntrypoint,
|
||||
getOperationType,
|
||||
isApiPage,
|
||||
getFunctionsConfigManifest,
|
||||
} from './utils';
|
||||
|
||||
export const version = 2;
|
||||
@@ -272,7 +273,7 @@ export const build: BuildV2 = async ({
|
||||
});
|
||||
|
||||
let hasLegacyRoutes = false;
|
||||
const hasFunctionsConfig = !!config.functions;
|
||||
const hasFunctionsConfig = Boolean(config.functions);
|
||||
|
||||
if (await pathExists(dotNextStatic)) {
|
||||
console.warn('WARNING: You should not upload the `.next` directory.');
|
||||
@@ -487,7 +488,12 @@ export const build: BuildV2 = async ({
|
||||
? await getRequiredServerFilesManifest(entryPath, outputDirectory)
|
||||
: false;
|
||||
|
||||
isServerMode = !!requiredServerFilesManifest;
|
||||
isServerMode = Boolean(requiredServerFilesManifest);
|
||||
|
||||
const functionsConfigManifest = await getFunctionsConfigManifest(
|
||||
entryPath,
|
||||
outputDirectory
|
||||
);
|
||||
|
||||
const routesManifest = await getRoutesManifest(
|
||||
entryPath,
|
||||
@@ -1312,6 +1318,7 @@ export const build: BuildV2 = async ({
|
||||
|
||||
return serverBuild({
|
||||
config,
|
||||
functionsConfigManifest,
|
||||
nextVersion,
|
||||
trailingSlash,
|
||||
appPathRoutesManifest,
|
||||
@@ -1570,6 +1577,7 @@ export const build: BuildV2 = async ({
|
||||
const initialPageLambdaGroups = await getPageLambdaGroups({
|
||||
entryPath,
|
||||
config,
|
||||
functionsConfigManifest,
|
||||
pages: nonApiPages,
|
||||
prerenderRoutes: new Set(),
|
||||
pageTraces,
|
||||
@@ -1586,6 +1594,7 @@ export const build: BuildV2 = async ({
|
||||
const initialApiLambdaGroups = await getPageLambdaGroups({
|
||||
entryPath,
|
||||
config,
|
||||
functionsConfigManifest,
|
||||
pages: apiPages,
|
||||
prerenderRoutes: new Set(),
|
||||
pageTraces,
|
||||
|
||||
@@ -44,6 +44,7 @@ import {
|
||||
getFilesMapFromReasons,
|
||||
UnwrapPromise,
|
||||
getOperationType,
|
||||
FunctionsConfigManifestV1,
|
||||
} from './utils';
|
||||
import {
|
||||
nodeFileTrace,
|
||||
@@ -66,6 +67,7 @@ export async function serverBuild({
|
||||
dynamicPages,
|
||||
pagesDir,
|
||||
config = {},
|
||||
functionsConfigManifest,
|
||||
privateOutputs,
|
||||
baseDir,
|
||||
workPath,
|
||||
@@ -105,6 +107,7 @@ export async function serverBuild({
|
||||
dynamicPages: string[];
|
||||
trailingSlash: boolean;
|
||||
config: Config;
|
||||
functionsConfigManifest?: FunctionsConfigManifestV1;
|
||||
pagesDir: string;
|
||||
baseDir: string;
|
||||
canUsePreviewMode: boolean;
|
||||
@@ -204,6 +207,7 @@ export async function serverBuild({
|
||||
|
||||
const { i18n } = routesManifest;
|
||||
const hasPages404 = routesManifest.pages404;
|
||||
let localePrefixed404 = false;
|
||||
|
||||
let static404Page =
|
||||
staticPages[path.posix.join(entryDirectory, '404')] && hasPages404
|
||||
@@ -213,11 +217,16 @@ export async function serverBuild({
|
||||
: undefined;
|
||||
|
||||
if (!static404Page && i18n) {
|
||||
static404Page = staticPages[
|
||||
path.posix.join(entryDirectory, i18n.defaultLocale, '404')
|
||||
]
|
||||
? path.posix.join(entryDirectory, i18n.defaultLocale, '404')
|
||||
: undefined;
|
||||
if (
|
||||
staticPages[path.posix.join(entryDirectory, i18n.defaultLocale, '404')]
|
||||
) {
|
||||
localePrefixed404 = true;
|
||||
static404Page = path.posix.join(
|
||||
entryDirectory,
|
||||
i18n.defaultLocale,
|
||||
'404'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasStatic500 && i18n) {
|
||||
@@ -752,6 +761,7 @@ export async function serverBuild({
|
||||
const pageLambdaGroups = await getPageLambdaGroups({
|
||||
entryPath: projectDir,
|
||||
config,
|
||||
functionsConfigManifest,
|
||||
pages: nonApiPages,
|
||||
prerenderRoutes,
|
||||
pageTraces,
|
||||
@@ -767,6 +777,7 @@ export async function serverBuild({
|
||||
const appRouterLambdaGroups = await getPageLambdaGroups({
|
||||
entryPath: projectDir,
|
||||
config,
|
||||
functionsConfigManifest,
|
||||
pages: appRouterPages,
|
||||
prerenderRoutes,
|
||||
pageTraces,
|
||||
@@ -789,6 +800,7 @@ export async function serverBuild({
|
||||
const apiLambdaGroups = await getPageLambdaGroups({
|
||||
entryPath: projectDir,
|
||||
config,
|
||||
functionsConfigManifest,
|
||||
pages: apiPages,
|
||||
prerenderRoutes,
|
||||
pageTraces,
|
||||
@@ -961,6 +973,7 @@ export async function serverBuild({
|
||||
if (
|
||||
i18n &&
|
||||
!isPrerender &&
|
||||
!group.isAppRouter &&
|
||||
(!isCorrectLocaleAPIRoutes ||
|
||||
!(pageNoExt === 'api' || pageNoExt.startsWith('api/')))
|
||||
) {
|
||||
@@ -998,6 +1011,7 @@ export async function serverBuild({
|
||||
isSharedLambdas: false,
|
||||
canUsePreviewMode,
|
||||
static404Page,
|
||||
localePrefixed404,
|
||||
hasPages404: routesManifest.pages404,
|
||||
isCorrectNotFoundRoutes,
|
||||
isEmptyAllowQueryForPrendered,
|
||||
@@ -1064,7 +1078,8 @@ export async function serverBuild({
|
||||
prerenderManifest,
|
||||
routesManifest,
|
||||
true,
|
||||
isCorrectLocaleAPIRoutes
|
||||
isCorrectLocaleAPIRoutes,
|
||||
inversedAppPathManifest
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1198,7 +1213,11 @@ export async function serverBuild({
|
||||
if (ogRoute.endsWith('/route')) {
|
||||
continue;
|
||||
}
|
||||
route = path.posix.join('./', route === '/' ? '/index' : route);
|
||||
route = path.posix.join(
|
||||
'./',
|
||||
entryDirectory,
|
||||
route === '/' ? '/index' : route
|
||||
);
|
||||
|
||||
if (lambdas[route]) {
|
||||
lambdas[`${route}.rsc`] = lambdas[route];
|
||||
@@ -1213,6 +1232,7 @@ export async function serverBuild({
|
||||
const rscVaryHeader =
|
||||
routesManifest?.rsc?.varyHeader ||
|
||||
'RSC, Next-Router-State-Tree, Next-Router-Prefetch';
|
||||
const appNotFoundPath = path.posix.join('.', entryDirectory, '_not-found');
|
||||
|
||||
return {
|
||||
wildcard: wildcardConfig,
|
||||
@@ -1745,6 +1765,7 @@ export async function serverBuild({
|
||||
{ handle: 'error' } as RouteWithHandle,
|
||||
|
||||
// Custom Next.js 404 page
|
||||
|
||||
...(i18n && (static404Page || hasIsr404Page || lambdaPages['404.js'])
|
||||
? [
|
||||
{
|
||||
@@ -1779,6 +1800,10 @@ export async function serverBuild({
|
||||
hasIsr404Page ||
|
||||
lambdas[path.posix.join(entryDirectory, '404')]
|
||||
? '/404'
|
||||
: appPathRoutesManifest &&
|
||||
(middleware.edgeFunctions[appNotFoundPath] ||
|
||||
lambdas[appNotFoundPath])
|
||||
? '/_not-found'
|
||||
: '/_error'
|
||||
),
|
||||
status: 404,
|
||||
|
||||
@@ -479,7 +479,8 @@ export function localizeDynamicRoutes(
|
||||
prerenderManifest: NextPrerenderedRoutes,
|
||||
routesManifest?: RoutesManifest,
|
||||
isServerMode?: boolean,
|
||||
isCorrectLocaleAPIRoutes?: boolean
|
||||
isCorrectLocaleAPIRoutes?: boolean,
|
||||
inversedAppPathRoutesManifest?: Record<string, string>
|
||||
): RouteWithSrc[] {
|
||||
return dynamicRoutes.map((route: RouteWithSrc) => {
|
||||
// i18n is already handled for middleware
|
||||
@@ -498,6 +499,9 @@ export function localizeDynamicRoutes(
|
||||
const isAutoExport =
|
||||
staticPages[addLocaleOrDefault(pathname!, routesManifest).substring(1)];
|
||||
|
||||
const isAppRoute =
|
||||
inversedAppPathRoutesManifest?.[pathnameNoPrefix || ''];
|
||||
|
||||
const isLocalePrefixed =
|
||||
isFallback || isBlocking || isAutoExport || isServerMode;
|
||||
|
||||
@@ -508,7 +512,11 @@ export function localizeDynamicRoutes(
|
||||
}${i18n.locales.map(locale => escapeStringRegexp(locale)).join('|')})?`
|
||||
);
|
||||
|
||||
if (isLocalePrefixed && !(isCorrectLocaleAPIRoutes && isApiRoute)) {
|
||||
if (
|
||||
isLocalePrefixed &&
|
||||
!(isCorrectLocaleAPIRoutes && isApiRoute) &&
|
||||
!isAppRoute
|
||||
) {
|
||||
// ensure destination has locale prefix to match prerender output
|
||||
// path so that the prerender object is used
|
||||
route.dest = route.dest!.replace(
|
||||
@@ -1397,6 +1405,7 @@ const LAMBDA_RESERVED_COMPRESSED_SIZE = 250 * KIB;
|
||||
export async function getPageLambdaGroups({
|
||||
entryPath,
|
||||
config,
|
||||
functionsConfigManifest,
|
||||
pages,
|
||||
prerenderRoutes,
|
||||
pageTraces,
|
||||
@@ -1410,6 +1419,7 @@ export async function getPageLambdaGroups({
|
||||
}: {
|
||||
entryPath: string;
|
||||
config: Config;
|
||||
functionsConfigManifest?: FunctionsConfigManifestV1;
|
||||
pages: string[];
|
||||
prerenderRoutes: Set<string>;
|
||||
pageTraces: {
|
||||
@@ -1436,16 +1446,26 @@ export async function getPageLambdaGroups({
|
||||
|
||||
let opts: { memory?: number; maxDuration?: number } = {};
|
||||
|
||||
if (
|
||||
functionsConfigManifest &&
|
||||
functionsConfigManifest.functions[routeName]
|
||||
) {
|
||||
opts = functionsConfigManifest.functions[routeName];
|
||||
}
|
||||
|
||||
if (config && config.functions) {
|
||||
const sourceFile = await getSourceFilePathFromPage({
|
||||
workPath: entryPath,
|
||||
page,
|
||||
pageExtensions,
|
||||
});
|
||||
opts = await getLambdaOptionsFromFunction({
|
||||
|
||||
const vercelConfigOpts = await getLambdaOptionsFromFunction({
|
||||
sourceFile,
|
||||
config,
|
||||
});
|
||||
|
||||
opts = { ...vercelConfigOpts, ...opts };
|
||||
}
|
||||
|
||||
let matchingGroup = groups.find(group => {
|
||||
@@ -1779,6 +1799,7 @@ export const onPrerenderRouteInitial = (
|
||||
type OnPrerenderRouteArgs = {
|
||||
appDir: string | null;
|
||||
pagesDir: string;
|
||||
localePrefixed404?: boolean;
|
||||
static404Page?: string;
|
||||
hasPages404: boolean;
|
||||
entryDirectory: string;
|
||||
@@ -1816,6 +1837,7 @@ export const onPrerenderRoute =
|
||||
appDir,
|
||||
pagesDir,
|
||||
static404Page,
|
||||
localePrefixed404,
|
||||
entryDirectory,
|
||||
prerenderManifest,
|
||||
isSharedLambdas,
|
||||
@@ -1951,7 +1973,9 @@ export const onPrerenderRoute =
|
||||
// file.
|
||||
`${
|
||||
isOmittedOrNotFound
|
||||
? addLocaleOrDefault('/404', routesManifest, locale)
|
||||
? localePrefixed404
|
||||
? addLocaleOrDefault('/404', routesManifest, locale)
|
||||
: '/404'
|
||||
: routeFileNoExt
|
||||
}.html`
|
||||
),
|
||||
@@ -1968,7 +1992,9 @@ export const onPrerenderRoute =
|
||||
: pagesDir,
|
||||
`${
|
||||
isOmittedOrNotFound
|
||||
? addLocaleOrDefault('/404.html', routesManifest, locale)
|
||||
? localePrefixed404
|
||||
? addLocaleOrDefault('/404.html', routesManifest, locale)
|
||||
: '/404.html'
|
||||
: isAppPathRoute
|
||||
? dataRoute
|
||||
: routeFileNoExt + '.json'
|
||||
@@ -2388,6 +2414,16 @@ export {
|
||||
getSourceFilePathFromPage,
|
||||
};
|
||||
|
||||
export type FunctionsConfigManifestV1 = {
|
||||
version: 1;
|
||||
functions: Record<
|
||||
string,
|
||||
{
|
||||
maxDuration?: number;
|
||||
}
|
||||
>;
|
||||
};
|
||||
|
||||
type MiddlewareManifest = MiddlewareManifestV1 | MiddlewareManifestV2;
|
||||
|
||||
interface MiddlewareManifestV1 {
|
||||
@@ -2663,7 +2699,9 @@ export async function getMiddlewareBundle({
|
||||
shortPath = shortPath.replace(/^pages\//, '');
|
||||
} else if (
|
||||
shortPath.startsWith('app/') &&
|
||||
(shortPath.endsWith('/page') || shortPath.endsWith('/route'))
|
||||
(shortPath.endsWith('/page') ||
|
||||
shortPath.endsWith('/route') ||
|
||||
shortPath === 'app/_not-found')
|
||||
) {
|
||||
const ogRoute = shortPath.replace(/^app\//, '/');
|
||||
shortPath = (
|
||||
@@ -2731,6 +2769,37 @@ export async function getMiddlewareBundle({
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to read the functions config manifest from the pre-defined
|
||||
* location. If the manifest can't be found it will resolve to
|
||||
* undefined.
|
||||
*/
|
||||
export async function getFunctionsConfigManifest(
|
||||
entryPath: string,
|
||||
outputDirectory: string
|
||||
): Promise<FunctionsConfigManifestV1 | undefined> {
|
||||
const functionConfigManifestPath = path.join(
|
||||
entryPath,
|
||||
outputDirectory,
|
||||
'./server/functions-config-manifest.json'
|
||||
);
|
||||
|
||||
const hasManifest = await fs
|
||||
.access(functionConfigManifestPath)
|
||||
.then(() => true)
|
||||
.catch(() => false);
|
||||
|
||||
if (!hasManifest) {
|
||||
return;
|
||||
}
|
||||
|
||||
const manifest: FunctionsConfigManifestV1 = await fs.readJSON(
|
||||
functionConfigManifestPath
|
||||
);
|
||||
|
||||
return manifest.version === 1 ? manifest : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to read the middleware manifest from the pre-defined
|
||||
* location. If the manifest can't be found it will resolve to
|
||||
|
||||
32
packages/next/test/fixtures/00-app-dir-base-path/index.test.js
vendored
Normal file
32
packages/next/test/fixtures/00-app-dir-base-path/index.test.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/* eslint-env jest */
|
||||
const path = require('path');
|
||||
const fs = require('fs-extra');
|
||||
const { deployAndTest } = require('../../utils');
|
||||
|
||||
const ctx = {};
|
||||
|
||||
describe(`${__dirname.split(path.sep).pop()}`, () => {
|
||||
const fixtureDir = path.join(__dirname, 'tmp-contents');
|
||||
|
||||
afterAll(() => fs.remove(fixtureDir));
|
||||
|
||||
it('should deploy and pass probe checks', async () => {
|
||||
await fs.copy(path.join(__dirname, '../00-app-dir'), fixtureDir);
|
||||
const nextConfigPath = path.join(fixtureDir, 'next.config.js');
|
||||
|
||||
await fs.writeFile(
|
||||
nextConfigPath,
|
||||
(
|
||||
await fs.readFile(nextConfigPath, 'utf8')
|
||||
).replace('experimental:', 'basePath: "/hello/world",experimental:')
|
||||
);
|
||||
|
||||
await fs.copy(
|
||||
path.join(__dirname, 'vercel.json'),
|
||||
path.join(fixtureDir, 'vercel.json')
|
||||
);
|
||||
|
||||
const info = await deployAndTest(fixtureDir);
|
||||
Object.assign(ctx, info);
|
||||
});
|
||||
});
|
||||
198
packages/next/test/fixtures/00-app-dir-base-path/vercel.json
vendored
Normal file
198
packages/next/test/fixtures/00-app-dir-base-path/vercel.json
vendored
Normal file
@@ -0,0 +1,198 @@
|
||||
{
|
||||
"builds": [
|
||||
{
|
||||
"src": "package.json",
|
||||
"use": "@vercel/next",
|
||||
"config": {
|
||||
"functions": {
|
||||
"app/**/*": {
|
||||
"maxDuration": 5,
|
||||
"memory": 512
|
||||
},
|
||||
"pages/api/**/*": {
|
||||
"maxDuration": 5,
|
||||
"memory": 512
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"probes": [
|
||||
{
|
||||
"path": "/hello/world/dashboard/hello",
|
||||
"status": 200,
|
||||
"mustContain": "hello from app/dashboard/rootonly/hello"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dashboard/another-edge",
|
||||
"status": 200,
|
||||
"mustContain": "hello from newroot/dashboard/another"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dynamic/category-1/id-1",
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"RSC": "1"
|
||||
},
|
||||
"mustContain": ":{",
|
||||
"mustNotContain": "<html"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/ssg",
|
||||
"status": 200,
|
||||
"mustContain": "hello from /ssg",
|
||||
"responseHeaders": {
|
||||
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/ssg",
|
||||
"status": 200,
|
||||
"responseHeaders": {
|
||||
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
|
||||
},
|
||||
"headers": {
|
||||
"RSC": "1"
|
||||
},
|
||||
"mustContain": ":{",
|
||||
"mustNotContain": "<html"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/ssg?override=1",
|
||||
"status": 307,
|
||||
"responseHeaders": {
|
||||
"location": "/overridden/"
|
||||
},
|
||||
"fetchOptions": {
|
||||
"redirect": "manual"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/ssg?override=1",
|
||||
"status": 307,
|
||||
"responseHeaders": {
|
||||
"location": "/overridden/"
|
||||
},
|
||||
"fetchOptions": {
|
||||
"redirect": "manual"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dashboard/deployments/123/settings",
|
||||
"status": 200,
|
||||
"mustContain": "hello from app/dashboard/deployments/[id]/settings",
|
||||
"responseHeaders": {
|
||||
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dashboard/deployments/123/settings",
|
||||
"status": 200,
|
||||
"responseHeaders": {
|
||||
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
|
||||
},
|
||||
"headers": {
|
||||
"RSC": "1"
|
||||
},
|
||||
"mustContain": ":{",
|
||||
"mustNotContain": "<html"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dashboard/deployments/catchall/something",
|
||||
"status": 200,
|
||||
"mustContain": "catchall",
|
||||
"responseHeaders": {
|
||||
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dashboard/deployments/catchall/something",
|
||||
"status": 200,
|
||||
"responseHeaders": {
|
||||
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
|
||||
},
|
||||
"headers": {
|
||||
"RSC": "1"
|
||||
},
|
||||
"mustContain": ":{",
|
||||
"mustNotContain": "<html"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dashboard",
|
||||
"status": 200,
|
||||
"mustContain": "hello from app/dashboard",
|
||||
"responseHeaders": {
|
||||
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dashboard",
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"RSC": "1"
|
||||
},
|
||||
"mustContain": ":{",
|
||||
"mustNotContain": "<html"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dashboard",
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"RSC": "1"
|
||||
},
|
||||
"responseHeaders": {
|
||||
"content-type": "text/x-component",
|
||||
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dashboard/another",
|
||||
"status": 200,
|
||||
"mustContain": "hello from newroot/dashboard/another"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dashboard/deployments/123",
|
||||
"status": 200,
|
||||
"mustContain": "hello from app/dashboard/deployments/[id]. ID is: <!-- -->123"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/",
|
||||
"status": 200,
|
||||
"mustContain": "index app page"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/blog/123",
|
||||
"status": 200,
|
||||
"mustContain": "hello from pages/blog/[slug]"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/blog-ssr/123",
|
||||
"status": 200,
|
||||
"mustContain": "hello from pages/blog-ssr/[slug]"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/blog-ssr/321",
|
||||
"status": 200,
|
||||
"mustContain": "hello context"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dynamic/category-1/id-1",
|
||||
"status": 200,
|
||||
"mustContain": "{"category":"category-1","id":"id-1"}"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/dashboard/changelog",
|
||||
"status": 200,
|
||||
"mustContain": "hello from app/dashboard/changelog"
|
||||
},
|
||||
{
|
||||
"path": "/hello/world/",
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"RSC": "1"
|
||||
},
|
||||
"mustContain": ":{",
|
||||
"mustNotContain": "<html"
|
||||
}
|
||||
]
|
||||
}
|
||||
12
packages/next/test/fixtures/00-app-dir-edge-404/app/layout.js
vendored
Normal file
12
packages/next/test/fixtures/00-app-dir-edge-404/app/layout.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
export const runtime = 'edge'
|
||||
|
||||
export default function Layout({ children }) {
|
||||
return (
|
||||
<html>
|
||||
<head>
|
||||
<title>Hello World</title>
|
||||
</head>
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
)
|
||||
}
|
||||
9
packages/next/test/fixtures/00-app-dir-edge-404/app/not-found.js
vendored
Normal file
9
packages/next/test/fixtures/00-app-dir-edge-404/app/not-found.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export default function Page() {
|
||||
return (
|
||||
<>
|
||||
<h1>This Is The Not Found Page</h1>
|
||||
|
||||
<div id="timestamp">{Date.now()}</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
3
packages/next/test/fixtures/00-app-dir-edge-404/app/not-found/not-found.js
vendored
Normal file
3
packages/next/test/fixtures/00-app-dir-edge-404/app/not-found/not-found.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function notFound() {
|
||||
return <h1>custom not found</h1>
|
||||
}
|
||||
3
packages/next/test/fixtures/00-app-dir-edge-404/app/not-found/page.js
vendored
Normal file
3
packages/next/test/fixtures/00-app-dir-edge-404/app/not-found/page.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function Page() {
|
||||
return <h1>I'm still a valid page</h1>
|
||||
}
|
||||
3
packages/next/test/fixtures/00-app-dir-edge-404/app/page.js
vendored
Normal file
3
packages/next/test/fixtures/00-app-dir-edge-404/app/page.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function Page() {
|
||||
return <h1>My page</h1>
|
||||
}
|
||||
12
packages/next/test/fixtures/00-app-dir-edge-404/index.test.js
vendored
Normal file
12
packages/next/test/fixtures/00-app-dir-edge-404/index.test.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/* eslint-env jest */
|
||||
const path = require('path');
|
||||
const { deployAndTest } = require('../../utils');
|
||||
|
||||
const ctx = {};
|
||||
|
||||
describe(`${__dirname.split(path.sep).pop()}`, () => {
|
||||
it('should deploy and pass probe checks', async () => {
|
||||
const info = await deployAndTest(__dirname);
|
||||
Object.assign(ctx, info);
|
||||
});
|
||||
});
|
||||
5
packages/next/test/fixtures/00-app-dir-edge-404/next.config.js
vendored
Normal file
5
packages/next/test/fixtures/00-app-dir-edge-404/next.config.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
experimental: {
|
||||
appDir: true,
|
||||
},
|
||||
};
|
||||
8
packages/next/test/fixtures/00-app-dir-edge-404/package.json
vendored
Normal file
8
packages/next/test/fixtures/00-app-dir-edge-404/package.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"next": "canary",
|
||||
"react": "experimental",
|
||||
"react-dom": "experimental"
|
||||
},
|
||||
"ignoreNextjsUpdates": true
|
||||
}
|
||||
20
packages/next/test/fixtures/00-app-dir-edge-404/vercel.json
vendored
Normal file
20
packages/next/test/fixtures/00-app-dir-edge-404/vercel.json
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"builds": [
|
||||
{
|
||||
"src": "package.json",
|
||||
"use": "@vercel/next"
|
||||
}
|
||||
],
|
||||
"probes": [
|
||||
{
|
||||
"path": "/",
|
||||
"status": 200,
|
||||
"mustContain": "My page"
|
||||
},
|
||||
{
|
||||
"path": "/not-found-page",
|
||||
"status": 404,
|
||||
"mustContain": "This Is The Not Found Page"
|
||||
}
|
||||
]
|
||||
}
|
||||
3
packages/next/test/fixtures/00-app-dir-i18n/app/api/hello-app/route.js
vendored
Normal file
3
packages/next/test/fixtures/00-app-dir-i18n/app/api/hello-app/route.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export function GET(req) {
|
||||
return new Response('hello world')
|
||||
}
|
||||
16
packages/next/test/fixtures/00-app-dir-i18n/app/dynamic/[slug]/page.js
vendored
Normal file
16
packages/next/test/fixtures/00-app-dir-i18n/app/dynamic/[slug]/page.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
export default function Page({ params: { slug } }) {
|
||||
return (
|
||||
<p>dynamic page {slug}</p>
|
||||
)
|
||||
}
|
||||
|
||||
export function generateStaticParams() {
|
||||
return [
|
||||
{
|
||||
slug: 'first',
|
||||
},
|
||||
{
|
||||
slug: 'second'
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,7 +3,7 @@ module.exports = {
|
||||
appDir: true,
|
||||
},
|
||||
i18n: {
|
||||
locales: ['en'],
|
||||
locales: ['en', 'fr', 'de'],
|
||||
defaultLocale: 'en',
|
||||
},
|
||||
};
|
||||
|
||||
5
packages/next/test/fixtures/00-app-dir-i18n/pages/another.js
vendored
Normal file
5
packages/next/test/fixtures/00-app-dir-i18n/pages/another.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export default function Page() {
|
||||
return <>
|
||||
<p>pages/another.js</p>
|
||||
</>
|
||||
}
|
||||
3
packages/next/test/fixtures/00-app-dir-i18n/pages/api/hello.js
vendored
Normal file
3
packages/next/test/fixtures/00-app-dir-i18n/pages/api/hello.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function handler(req, res) {
|
||||
res.end('hello world')
|
||||
}
|
||||
18
packages/next/test/fixtures/00-app-dir-i18n/pages/blog/[slug].js
vendored
Normal file
18
packages/next/test/fixtures/00-app-dir-i18n/pages/blog/[slug].js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
export default function Page() {
|
||||
return <p>dynamic pages page</p>;
|
||||
}
|
||||
|
||||
export function getStaticProps() {
|
||||
return {
|
||||
props: {
|
||||
now: Date.now(),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function getStaticPaths() {
|
||||
return {
|
||||
paths: [{ params: { slug: "first" } }, { params: { slug: "second" } }],
|
||||
fallback: "blocking",
|
||||
};
|
||||
}
|
||||
@@ -35,6 +35,42 @@
|
||||
"path": "/en/other",
|
||||
"status": 200,
|
||||
"mustContain": "My Other Page"
|
||||
},
|
||||
{
|
||||
"fetchOptions": { "redirect": "manual" },
|
||||
"path": "/dynamic/first",
|
||||
"status": 200,
|
||||
"mustContain": "dynamic page"
|
||||
},
|
||||
{
|
||||
"fetchOptions": { "redirect": "manual" },
|
||||
"path": "/dynamic/third",
|
||||
"status": 200,
|
||||
"mustContain": "dynamic page"
|
||||
},
|
||||
{
|
||||
"fetchOptions": { "redirect": "manual" },
|
||||
"path": "/another",
|
||||
"status": 200,
|
||||
"mustContain": "pages/another"
|
||||
},
|
||||
{
|
||||
"fetchOptions": { "redirect": "manual" },
|
||||
"path": "/fr/another",
|
||||
"status": 200,
|
||||
"mustContain": "pages/another"
|
||||
},
|
||||
{
|
||||
"fetchOptions": { "redirect": "manual" },
|
||||
"path": "/api/hello",
|
||||
"status": 200,
|
||||
"mustContain": "hello world"
|
||||
},
|
||||
{
|
||||
"fetchOptions": { "redirect": "manual" },
|
||||
"path": "/api/hello-app",
|
||||
"status": 200,
|
||||
"mustContain": "hello world"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
6
packages/next/test/fixtures/00-app-dir-segment-options/app/api/hello-again/route.js
vendored
Normal file
6
packages/next/test/fixtures/00-app-dir-segment-options/app/api/hello-again/route.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export const GET = req => {
|
||||
console.log(req.url);
|
||||
return new Response('hello world');
|
||||
};
|
||||
|
||||
export const maxDuration = 7;
|
||||
12
packages/next/test/fixtures/00-app-dir-segment-options/index.test.js
vendored
Normal file
12
packages/next/test/fixtures/00-app-dir-segment-options/index.test.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/* eslint-env jest */
|
||||
const path = require('path');
|
||||
const { deployAndTest } = require('../../utils');
|
||||
|
||||
const ctx = {};
|
||||
|
||||
describe(`${__dirname.split(path.sep).pop()}`, () => {
|
||||
it('should deploy and pass probe checks', async () => {
|
||||
const info = await deployAndTest(__dirname);
|
||||
Object.assign(ctx, info);
|
||||
});
|
||||
});
|
||||
1
packages/next/test/fixtures/00-app-dir-segment-options/next.config.js
vendored
Normal file
1
packages/next/test/fixtures/00-app-dir-segment-options/next.config.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = {};
|
||||
8
packages/next/test/fixtures/00-app-dir-segment-options/package.json
vendored
Normal file
8
packages/next/test/fixtures/00-app-dir-segment-options/package.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"next": "canary",
|
||||
"react": "experimental",
|
||||
"react-dom": "experimental"
|
||||
},
|
||||
"ignoreNextjsUpdates": true
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user