mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 12:57:46 +00:00
Compare commits
27 Commits
update/cli
...
@vercel/py
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2de365f9cf | ||
|
|
fb6fe46158 | ||
|
|
bfebfc28e1 | ||
|
|
9e183b2e8d | ||
|
|
0490a7733b | ||
|
|
65a6e713c8 | ||
|
|
fda76691d1 | ||
|
|
007e48c1cd | ||
|
|
954536e681 | ||
|
|
c52220ab72 | ||
|
|
545f82603f | ||
|
|
032df14c79 | ||
|
|
604f3b8d83 | ||
|
|
c0380cac5a | ||
|
|
7082da8451 | ||
|
|
20a7b2f2d4 | ||
|
|
a5c3cbcd45 | ||
|
|
6dded87426 | ||
|
|
a63b9d960b | ||
|
|
3cefbb19fe | ||
|
|
f43894ef4e | ||
|
|
2081f10b22 | ||
|
|
b52df7a533 | ||
|
|
ec89436417 | ||
|
|
993a404311 | ||
|
|
3e7bcb2073 | ||
|
|
ed119d6a33 |
@@ -26,12 +26,6 @@ packages/hydrogen/edge-entry.js
|
||||
packages/next/test/integration/middleware
|
||||
packages/next/test/integration/middleware-eval
|
||||
|
||||
# node-bridge
|
||||
packages/node-bridge/bridge.js
|
||||
packages/node-bridge/launcher.js
|
||||
packages/node-bridge/helpers.js
|
||||
packages/node-bridge/source-map-support.js
|
||||
|
||||
# middleware
|
||||
packages/middleware/src/entries.js
|
||||
|
||||
|
||||
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -4,7 +4,6 @@
|
||||
* @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood
|
||||
/.github/workflows @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
|
||||
/packages/fs-detectors @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @agadzik @chloetedder
|
||||
/packages/node-bridge @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
|
||||
/packages/next @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
|
||||
/packages/routing-utils @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
|
||||
/packages/edge @vercel/edge-compute
|
||||
@@ -14,3 +13,4 @@
|
||||
/examples/hugo @styfle
|
||||
/examples/jekyll @styfle
|
||||
/examples/zola @styfle
|
||||
/packages/node @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @Kikobeats
|
||||
|
||||
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
@@ -46,8 +46,8 @@ jobs:
|
||||
node-version: 16
|
||||
- name: install npm@9
|
||||
run: npm i -g npm@9
|
||||
- name: install pnpm@7.31.0
|
||||
run: npm i -g pnpm@7.31.0
|
||||
- name: install pnpm@8.3.1
|
||||
run: npm i -g pnpm@8.3.1
|
||||
- name: Install
|
||||
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
|
||||
run: pnpm install
|
||||
|
||||
4
.github/workflows/test-lint.yml
vendored
4
.github/workflows/test-lint.yml
vendored
@@ -28,8 +28,8 @@ jobs:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: install pnpm@7.31.0
|
||||
run: npm i -g pnpm@7.31.0
|
||||
- name: install pnpm@8.3.1
|
||||
run: npm i -g pnpm@8.3.1
|
||||
- run: pnpm install
|
||||
- run: pnpm run lint
|
||||
- run: pnpm run prettier-check
|
||||
|
||||
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
@@ -32,8 +32,8 @@ jobs:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: install pnpm@7.31.0
|
||||
run: npm i -g pnpm@7.31.0
|
||||
- name: install pnpm@8.3.1
|
||||
run: npm i -g pnpm@8.3.1
|
||||
- run: pnpm install
|
||||
- id: set-tests
|
||||
run: |
|
||||
@@ -71,8 +71,8 @@ jobs:
|
||||
if: matrix.runner == 'macos-latest'
|
||||
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/cli/test/dev/fixtures/08-hugo/
|
||||
|
||||
- name: install pnpm@7.31.0
|
||||
run: npm i -g pnpm@7.31.0
|
||||
- name: install pnpm@8.3.1
|
||||
run: npm i -g pnpm@8.3.1
|
||||
|
||||
- run: pnpm install
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
"devDependencies": {
|
||||
"@types/node": "16.18.11",
|
||||
"@types/node-fetch": "2.5.4",
|
||||
"@vercel/node": "*",
|
||||
"typescript": "4.3.4"
|
||||
"@vercel/node": "*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export function sendToAnalytics(metric, options) {
|
||||
};
|
||||
|
||||
if (options.debug) {
|
||||
console.log("[Analytics]", metric.name, JSON.stringify(body, null, 2));
|
||||
console.log("[Web Vitals]", metric.name, JSON.stringify(body, null, 2));
|
||||
}
|
||||
|
||||
const blob = new Blob([new URLSearchParams(body).toString()], {
|
||||
@@ -61,6 +61,6 @@ export function webVitals(options) {
|
||||
onCLS((metric) => sendToAnalytics(metric, options));
|
||||
onFCP((metric) => sendToAnalytics(metric, options));
|
||||
} catch (err) {
|
||||
console.error("[Analytics]", err);
|
||||
console.error("[Web Vitals]", err);
|
||||
}
|
||||
}
|
||||
|
||||
245
examples/nextjs/package-lock.json
generated
245
examples/nextjs/package-lock.json
generated
@@ -8,9 +8,9 @@
|
||||
"name": "nextjs",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"eslint": "8.37.0",
|
||||
"eslint-config-next": "13.3.0",
|
||||
"next": "13.3.0",
|
||||
"eslint": "8.39.0",
|
||||
"eslint-config-next": "13.3.1",
|
||||
"next": "13.3.1",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
@@ -71,9 +71,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/js": {
|
||||
"version": "8.37.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.37.0.tgz",
|
||||
"integrity": "sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A==",
|
||||
"version": "8.39.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.39.0.tgz",
|
||||
"integrity": "sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng==",
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
@@ -109,22 +109,22 @@
|
||||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
|
||||
},
|
||||
"node_modules/@next/env": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.3.0.tgz",
|
||||
"integrity": "sha512-AjppRV4uG3No7L1plinoTQETH+j2F10TEnrMfzbTUYwze5sBUPveeeBAPZPm8OkJZ1epq9OyYKhZrvbD6/9HCQ=="
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.3.1.tgz",
|
||||
"integrity": "sha512-EDtCoedIZC7JlUQ3uaQpSc4aVmyhbLHmQVALg7pFfQgOTjgSnn7mKtA0DiCMkYvvsx6aFb5octGMtWrOtGXW9A=="
|
||||
},
|
||||
"node_modules/@next/eslint-plugin-next": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.3.0.tgz",
|
||||
"integrity": "sha512-wuGN5qSEjSgcq9fVkH0Y/qIPFjnZtW3ZPwfjJOn7l/rrf6y8J24h/lo61kwqunTyzZJm/ETGfGVU9PUs8cnzEA==",
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.3.1.tgz",
|
||||
"integrity": "sha512-Hpd74UrYGF+bq9bBSRDXRsRfaWkPpcwjhvachy3sr/R/5fY6feC0T0s047pUthyqcaeNsqKOY1nUGQQJNm4WyA==",
|
||||
"dependencies": {
|
||||
"glob": "7.1.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-darwin-arm64": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.3.0.tgz",
|
||||
"integrity": "sha512-DmIQCNq6JtccLPPBzf0dgh2vzMWt5wjxbP71pCi5EWpWYE3MsP6FcRXi4MlAmFNDQOfcFXR2r7kBeG1LpZUh1w==",
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.3.1.tgz",
|
||||
"integrity": "sha512-UXPtriEc/pBP8luSLSCZBcbzPeVv+SSjs9cH/KygTbhmACye8/OOXRZO13Z2Wq1G0gLmEAIHQAOuF+vafPd2lw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -137,9 +137,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-darwin-x64": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.3.0.tgz",
|
||||
"integrity": "sha512-oQoqFa88OGgwnYlnAGHVct618FRI/749se0N3S8t9Bzdv5CRbscnO0RcX901+YnNK4Q6yeiizfgO3b7kogtsZg==",
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.3.1.tgz",
|
||||
"integrity": "sha512-lT36yYxosCfLtplFzJWgo0hrPu6/do8+msgM7oQkPeohDNdhjtjFUgOOwdSnPublLR6Mo2Ym4P/wl5OANuD2bw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -152,9 +152,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm64-gnu": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.3.0.tgz",
|
||||
"integrity": "sha512-Wzz2p/WqAJUqTVoLo6H18WMeAXo3i+9DkPDae4oQG8LMloJ3if4NEZTnOnTUlro6cq+S/W4pTGa97nWTrOjbGw==",
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.3.1.tgz",
|
||||
"integrity": "sha512-wRb76nLWJhonH8s3kxC/1tFguEkeOPayIwe9mkaz1G/yeS3OrjeyKMJsb4+Kdg0zbTo53bNCOl59NNtDM7yyyw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -167,9 +167,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm64-musl": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.3.0.tgz",
|
||||
"integrity": "sha512-xPVrIQOQo9WXJYgmoTlMnAD/HlR/1e1ZIWGbwIzEirXBVBqMARUulBEIKdC19zuvoJ477qZJgBDCKtKEykCpyQ==",
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.3.1.tgz",
|
||||
"integrity": "sha512-qz3BzjJRZ16Iq/jrp+pjiYOc0jTjHlfmxQmZk9x/+5uhRP6/eWQSTAPVJ33BMo6oK5O5N4644OgTAbzXzorecg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -182,9 +182,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-x64-gnu": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.3.0.tgz",
|
||||
"integrity": "sha512-jOFlpGuPD7W2tuXVJP4wt9a3cpNxWAPcloq5EfMJRiXsBBOjLVFZA7boXYxEBzSVgUiVVr1V9T0HFM7pULJ1qA==",
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.3.1.tgz",
|
||||
"integrity": "sha512-6mgkLmwlyWlomQmpl21I3hxgqE5INoW4owTlcLpNsd1V4wP+J46BlI/5zV5KWWbzjfncIqzXoeGs5Eg+1GHODA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -197,9 +197,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-x64-musl": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.3.0.tgz",
|
||||
"integrity": "sha512-2OwKlzaBgmuet9XYHc3KwsEilzb04F540rlRXkAcjMHL7eCxB7uZIGtsVvKOnQLvC/elrUegwSw1+5f7WmfyOw==",
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.3.1.tgz",
|
||||
"integrity": "sha512-uqm5sielhQmKJM+qayIhgZv1KlS5pqTdQ99b+Z7hMWryXS96qE0DftTmMZowBcUL6x7s2vSXyH5wPtO1ON7LBg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -212,9 +212,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-arm64-msvc": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.3.0.tgz",
|
||||
"integrity": "sha512-OeHiA6YEvndxT46g+rzFK/MQTfftKxJmzslERMu9LDdC6Kez0bdrgEYed5eXFK2Z1viKZJCGRlhd06rBusyztA==",
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.3.1.tgz",
|
||||
"integrity": "sha512-WomIiTj/v3LevltlibNQKmvrOymNRYL+a0dp5R73IwPWN5FvXWwSELN/kiNALig/+T3luc4qHNTyvMCp9L6U5Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -227,9 +227,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-ia32-msvc": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.3.0.tgz",
|
||||
"integrity": "sha512-4aB7K9mcVK1lYEzpOpqWrXHEZympU3oK65fnNcY1Qc4HLJFLJj8AViuqQd4jjjPNuV4sl8jAwTz3gN5VNGWB7w==",
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.3.1.tgz",
|
||||
"integrity": "sha512-M+PoH+0+q658wRUbs285RIaSTYnGBSTdweH/0CdzDgA6Q4rBM0sQs4DHmO3BPP0ltCO/vViIoyG7ks66XmCA5g==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -242,9 +242,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-x64-msvc": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.3.0.tgz",
|
||||
"integrity": "sha512-Reer6rkLLcoOvB0dd66+Y7WrWVFH7sEEkF/4bJCIfsSKnTStTYaHtwIJAwbqnt9I392Tqvku0KkoqZOryWV9LQ==",
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.3.1.tgz",
|
||||
"integrity": "sha512-Sl1F4Vp5Z1rNXWZYqJwMuWRRol4bqOB6+/d7KqkgQ4AcafKPN1PZmpkCoxv4UFHtFNIB7EotnuIhtXu3zScicQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -313,9 +313,9 @@
|
||||
"integrity": "sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg=="
|
||||
},
|
||||
"node_modules/@swc/helpers": {
|
||||
"version": "0.4.14",
|
||||
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz",
|
||||
"integrity": "sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==",
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.0.tgz",
|
||||
"integrity": "sha512-SjY/p4MmECVVEWspzSRpQEM3sjR17sP8PbGxELWrT+YZMBfiUyt1MRUNjMV23zohwlG2HYtCQOsCwsTHguXkyg==",
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
@@ -326,13 +326,13 @@
|
||||
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ=="
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "5.57.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.57.1.tgz",
|
||||
"integrity": "sha512-hlA0BLeVSA/wBPKdPGxoVr9Pp6GutGoY380FEhbVi0Ph4WNe8kLvqIRx76RSQt1lynZKfrXKs0/XeEk4zZycuA==",
|
||||
"version": "5.59.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.0.tgz",
|
||||
"integrity": "sha512-qK9TZ70eJtjojSUMrrEwA9ZDQ4N0e/AuoOIgXuNBorXYcBDk397D2r5MIe1B3cok/oCtdNC5j+lUUpVB+Dpb+w==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "5.57.1",
|
||||
"@typescript-eslint/types": "5.57.1",
|
||||
"@typescript-eslint/typescript-estree": "5.57.1",
|
||||
"@typescript-eslint/scope-manager": "5.59.0",
|
||||
"@typescript-eslint/types": "5.59.0",
|
||||
"@typescript-eslint/typescript-estree": "5.59.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -352,12 +352,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "5.57.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.57.1.tgz",
|
||||
"integrity": "sha512-N/RrBwEUKMIYxSKl0oDK5sFVHd6VI7p9K5MyUlVYAY6dyNb/wHUqndkTd3XhpGlXgnQsBkRZuu4f9kAHghvgPw==",
|
||||
"version": "5.59.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.0.tgz",
|
||||
"integrity": "sha512-tsoldKaMh7izN6BvkK6zRMINj4Z2d6gGhO2UsI8zGZY3XhLq1DndP3Ycjhi1JwdwPRwtLMW4EFPgpuKhbCGOvQ==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.57.1",
|
||||
"@typescript-eslint/visitor-keys": "5.57.1"
|
||||
"@typescript-eslint/types": "5.59.0",
|
||||
"@typescript-eslint/visitor-keys": "5.59.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
@@ -368,9 +368,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "5.57.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.57.1.tgz",
|
||||
"integrity": "sha512-bSs4LOgyV3bJ08F5RDqO2KXqg3WAdwHCu06zOqcQ6vqbTJizyBhuh1o1ImC69X4bV2g1OJxbH71PJqiO7Y1RuA==",
|
||||
"version": "5.59.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.0.tgz",
|
||||
"integrity": "sha512-yR2h1NotF23xFFYKHZs17QJnB51J/s+ud4PYU4MqdZbzeNxpgUr05+dNeCN/bb6raslHvGdd6BFCkVhpPk/ZeA==",
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
@@ -380,12 +380,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "5.57.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.1.tgz",
|
||||
"integrity": "sha512-A2MZqD8gNT0qHKbk2wRspg7cHbCDCk2tcqt6ScCFLr5Ru8cn+TCfM786DjPhqwseiS+PrYwcXht5ztpEQ6TFTw==",
|
||||
"version": "5.59.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.0.tgz",
|
||||
"integrity": "sha512-sUNnktjmI8DyGzPdZ8dRwW741zopGxltGs/SAPgGL/AAgDpiLsCFLcMNSpbfXfmnNeHmK9h3wGmCkGRGAoUZAg==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.57.1",
|
||||
"@typescript-eslint/visitor-keys": "5.57.1",
|
||||
"@typescript-eslint/types": "5.59.0",
|
||||
"@typescript-eslint/visitor-keys": "5.59.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
@@ -406,11 +406,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "5.57.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.1.tgz",
|
||||
"integrity": "sha512-RjQrAniDU0CEk5r7iphkm731zKlFiUjvcBS2yHAg8WWqFMCaCrD0rKEVOMUyMMcbGPZ0bPp56srkGWrgfZqLRA==",
|
||||
"version": "5.59.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.0.tgz",
|
||||
"integrity": "sha512-qZ3iXxQhanchCeaExlKPV3gDQFxMUmU35xfd5eCXB6+kUw1TUAbIy2n7QIrwz9s98DQLzNWyHp61fY0da4ZcbA==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.57.1",
|
||||
"@typescript-eslint/types": "5.59.0",
|
||||
"eslint-visitor-keys": "^3.3.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -591,9 +591,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/axe-core": {
|
||||
"version": "4.6.3",
|
||||
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.6.3.tgz",
|
||||
"integrity": "sha512-/BQzOX780JhsxDnPpH4ZiyrJAzcd8AfzFPkv+89veFSr1rcMjuq2JDCwypKaPeB6ljHp9KjXhPpjgCvQlWYuqg==",
|
||||
"version": "4.7.0",
|
||||
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.0.tgz",
|
||||
"integrity": "sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
@@ -663,9 +663,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001474",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001474.tgz",
|
||||
"integrity": "sha512-iaIZ8gVrWfemh5DG3T9/YqarVZoYf0r188IjaGwx68j4Pf0SGY6CQkmJUIE+NZHkkecQGohzXmBGEwWDr9aM3Q==",
|
||||
"version": "1.0.30001481",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001481.tgz",
|
||||
"integrity": "sha512-KCqHwRnaa1InZBtqXzP98LPg0ajCVujMKjqKDhZEthIpAsJl/YEIa3YvXjGXPVqzZVguccuu7ga9KOE1J9rKPQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@@ -839,9 +839,9 @@
|
||||
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="
|
||||
},
|
||||
"node_modules/enhanced-resolve": {
|
||||
"version": "5.12.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz",
|
||||
"integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==",
|
||||
"version": "5.13.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz",
|
||||
"integrity": "sha512-eyV8f0y1+bzyfh8xAwW/WTSZpLbjhqc4ne9eGSH4Zo2ejdyiNG9pU6mf9DG8a7+Auk6MFTlNOT4Y2y/9k8GKVg==",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.4",
|
||||
"tapable": "^2.2.0"
|
||||
@@ -965,14 +965,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "8.37.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.37.0.tgz",
|
||||
"integrity": "sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw==",
|
||||
"version": "8.39.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.39.0.tgz",
|
||||
"integrity": "sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og==",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.2.0",
|
||||
"@eslint-community/regexpp": "^4.4.0",
|
||||
"@eslint/eslintrc": "^2.0.2",
|
||||
"@eslint/js": "8.37.0",
|
||||
"@eslint/js": "8.39.0",
|
||||
"@humanwhocodes/config-array": "^0.11.8",
|
||||
"@humanwhocodes/module-importer": "^1.0.1",
|
||||
"@nodelib/fs.walk": "^1.2.8",
|
||||
@@ -982,7 +982,7 @@
|
||||
"debug": "^4.3.2",
|
||||
"doctrine": "^3.0.0",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"eslint-scope": "^7.1.1",
|
||||
"eslint-scope": "^7.2.0",
|
||||
"eslint-visitor-keys": "^3.4.0",
|
||||
"espree": "^9.5.1",
|
||||
"esquery": "^1.4.2",
|
||||
@@ -1021,11 +1021,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-config-next": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.3.0.tgz",
|
||||
"integrity": "sha512-6YEwmFBX0VjBd3ODGW9df0Is0FLaRFdMN8eAahQG9CN6LjQ28J8AFr19ngxqMSg7Qv6Uca/3VeeBosJh1bzu0w==",
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.3.1.tgz",
|
||||
"integrity": "sha512-DieA5djybeE3Q0IqnDXihmhgRSp44x1ywWBBpVRA9pSx+m5Icj8hFclx7ffXlAvb9MMLN6cgj/hqJ4lka/QmvA==",
|
||||
"dependencies": {
|
||||
"@next/eslint-plugin-next": "13.3.0",
|
||||
"@next/eslint-plugin-next": "13.3.1",
|
||||
"@rushstack/eslint-patch": "^1.1.3",
|
||||
"@typescript-eslint/parser": "^5.42.0",
|
||||
"eslint-import-resolver-node": "^0.3.6",
|
||||
@@ -1089,9 +1089,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-import-resolver-typescript/node_modules/globby": {
|
||||
"version": "13.1.3",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-13.1.3.tgz",
|
||||
"integrity": "sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==",
|
||||
"version": "13.1.4",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-13.1.4.tgz",
|
||||
"integrity": "sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==",
|
||||
"dependencies": {
|
||||
"dir-glob": "^3.0.1",
|
||||
"fast-glob": "^3.2.11",
|
||||
@@ -1118,9 +1118,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-module-utils": {
|
||||
"version": "2.7.4",
|
||||
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz",
|
||||
"integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==",
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz",
|
||||
"integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==",
|
||||
"dependencies": {
|
||||
"debug": "^3.2.7"
|
||||
},
|
||||
@@ -1308,15 +1308,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-scope": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz",
|
||||
"integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==",
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz",
|
||||
"integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==",
|
||||
"dependencies": {
|
||||
"esrecurse": "^4.3.0",
|
||||
"estraverse": "^5.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-visitor-keys": {
|
||||
@@ -1872,9 +1875,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/is-core-module": {
|
||||
"version": "2.11.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz",
|
||||
"integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==",
|
||||
"version": "2.12.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz",
|
||||
"integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==",
|
||||
"dependencies": {
|
||||
"has": "^1.0.3"
|
||||
},
|
||||
@@ -2301,12 +2304,12 @@
|
||||
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="
|
||||
},
|
||||
"node_modules/next": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.3.0.tgz",
|
||||
"integrity": "sha512-OVTw8MpIPa12+DCUkPqRGPS3thlJPcwae2ZL4xti3iBff27goH024xy4q2lhlsdoYiKOi8Kz6uJoLW/GXwgfOA==",
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.3.1.tgz",
|
||||
"integrity": "sha512-eByWRxPzKHs2oQz1yE41LX35umhz86ZSZ+mYyXBqn2IBi2hyUqxBA88avywdr4uyH+hCJczegGsDGWbzQA5Rqw==",
|
||||
"dependencies": {
|
||||
"@next/env": "13.3.0",
|
||||
"@swc/helpers": "0.4.14",
|
||||
"@next/env": "13.3.1",
|
||||
"@swc/helpers": "0.5.0",
|
||||
"busboy": "1.6.0",
|
||||
"caniuse-lite": "^1.0.30001406",
|
||||
"postcss": "8.4.14",
|
||||
@@ -2316,18 +2319,18 @@
|
||||
"next": "dist/bin/next"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.6.0"
|
||||
"node": ">=14.18.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@next/swc-darwin-arm64": "13.3.0",
|
||||
"@next/swc-darwin-x64": "13.3.0",
|
||||
"@next/swc-linux-arm64-gnu": "13.3.0",
|
||||
"@next/swc-linux-arm64-musl": "13.3.0",
|
||||
"@next/swc-linux-x64-gnu": "13.3.0",
|
||||
"@next/swc-linux-x64-musl": "13.3.0",
|
||||
"@next/swc-win32-arm64-msvc": "13.3.0",
|
||||
"@next/swc-win32-ia32-msvc": "13.3.0",
|
||||
"@next/swc-win32-x64-msvc": "13.3.0"
|
||||
"@next/swc-darwin-arm64": "13.3.1",
|
||||
"@next/swc-darwin-x64": "13.3.1",
|
||||
"@next/swc-linux-arm64-gnu": "13.3.1",
|
||||
"@next/swc-linux-arm64-musl": "13.3.1",
|
||||
"@next/swc-linux-x64-gnu": "13.3.1",
|
||||
"@next/swc-linux-x64-musl": "13.3.1",
|
||||
"@next/swc-win32-arm64-msvc": "13.3.1",
|
||||
"@next/swc-win32-ia32-msvc": "13.3.1",
|
||||
"@next/swc-win32-x64-msvc": "13.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@opentelemetry/api": "^1.1.0",
|
||||
@@ -2699,13 +2702,13 @@
|
||||
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
|
||||
},
|
||||
"node_modules/regexp.prototype.flags": {
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz",
|
||||
"integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==",
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz",
|
||||
"integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"define-properties": "^1.1.3",
|
||||
"functions-have-names": "^1.2.2"
|
||||
"define-properties": "^1.2.0",
|
||||
"functions-have-names": "^1.2.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -2805,9 +2808,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.3.8",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
|
||||
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
|
||||
"version": "7.5.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz",
|
||||
"integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
@@ -3138,9 +3141,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz",
|
||||
"integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==",
|
||||
"version": "5.0.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz",
|
||||
"integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint": "8.37.0",
|
||||
"eslint-config-next": "13.3.0",
|
||||
"next": "13.3.0",
|
||||
"eslint": "8.39.0",
|
||||
"eslint-config-next": "13.3.1",
|
||||
"next": "13.3.1",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export default function Home() {
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</Head>
|
||||
<main className={styles.main}>
|
||||
<main className={`${styles.main} ${inter.className}`}>
|
||||
<div className={styles.description}>
|
||||
<p>
|
||||
Get started by editing
|
||||
@@ -57,10 +57,10 @@ export default function Home() {
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={inter.className}>
|
||||
<h2>
|
||||
Docs <span>-></span>
|
||||
</h2>
|
||||
<p className={inter.className}>
|
||||
<p>
|
||||
Find in-depth information about Next.js features and API.
|
||||
</p>
|
||||
</a>
|
||||
@@ -71,10 +71,10 @@ export default function Home() {
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={inter.className}>
|
||||
<h2>
|
||||
Learn <span>-></span>
|
||||
</h2>
|
||||
<p className={inter.className}>
|
||||
<p>
|
||||
Learn about Next.js in an interactive course with quizzes!
|
||||
</p>
|
||||
</a>
|
||||
@@ -85,10 +85,10 @@ export default function Home() {
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={inter.className}>
|
||||
<h2>
|
||||
Templates <span>-></span>
|
||||
</h2>
|
||||
<p className={inter.className}>
|
||||
<p>
|
||||
Discover and deploy boilerplate example Next.js projects.
|
||||
</p>
|
||||
</a>
|
||||
@@ -99,10 +99,10 @@ export default function Home() {
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={inter.className}>
|
||||
<h2>
|
||||
Deploy <span>-></span>
|
||||
</h2>
|
||||
<p className={inter.className}>
|
||||
<p>
|
||||
Instantly deploy your Next.js site to a shareable URL
|
||||
with Vercel.
|
||||
</p>
|
||||
|
||||
@@ -32,7 +32,7 @@ function sendToAnalytics(metric, options) {
|
||||
};
|
||||
|
||||
if (options.debug) {
|
||||
console.log('[Analytics]', metric.name, JSON.stringify(body, null, 2));
|
||||
console.log('[Web Vitals]', metric.name, JSON.stringify(body, null, 2));
|
||||
}
|
||||
|
||||
const blob = new Blob([new URLSearchParams(body).toString()], {
|
||||
@@ -61,6 +61,6 @@ export function webVitals(options) {
|
||||
getCLS((metric) => sendToAnalytics(metric, options));
|
||||
getFCP((metric) => sendToAnalytics(metric, options));
|
||||
} catch (err) {
|
||||
console.error('[Analytics]', err);
|
||||
console.error('[Web Vitals]', err);
|
||||
}
|
||||
}
|
||||
|
||||
18
internals/constants/package.json
Normal file
18
internals/constants/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/constants",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.3.2",
|
||||
"@vercel/routing-utils": "2.1.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel-internals/tsconfig": "*",
|
||||
"@vercel/style-guide": "4.0.2",
|
||||
"typescript": "4.9.4"
|
||||
}
|
||||
}
|
||||
5
internals/constants/src/index.ts
Normal file
5
internals/constants/src/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const PROJECT_ENV_TARGET = [
|
||||
'production',
|
||||
'preview',
|
||||
'development',
|
||||
] as const;
|
||||
7
internals/constants/tsconfig.json
Normal file
7
internals/constants/tsconfig.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "@vercel-internals/tsconfig",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist"
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
import type { BuilderFunctions } from '@vercel/build-utils';
|
||||
import type { Readable, Writable } from 'stream';
|
||||
import type { Route } from '@vercel/routing-utils';
|
||||
import { PROJECT_ENV_TARGET } from '@vercel-internals/constants';
|
||||
|
||||
export type ProjectEnvTarget = typeof PROJECT_ENV_TARGET[number];
|
||||
export type ProjectEnvType = 'plain' | 'secret' | 'encrypted' | 'system';
|
||||
|
||||
export type ProjectSettings = import('@vercel/build-utils').ProjectSettings;
|
||||
|
||||
@@ -300,20 +304,6 @@ export interface Secret {
|
||||
createdAt: number;
|
||||
}
|
||||
|
||||
// TODO (Ethan-Arrowood) - Replace enums
|
||||
export enum ProjectEnvTarget {
|
||||
Production = 'production',
|
||||
Preview = 'preview',
|
||||
Development = 'development',
|
||||
}
|
||||
|
||||
export enum ProjectEnvType {
|
||||
Plaintext = 'plain',
|
||||
Secret = 'secret',
|
||||
Encrypted = 'encrypted',
|
||||
System = 'system',
|
||||
}
|
||||
|
||||
export interface ProjectEnvVariable {
|
||||
id: string;
|
||||
key: string;
|
||||
@@ -428,7 +418,7 @@ export interface GitMetadata {
|
||||
commitRef?: string | undefined;
|
||||
commitSha?: string | undefined;
|
||||
dirty?: boolean | undefined;
|
||||
remoteUrl: string;
|
||||
remoteUrl?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1,15 +1,11 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/types",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json"
|
||||
},
|
||||
"types": "index.d.ts",
|
||||
"main": "index.d.ts",
|
||||
"dependencies": {
|
||||
"@types/node": "14.14.31",
|
||||
"@vercel-internals/constants": "*",
|
||||
"@vercel/build-utils": "6.3.2",
|
||||
"@vercel/routing-utils": "2.1.10"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"extends": "@vercel-internals/tsconfig",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist"
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["index.ts"]
|
||||
"include": ["index.d.ts"]
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"license": "Apache-2.0",
|
||||
"packageManager": "pnpm@7.31.0",
|
||||
"packageManager": "pnpm@8.3.1",
|
||||
"dependencies": {
|
||||
"lerna": "5.6.2"
|
||||
},
|
||||
@@ -32,14 +32,14 @@
|
||||
"source-map-support": "0.5.12",
|
||||
"ts-eager": "2.0.2",
|
||||
"ts-jest": "29.1.0",
|
||||
"turbo": "1.8.5"
|
||||
"typescript": "4.9.5",
|
||||
"turbo": "1.9.3"
|
||||
},
|
||||
"scripts": {
|
||||
"lerna": "lerna",
|
||||
"version": "pnpm install && git add pnpm-lock.yaml",
|
||||
"bootstrap": "lerna bootstrap",
|
||||
"publish-stable": "echo 'Run `pnpm changelog` for instructions'",
|
||||
"publish-canary": "git checkout main && git pull && lerna version prerelease --preid canary --message \"Publish Canary\" --exact",
|
||||
"publish-from-github": "./utils/publish.sh",
|
||||
"changelog": "node utils/changelog.js",
|
||||
"build": "node utils/gen.js && turbo --no-update-notifier run build",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "6.7.1",
|
||||
"version": "6.7.2",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
@@ -32,6 +32,7 @@
|
||||
"@types/node-fetch": "^2.1.6",
|
||||
"@types/semver": "6.0.0",
|
||||
"@types/yazl": "2.4.2",
|
||||
"@vercel/error-utils": "1.0.10",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"aggregate-error": "3.0.1",
|
||||
"async-retry": "1.2.3",
|
||||
@@ -48,7 +49,7 @@
|
||||
"multistream": "2.1.1",
|
||||
"node-fetch": "2.6.7",
|
||||
"semver": "6.1.1",
|
||||
"typescript": "4.3.4",
|
||||
"typescript": "4.9.5",
|
||||
"yazl": "2.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
import yaml from 'js-yaml';
|
||||
import toml from '@iarna/toml';
|
||||
import { readFile } from 'fs-extra';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
|
||||
async function readFileOrNull(file: string) {
|
||||
try {
|
||||
const data = await readFile(file);
|
||||
return data;
|
||||
} catch (err) {
|
||||
if (err.code !== 'ENOENT') {
|
||||
throw err;
|
||||
} catch (error: unknown) {
|
||||
if (!isErrnoException(error)) {
|
||||
throw error;
|
||||
}
|
||||
if (error.code !== 'ENOENT') {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ describe('Test `getPlatformEnv()`', () => {
|
||||
process.env.NOW_FOO = 'bar';
|
||||
process.env.VERCEL_FOO = 'baz';
|
||||
getPlatformEnv('FOO');
|
||||
} catch (_err) {
|
||||
err = _err;
|
||||
} catch (_err: unknown) {
|
||||
err = _err as Error;
|
||||
} finally {
|
||||
delete process.env.NOW_FOO;
|
||||
delete process.env.VERCEL_FOO;
|
||||
|
||||
4
packages/build-utils/test/unit.test.ts
vendored
4
packages/build-utils/test/unit.test.ts
vendored
@@ -480,7 +480,7 @@ it('should detect package.json in nested backend', async () => {
|
||||
const result = await scanParentDirs(fixture);
|
||||
expect(result.cliType).toEqual('pnpm');
|
||||
// There is no lockfile but this test will pick up vercel/vercel/pnpm-lock.yaml
|
||||
expect(result.lockfileVersion).toEqual(5.4);
|
||||
expect(result.lockfileVersion).toEqual(6);
|
||||
expect(result.packageJsonPath).toEqual(path.join(fixture, 'package.json'));
|
||||
});
|
||||
|
||||
@@ -492,7 +492,7 @@ it('should detect package.json in nested frontend', async () => {
|
||||
const result = await scanParentDirs(fixture);
|
||||
expect(result.cliType).toEqual('pnpm');
|
||||
// There is no lockfile but this test will pick up vercel/vercel/pnpm-lock.yaml
|
||||
expect(result.lockfileVersion).toEqual(5.4);
|
||||
expect(result.lockfileVersion).toEqual(6);
|
||||
expect(result.packageJsonPath).toEqual(path.join(fixture, 'package.json'));
|
||||
});
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
diagnostics: false,
|
||||
isolatedModules: true,
|
||||
},
|
||||
transform: {
|
||||
'^.+\\.[tj]s$': [
|
||||
'ts-jest',
|
||||
{
|
||||
diagnostics: true,
|
||||
isolatedModules: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
setupFilesAfterEnv: ['@alex_neo/jest-expect-message'],
|
||||
verbose: false,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "28.18.5",
|
||||
"version": "29.0.0",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -32,16 +32,16 @@
|
||||
"node": ">= 14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.7.1",
|
||||
"@vercel/go": "2.4.4",
|
||||
"@vercel/hydrogen": "0.0.62",
|
||||
"@vercel/next": "3.7.4",
|
||||
"@vercel/node": "2.10.3",
|
||||
"@vercel/python": "3.1.58",
|
||||
"@vercel/redwood": "1.1.14",
|
||||
"@vercel/remix-builder": "1.8.4",
|
||||
"@vercel/ruby": "1.3.75",
|
||||
"@vercel/static-build": "1.3.23"
|
||||
"@vercel/build-utils": "6.7.2",
|
||||
"@vercel/go": "2.5.1",
|
||||
"@vercel/hydrogen": "0.0.64",
|
||||
"@vercel/next": "3.7.6",
|
||||
"@vercel/node": "2.13.0",
|
||||
"@vercel/python": "3.1.60",
|
||||
"@vercel/redwood": "1.1.15",
|
||||
"@vercel/remix-builder": "1.8.6",
|
||||
"@vercel/ruby": "1.3.76",
|
||||
"@vercel/static-build": "1.3.26"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alex_neo/jest-expect-message": "1.0.5",
|
||||
@@ -84,15 +84,16 @@
|
||||
"@types/which": "1.3.2",
|
||||
"@types/write-json-file": "2.2.1",
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vercel-internals/constants": "*",
|
||||
"@vercel-internals/get-package-json": "*",
|
||||
"@vercel-internals/types": "*",
|
||||
"@vercel/client": "12.4.9",
|
||||
"@vercel/error-utils": "1.0.9",
|
||||
"@vercel/frameworks": "1.3.4",
|
||||
"@vercel/fs-detectors": "3.8.10",
|
||||
"@vercel/client": "12.4.12",
|
||||
"@vercel/error-utils": "1.0.10",
|
||||
"@vercel/frameworks": "1.3.5",
|
||||
"@vercel/fs-detectors": "3.8.12",
|
||||
"@vercel/fun": "1.0.4",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"@vercel/routing-utils": "2.2.0",
|
||||
"@vercel/routing-utils": "2.2.1",
|
||||
"@zeit/source-map-support": "0.6.2",
|
||||
"ajv": "6.12.2",
|
||||
"alpha-sort": "2.0.1",
|
||||
@@ -162,7 +163,6 @@
|
||||
"tmp-promise": "1.0.3",
|
||||
"tree-kill": "1.2.2",
|
||||
"ts-node": "10.9.1",
|
||||
"typescript": "4.9.4",
|
||||
"universal-analytics": "0.4.20",
|
||||
"utility-types": "2.1.0",
|
||||
"write-json-file": "2.2.0",
|
||||
|
||||
@@ -12,7 +12,7 @@ import stamp from '../../util/output/stamp';
|
||||
import strlen from '../../util/strlen';
|
||||
import getCommandFlags from '../../util/get-command-flags';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
import { Alias } from '@vercel-internals/types';
|
||||
import type { Alias } from '@vercel-internals/types';
|
||||
|
||||
export default async function ls(
|
||||
client: Client,
|
||||
|
||||
@@ -9,7 +9,7 @@ import strlen from '../../util/strlen';
|
||||
import confirm from '../../util/input/confirm';
|
||||
import findAliasByAliasOrId from '../../util/alias/find-alias-by-alias-or-id';
|
||||
|
||||
import { Alias } from '@vercel-internals/types';
|
||||
import type { Alias } from '@vercel-internals/types';
|
||||
import { isValidName } from '../../util/is-valid-name';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import { SetDifference } from 'utility-types';
|
||||
import { AliasRecord } from '../../util/alias/create-alias';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import type { Domain } from '@vercel-internals/types';
|
||||
import { Output } from '../../util/output';
|
||||
import * as ERRORS from '../../util/errors-ts';
|
||||
import assignAlias from '../../util/alias/assign-alias';
|
||||
|
||||
@@ -252,7 +252,7 @@ export default async function main(client: Client): Promise<number> {
|
||||
output.debug(`Loaded environment variables from "${envPath}"`);
|
||||
}
|
||||
|
||||
// For Vercel Analytics support
|
||||
// For Vercel Speed Insights support
|
||||
if (project.settings.analyticsId) {
|
||||
envToUnset.add('VERCEL_ANALYTICS_ID');
|
||||
process.env.VERCEL_ANALYTICS_ID = project.settings.analyticsId;
|
||||
|
||||
@@ -5,7 +5,7 @@ import stamp from '../../util/output/stamp';
|
||||
import createCertFromFile from '../../util/certs/create-cert-from-file';
|
||||
import createCertForCns from '../../util/certs/create-cert-for-cns';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import type { Cert } from '@vercel-internals/types';
|
||||
|
||||
interface Options {
|
||||
'--overwrite'?: boolean;
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
import stamp from '../../util/output/stamp';
|
||||
import getCerts from '../../util/certs/get-certs';
|
||||
import strlen from '../../util/strlen';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import type { Cert } from '@vercel-internals/types';
|
||||
import getCommandFlags from '../../util/get-command-flags';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import chalk from 'chalk';
|
||||
import ms from 'ms';
|
||||
import plural from 'pluralize';
|
||||
import table from 'text-table';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import type { Cert } from '@vercel-internals/types';
|
||||
import * as ERRORS from '../../util/errors-ts';
|
||||
import { Output } from '../../util/output';
|
||||
import deleteCertById from '../../util/certs/delete-cert-by-id';
|
||||
|
||||
@@ -71,6 +71,7 @@ export const help = () => `
|
||||
-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
|
||||
-S, --scope Set a custom scope
|
||||
--regions Set default regions to enable the deployment on
|
||||
--prod Create a production deployment
|
||||
|
||||
@@ -16,7 +16,7 @@ import { handleError } from '../../util/error';
|
||||
import Client from '../../util/client';
|
||||
import { getPrettyError } from '@vercel/build-utils';
|
||||
import toHumanPath from '../../util/humanize-path';
|
||||
import Now from '../../util';
|
||||
import Now, { CreateOptions } from '../../util';
|
||||
import stamp from '../../util/output/stamp';
|
||||
import createDeploy from '../../util/deploy/create-deploy';
|
||||
import getDeployment from '../../util/get-deployment';
|
||||
@@ -70,6 +70,8 @@ import { isValidArchive } from '../../util/deploy/validate-archive-format';
|
||||
import { parseEnv } from '../../util/parse-env';
|
||||
import { errorToString, isErrnoException, isError } from '@vercel/error-utils';
|
||||
import { pickOverrides } from '../../util/projects/project-settings';
|
||||
import { isDeploying } from '../../util/deploy/is-deploying';
|
||||
import type { Deployment } from '@vercel-internals/types';
|
||||
|
||||
export default async (client: Client): Promise<number> => {
|
||||
const { output } = client;
|
||||
@@ -90,6 +92,7 @@ export default async (client: Client): Promise<number> => {
|
||||
'--prebuilt': Boolean,
|
||||
'--prod': Boolean,
|
||||
'--archive': String,
|
||||
'--no-wait': Boolean,
|
||||
'--yes': Boolean,
|
||||
'-f': '--force',
|
||||
'-p': '--public',
|
||||
@@ -505,12 +508,20 @@ export default async (client: Client): Promise<number> => {
|
||||
});
|
||||
let deployStamp = stamp();
|
||||
let deployment = null;
|
||||
const noWait = !!argv['--no-wait'];
|
||||
|
||||
const localConfigurationOverrides = pickOverrides(localConfig);
|
||||
|
||||
const name = project ? project.name : newProjectName;
|
||||
if (!name) {
|
||||
throw new Error(
|
||||
'`name` not found on project or provided by existing project'
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
const createArgs: any = {
|
||||
name: project ? project.name : newProjectName,
|
||||
const createArgs: CreateOptions = {
|
||||
name,
|
||||
env: deploymentEnv,
|
||||
build: { env: deploymentBuildEnv },
|
||||
forceNew: argv['--force'],
|
||||
@@ -518,8 +529,7 @@ export default async (client: Client): Promise<number> => {
|
||||
prebuilt: argv['--prebuilt'],
|
||||
rootDirectory,
|
||||
quiet,
|
||||
wantsPublic: argv['--public'] || localConfig.public,
|
||||
type: null,
|
||||
wantsPublic: Boolean(argv['--public'] || localConfig.public),
|
||||
nowConfig: {
|
||||
...localConfig,
|
||||
// `images` is allowed in "vercel.json" and processed
|
||||
@@ -532,6 +542,7 @@ export default async (client: Client): Promise<number> => {
|
||||
deployStamp,
|
||||
target,
|
||||
skipAutoDetectionConfirmation: autoConfirm,
|
||||
noWait,
|
||||
};
|
||||
|
||||
if (!localConfig.builds || localConfig.builds.length === 0) {
|
||||
@@ -627,8 +638,10 @@ export default async (client: Client): Promise<number> => {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// get the deployment just to double check that it actually deployed
|
||||
await getDeployment(client, contextName, deployment.id);
|
||||
if (!noWait) {
|
||||
// get the deployment just to double check that it actually deployed
|
||||
await getDeployment(client, contextName, deployment.id);
|
||||
}
|
||||
|
||||
if (deployment === null) {
|
||||
error('Uploading failed. Please try again.');
|
||||
@@ -715,7 +728,7 @@ export default async (client: Client): Promise<number> => {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return printDeploymentStatus(output, client, deployment, deployStamp);
|
||||
return printDeploymentStatus(output, client, deployment, deployStamp, noWait);
|
||||
};
|
||||
|
||||
function handleCreateDeployError(
|
||||
@@ -835,7 +848,7 @@ const printDeploymentStatus = async (
|
||||
url: deploymentUrl,
|
||||
aliasWarning,
|
||||
}: {
|
||||
readyState: string;
|
||||
readyState: Deployment['readyState'];
|
||||
alias: string[];
|
||||
aliasError: Error;
|
||||
target: string;
|
||||
@@ -848,12 +861,26 @@ const printDeploymentStatus = async (
|
||||
action?: string;
|
||||
};
|
||||
},
|
||||
deployStamp: () => string
|
||||
deployStamp: () => string,
|
||||
noWait: boolean
|
||||
) => {
|
||||
indications = indications || [];
|
||||
const isProdDeployment = target === 'production';
|
||||
|
||||
if (readyState !== 'READY') {
|
||||
let isStillBuilding = false;
|
||||
if (noWait) {
|
||||
if (isDeploying(readyState)) {
|
||||
isStillBuilding = true;
|
||||
output.print(
|
||||
prependEmoji(
|
||||
'Note: Deployment is still processing...',
|
||||
emoji('notice')
|
||||
) + '\n'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isStillBuilding && readyState !== 'READY') {
|
||||
output.error(
|
||||
`Your deployment failed. Please retry later. More: https://err.sh/vercel/deployment-error`
|
||||
);
|
||||
@@ -869,7 +896,8 @@ const printDeploymentStatus = async (
|
||||
} else {
|
||||
// print preview/production url
|
||||
let previewUrl: string;
|
||||
if (Array.isArray(aliasList) && aliasList.length > 0) {
|
||||
// if `noWait` is true, then use the deployment url, not an alias
|
||||
if (!noWait && Array.isArray(aliasList) && aliasList.length > 0) {
|
||||
const previewUrlInfo = await getPreferredPreviewURL(client, aliasList);
|
||||
if (previewUrlInfo) {
|
||||
previewUrl = previewUrlInfo.previewUrl;
|
||||
|
||||
@@ -5,7 +5,7 @@ import DevServer from '../../util/dev/server';
|
||||
import { parseListen } from '../../util/dev/parse-listen';
|
||||
import Client from '../../util/client';
|
||||
import { getLinkedProject } from '../../util/projects/link';
|
||||
import { ProjectSettings } from '@vercel-internals/types';
|
||||
import type { ProjectSettings } from '@vercel-internals/types';
|
||||
import setupAndLink from '../../util/link/setup-and-link';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
import param from '../../util/output/param';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import ms from 'ms';
|
||||
import { DomainNotFound } from '../../util/errors-ts';
|
||||
import { DNSRecord } from '@vercel-internals/types';
|
||||
import type { DNSRecord } from '@vercel-internals/types';
|
||||
import Client from '../../util/client';
|
||||
import formatTable from '../../util/format-table';
|
||||
import getDNSRecords, {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import ms from 'ms';
|
||||
import table from 'text-table';
|
||||
import { DNSRecord } from '@vercel-internals/types';
|
||||
import type { DNSRecord } from '@vercel-internals/types';
|
||||
import { Output } from '../../util/output';
|
||||
import Client from '../../util/client';
|
||||
import deleteDNSRecordById from '../../util/dns/delete-dns-record-by-id';
|
||||
|
||||
@@ -8,7 +8,7 @@ import getScope from '../../util/get-scope';
|
||||
import stamp from '../../util/output/stamp';
|
||||
import formatTable from '../../util/format-table';
|
||||
import { formatDateWithoutTime } from '../../util/format-date';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import type { Domain } from '@vercel-internals/types';
|
||||
import getCommandFlags from '../../util/get-command-flags';
|
||||
import {
|
||||
PaginationOptions,
|
||||
|
||||
@@ -2,7 +2,7 @@ import chalk from 'chalk';
|
||||
import plural from 'pluralize';
|
||||
|
||||
import { DomainNotFound, DomainPermissionDenied } from '../../util/errors-ts';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import type { Domain } from '@vercel-internals/types';
|
||||
import { Output } from '../../util/output';
|
||||
import Client from '../../util/client';
|
||||
import deleteCertById from '../../util/certs/delete-cert-by-id';
|
||||
|
||||
14
packages/cli/src/commands/env/add.ts
vendored
14
packages/cli/src/commands/env/add.ts
vendored
@@ -1,9 +1,5 @@
|
||||
import chalk from 'chalk';
|
||||
import {
|
||||
ProjectEnvTarget,
|
||||
Project,
|
||||
ProjectEnvType,
|
||||
} from '@vercel-internals/types';
|
||||
import type { Project, ProjectEnvTarget } from '@vercel-internals/types';
|
||||
import { Output } from '../../util/output';
|
||||
import Client from '../../util/client';
|
||||
import stamp from '../../util/output/stamp';
|
||||
@@ -12,7 +8,7 @@ import getEnvRecords from '../../util/env/get-env-records';
|
||||
import {
|
||||
isValidEnvTarget,
|
||||
getEnvTargetPlaceholder,
|
||||
getEnvTargetChoices,
|
||||
envTargetChoices,
|
||||
} from '../../util/env/env-target';
|
||||
import readStandardInput from '../../util/input/read-standard-input';
|
||||
import param from '../../util/output/param';
|
||||
@@ -92,7 +88,7 @@ export default async function add(
|
||||
const existing = new Set(
|
||||
envs.filter(r => r.key === envName).map(r => r.target)
|
||||
);
|
||||
const choices = getEnvTargetChoices().filter(c => !existing.has(c.value));
|
||||
const choices = envTargetChoices.filter(c => !existing.has(c.value));
|
||||
|
||||
if (choices.length === 0) {
|
||||
output.error(
|
||||
@@ -138,7 +134,7 @@ export default async function add(
|
||||
!stdInput &&
|
||||
!envGitBranch &&
|
||||
envTargets.length === 1 &&
|
||||
envTargets[0] === ProjectEnvTarget.Preview
|
||||
envTargets[0] === 'preview'
|
||||
) {
|
||||
const { inputValue } = await client.prompt({
|
||||
type: 'input',
|
||||
@@ -155,7 +151,7 @@ export default async function add(
|
||||
output,
|
||||
client,
|
||||
project.id,
|
||||
ProjectEnvType.Encrypted,
|
||||
'encrypted',
|
||||
envName,
|
||||
envValue,
|
||||
envTargets,
|
||||
|
||||
10
packages/cli/src/commands/env/ls.ts
vendored
10
packages/cli/src/commands/env/ls.ts
vendored
@@ -1,11 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import ms from 'ms';
|
||||
import { Output } from '../../util/output';
|
||||
import {
|
||||
Project,
|
||||
ProjectEnvVariable,
|
||||
ProjectEnvType,
|
||||
} from '@vercel-internals/types';
|
||||
import type { Project, ProjectEnvVariable } from '@vercel-internals/types';
|
||||
import Client from '../../util/client';
|
||||
import formatTable from '../../util/format-table';
|
||||
import getEnvRecords from '../../util/env/get-env-records';
|
||||
@@ -99,13 +95,13 @@ function getTable(records: ProjectEnvVariable[]) {
|
||||
|
||||
function getRow(env: ProjectEnvVariable) {
|
||||
let value: string;
|
||||
if (env.type === ProjectEnvType.Plaintext) {
|
||||
if (env.type === 'plain') {
|
||||
// replace space characters (line-break, etc.) with simple spaces
|
||||
// to make sure the displayed value is a single line
|
||||
const singleLineValue = env.value.replace(/\s/g, ' ');
|
||||
|
||||
value = chalk.gray(ellipsis(singleLineValue, 19));
|
||||
} else if (env.type === ProjectEnvType.System) {
|
||||
} else if (env.type === 'system') {
|
||||
value = chalk.gray.italic(env.value);
|
||||
} else {
|
||||
value = chalk.gray.italic('Encrypted');
|
||||
|
||||
4
packages/cli/src/commands/env/pull.ts
vendored
4
packages/cli/src/commands/env/pull.ts
vendored
@@ -2,7 +2,7 @@ import chalk from 'chalk';
|
||||
import { outputFile } from 'fs-extra';
|
||||
import { closeSync, openSync, readSync } from 'fs';
|
||||
import { resolve } from 'path';
|
||||
import { Project, ProjectEnvTarget } from '@vercel-internals/types';
|
||||
import type { Project, ProjectEnvTarget } from '@vercel-internals/types';
|
||||
import Client from '../../util/client';
|
||||
import { emoji, prependEmoji } from '../../util/emoji';
|
||||
import confirm from '../../util/input/confirm';
|
||||
@@ -101,7 +101,7 @@ export default async function pull(
|
||||
|
||||
const records = (
|
||||
await pullEnvRecords(output, client, project.id, source, {
|
||||
target: environment || ProjectEnvTarget.Development,
|
||||
target: environment || 'development',
|
||||
gitBranch,
|
||||
})
|
||||
).env;
|
||||
|
||||
2
packages/cli/src/commands/env/rm.ts
vendored
2
packages/cli/src/commands/env/rm.ts
vendored
@@ -1,5 +1,5 @@
|
||||
import chalk from 'chalk';
|
||||
import { Project } from '@vercel-internals/types';
|
||||
import type { Project } from '@vercel-internals/types';
|
||||
import { Output } from '../../util/output';
|
||||
import confirm from '../../util/input/confirm';
|
||||
import removeEnvRecord from '../../util/env/remove-env-record';
|
||||
|
||||
@@ -10,10 +10,14 @@ import getScope from '../util/get-scope';
|
||||
import { getPkgName, getCommandName } from '../util/pkg-name';
|
||||
import Client from '../util/client';
|
||||
import getDeployment from '../util/get-deployment';
|
||||
import { Build, Deployment } from '@vercel-internals/types';
|
||||
import type { Build, Deployment } from '@vercel-internals/types';
|
||||
import title from 'title';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
import { URL } from 'url';
|
||||
import readStandardInput from '../util/input/read-standard-input';
|
||||
import sleep from '../util/sleep';
|
||||
import ms from 'ms';
|
||||
import { isDeploying } from '../util/deploy/is-deploying';
|
||||
|
||||
const help = () => {
|
||||
console.log(`
|
||||
@@ -34,6 +38,10 @@ const help = () => {
|
||||
-d, --debug Debug mode [off]
|
||||
--no-color No color mode [off]
|
||||
-S, --scope Set a custom scope
|
||||
--timeout=${chalk.bold.underline(
|
||||
'TIME'
|
||||
)} Time to wait for deployment completion [3m]
|
||||
--wait Blocks until deployment completes
|
||||
|
||||
${chalk.dim('Examples:')}
|
||||
|
||||
@@ -44,6 +52,16 @@ const help = () => {
|
||||
${chalk.gray('-')} Get information about the deployment an alias points to
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} inspect my-deployment.vercel.app`)}
|
||||
|
||||
${chalk.gray('-')} Get information about a deployment by piping in the URL
|
||||
|
||||
${chalk.cyan(`$ echo my-deployment.vercel.app | ${getPkgName()} inspect`)}
|
||||
|
||||
${chalk.gray('-')} Wait up to 90 seconds for deployment to complete
|
||||
|
||||
${chalk.cyan(
|
||||
`$ ${getPkgName()} inspect my-deployment.vercel.app --wait --timeout 90s`
|
||||
)}
|
||||
`);
|
||||
};
|
||||
|
||||
@@ -51,7 +69,10 @@ export default async function main(client: Client) {
|
||||
let argv;
|
||||
|
||||
try {
|
||||
argv = getArgs(client.argv.slice(2));
|
||||
argv = getArgs(client.argv.slice(2), {
|
||||
'--timeout': String,
|
||||
'--wait': Boolean,
|
||||
});
|
||||
} catch (err) {
|
||||
handleError(err);
|
||||
return 1;
|
||||
@@ -67,12 +88,28 @@ export default async function main(client: Client) {
|
||||
// extract the first parameter
|
||||
let [, deploymentIdOrHost] = argv._;
|
||||
|
||||
if (argv._.length !== 2) {
|
||||
if (!deploymentIdOrHost) {
|
||||
// if the URL is not passed in, check stdin
|
||||
// allows cool stuff like `echo my-deployment.vercel.app | vc inspect --wait`
|
||||
const stdInput = await readStandardInput(client.stdin);
|
||||
if (stdInput) {
|
||||
deploymentIdOrHost = stdInput;
|
||||
}
|
||||
}
|
||||
|
||||
if (!deploymentIdOrHost) {
|
||||
error(`${getCommandName('inspect <url>')} expects exactly one argument`);
|
||||
help();
|
||||
return 1;
|
||||
}
|
||||
|
||||
// validate the timeout
|
||||
const timeout = ms(argv['--timeout'] ?? '3m');
|
||||
if (timeout === undefined) {
|
||||
error(`Invalid timeout "${argv['--timeout']}"`);
|
||||
return 1;
|
||||
}
|
||||
|
||||
let contextName: string | null = null;
|
||||
|
||||
try {
|
||||
@@ -98,12 +135,22 @@ export default async function main(client: Client) {
|
||||
`Fetching deployment "${deploymentIdOrHost}" in ${chalk.bold(contextName)}`
|
||||
);
|
||||
|
||||
const until = Date.now() + timeout;
|
||||
const wait = argv['--wait'];
|
||||
|
||||
// resolve the deployment, since we might have been given an alias
|
||||
const deployment = await getDeployment(
|
||||
client,
|
||||
contextName,
|
||||
deploymentIdOrHost
|
||||
);
|
||||
let deployment = await getDeployment(client, contextName, deploymentIdOrHost);
|
||||
|
||||
while (Date.now() < until) {
|
||||
if (!wait || !isDeploying(deployment.readyState)) {
|
||||
break;
|
||||
}
|
||||
|
||||
await sleep(250);
|
||||
|
||||
// check the deployment state again
|
||||
deployment = await getDeployment(client, contextName, deploymentIdOrHost);
|
||||
}
|
||||
|
||||
const {
|
||||
id,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import ms from 'ms';
|
||||
import table from 'text-table';
|
||||
import { Project } from '@vercel-internals/types';
|
||||
import type { Project } from '@vercel-internals/types';
|
||||
import Client from '../../util/client';
|
||||
import getCommandFlags from '../../util/get-command-flags';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
|
||||
@@ -50,12 +50,10 @@ import getUpdateCommand from './util/get-update-command';
|
||||
import { metrics, shouldCollectMetrics } from './util/metrics';
|
||||
import { getCommandName, getTitleName } from './util/pkg-name';
|
||||
import doLoginPrompt from './util/login/prompt';
|
||||
import { AuthConfig, GlobalConfig } from '@vercel-internals/types';
|
||||
import type { AuthConfig, GlobalConfig } from '@vercel-internals/types';
|
||||
import { VercelConfig } from '@vercel/client';
|
||||
import box from './util/output/box';
|
||||
|
||||
const isCanary = pkg.version.includes('canary');
|
||||
|
||||
const VERCEL_DIR = getGlobalPathConfig();
|
||||
const VERCEL_CONFIG_PATH = configFiles.getConfigFilePath();
|
||||
const VERCEL_AUTH_CONFIG_PATH = configFiles.getAuthConfigFilePath();
|
||||
@@ -70,7 +68,7 @@ sourceMap.install();
|
||||
Sentry.init({
|
||||
dsn: SENTRY_DSN,
|
||||
release: `vercel-cli@${pkg.version}`,
|
||||
environment: isCanary ? 'canary' : 'stable',
|
||||
environment: 'stable',
|
||||
});
|
||||
|
||||
let client: Client;
|
||||
@@ -165,13 +163,7 @@ const main = async () => {
|
||||
)}`
|
||||
);
|
||||
} else {
|
||||
output.print(
|
||||
`${chalk.grey(
|
||||
`${getTitleName()} CLI ${pkg.version}${
|
||||
isCanary ? ' — https://vercel.com/feedback' : ''
|
||||
}`
|
||||
)}\n`
|
||||
);
|
||||
output.print(`${chalk.grey(`${getTitleName()} CLI ${pkg.version}`)}\n`);
|
||||
}
|
||||
|
||||
// Handle `--version` directly
|
||||
@@ -707,7 +699,6 @@ main()
|
||||
// Check if an update is available. If so, `latest` will contain a string
|
||||
// of the latest version, otherwise `undefined`.
|
||||
const latest = getLatestVersion({
|
||||
distTag: isCanary ? 'canary' : 'latest',
|
||||
output,
|
||||
pkg,
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Output } from '../output';
|
||||
import { Alias } from '@vercel-internals/types';
|
||||
import type { Alias } from '@vercel-internals/types';
|
||||
|
||||
import Client from '../client';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import path from 'path';
|
||||
import chalk from 'chalk';
|
||||
import Client from '../client';
|
||||
import { Output } from '../output';
|
||||
import { User } from '@vercel-internals/types';
|
||||
import type { User } from '@vercel-internals/types';
|
||||
import { VercelConfig } from '../dev/types';
|
||||
import getDeploymentsByAppName from '../deploy/get-deployments-by-appname';
|
||||
import getDeployment from '../get-deployment';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Client from '../client';
|
||||
import getAliases from './get-aliases';
|
||||
import { Alias } from '@vercel-internals/types';
|
||||
import type { Alias } from '@vercel-internals/types';
|
||||
|
||||
export default async function getDomainAliases(client: Client, domain: string) {
|
||||
const { aliases } = await getAliases(client);
|
||||
|
||||
@@ -27,8 +27,6 @@ const ARG_COMMON = {
|
||||
|
||||
'--api': String,
|
||||
|
||||
'--target': String,
|
||||
|
||||
'--cwd': String,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Build } from '@vercel-internals/types';
|
||||
import type { Build } from '@vercel-internals/types';
|
||||
|
||||
export const isReady = ({ readyState }: Pick<Build, 'readyState'>) =>
|
||||
readyState === 'READY';
|
||||
|
||||
@@ -15,6 +15,7 @@ import { CantParseJSONFile } from '../errors-ts';
|
||||
import { isErrnoException, isError } from '@vercel/error-utils';
|
||||
import cmd from '../output/cmd';
|
||||
import code from '../output/code';
|
||||
import type { Writable } from 'stream';
|
||||
|
||||
export interface BuilderWithPkg {
|
||||
path: string;
|
||||
@@ -103,8 +104,14 @@ export async function resolveBuilders(
|
||||
// at the top-level of `node_modules` since CLI is installing those directly.
|
||||
pkgPath = join(buildersDir, 'node_modules', name, 'package.json');
|
||||
builderPkg = await readJSON(pkgPath);
|
||||
} catch (err: any) {
|
||||
if (err?.code !== 'ENOENT') throw err;
|
||||
} catch (error: unknown) {
|
||||
if (!isErrnoException(error)) {
|
||||
throw error;
|
||||
}
|
||||
if (error.code !== 'ENOENT') {
|
||||
throw error;
|
||||
}
|
||||
|
||||
// If `pkgPath` wasn't found in `.vercel/builders` then try as a CLI local
|
||||
// dependency. `require.resolve()` will throw if the Builder is not a CLI
|
||||
// dep, in which case we'll install it into `.vercel/builders`.
|
||||
@@ -227,10 +234,7 @@ async function installBuilders(
|
||||
} catch (err: unknown) {
|
||||
if (isError(err)) {
|
||||
const execaMessage = err.message;
|
||||
let message =
|
||||
err && 'stderr' in err && typeof err.stderr === 'string'
|
||||
? err.stderr
|
||||
: execaMessage;
|
||||
let message = getErrorMessage(err, execaMessage);
|
||||
if (execaMessage.startsWith('Command failed with ENOENT')) {
|
||||
// `npm` is not installed
|
||||
message = `Please install ${cmd('npm')} before continuing`;
|
||||
@@ -284,3 +288,19 @@ async function installBuilders(
|
||||
|
||||
return { resolvedSpecs };
|
||||
}
|
||||
|
||||
type BonusError = Error & {
|
||||
stderr?: string | Writable;
|
||||
};
|
||||
|
||||
function getErrorMessage(err: BonusError, execaMessage: string) {
|
||||
if (!err || !('stderr' in err)) {
|
||||
return execaMessage;
|
||||
}
|
||||
|
||||
if (typeof err.stderr === 'string') {
|
||||
return err.stderr;
|
||||
}
|
||||
|
||||
return execaMessage;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { readFileSync } from 'fs';
|
||||
import { resolve } from 'path';
|
||||
import Client from '../client';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import type { Cert } from '@vercel-internals/types';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
import { isAPIError } from '../errors-ts';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import chalk from 'chalk';
|
||||
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import type { Cert } from '@vercel-internals/types';
|
||||
import * as ERRORS from '../errors-ts';
|
||||
import Client from '../client';
|
||||
import mapCertError from './map-cert-error';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import type { Cert } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
import * as ERRORS from '../errors-ts';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { stringify } from 'querystring';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import type { Cert } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { stringify } from 'querystring';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import type { Cert } from '@vercel-internals/types';
|
||||
import * as ERRORS from '../errors-ts';
|
||||
import Client from '../client';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import retry from 'async-retry';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import type { Cert } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
import { isAPIError } from '../errors-ts';
|
||||
import { isError } from '@vercel/error-utils';
|
||||
|
||||
@@ -35,10 +35,6 @@ export async function createGitMeta(
|
||||
if (!remoteUrl) {
|
||||
remoteUrl = await getOriginUrl(join(directory, '.git/config'), output);
|
||||
}
|
||||
// If we can't get the repo URL, then don't return any metadata
|
||||
if (!remoteUrl) {
|
||||
return;
|
||||
}
|
||||
|
||||
const [commitResult, dirtyResult] = await Promise.allSettled([
|
||||
getLastCommit(directory),
|
||||
@@ -63,7 +59,7 @@ export async function createGitMeta(
|
||||
const commit = commitResult.value;
|
||||
|
||||
return {
|
||||
remoteUrl,
|
||||
remoteUrl: remoteUrl || undefined,
|
||||
commitAuthorName: commit.author.name,
|
||||
commitMessage: commit.subject,
|
||||
commitRef: commit.branch,
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as ERRORS_TS from '../errors-ts';
|
||||
import * as ERRORS from '../errors';
|
||||
import { NowError } from '../now-error';
|
||||
import mapCertError from '../certs/map-cert-error';
|
||||
import { Org } from '@vercel-internals/types';
|
||||
import type { Org } from '@vercel-internals/types';
|
||||
import Now, { CreateOptions } from '..';
|
||||
import Client from '../client';
|
||||
import { ArchiveFormat, DeploymentError } from '@vercel/client';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { URLSearchParams } from 'url';
|
||||
import { Deployment } from '@vercel-internals/types';
|
||||
import type { Deployment } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
|
||||
type LegacyDeployment = {
|
||||
|
||||
23
packages/cli/src/util/deploy/is-deploying.ts
Normal file
23
packages/cli/src/util/deploy/is-deploying.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Deployment } from '@vercel-internals/types';
|
||||
|
||||
export const deploymentInProgressStates: Deployment['readyState'][] = [
|
||||
'QUEUED',
|
||||
'BUILDING',
|
||||
'INITIALIZING',
|
||||
];
|
||||
|
||||
export const deploymentCompletedStates: Deployment['readyState'][] = [
|
||||
'READY',
|
||||
'CANCELED',
|
||||
'ERROR',
|
||||
];
|
||||
|
||||
/**
|
||||
* Checks if the deployments readyState is considered to be in progress.
|
||||
* @param readyState The deployment's readyState
|
||||
* @returns `true` if in a pending deployment state, otherwise `false` if it's
|
||||
* ready/canceled/errored
|
||||
*/
|
||||
export function isDeploying(readyState: Deployment['readyState']): Boolean {
|
||||
return deploymentInProgressStates.includes(readyState);
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import { Output } from '../output';
|
||||
import { progress } from '../output/progress';
|
||||
import Now from '../../util';
|
||||
import { Org } from '@vercel-internals/types';
|
||||
import type { Org } from '@vercel-internals/types';
|
||||
import ua from '../ua';
|
||||
import { linkFolderToProject } from '../projects/link';
|
||||
import { prependEmoji, emoji } from '../emoji';
|
||||
@@ -34,6 +34,7 @@ export default async function processDeployment({
|
||||
isSettingUpProject,
|
||||
archive,
|
||||
skipAutoDetectionConfirmation,
|
||||
noWait,
|
||||
...args
|
||||
}: {
|
||||
now: Now;
|
||||
@@ -52,7 +53,8 @@ export default async function processDeployment({
|
||||
archive?: ArchiveFormat;
|
||||
skipAutoDetectionConfirmation?: boolean;
|
||||
cwd?: string;
|
||||
rootDirectory?: string;
|
||||
rootDirectory?: string | null;
|
||||
noWait?: boolean;
|
||||
}) {
|
||||
let {
|
||||
now,
|
||||
@@ -180,6 +182,10 @@ export default async function processDeployment({
|
||||
process.stdout.write(`https://${event.payload.url}`);
|
||||
}
|
||||
|
||||
if (noWait) {
|
||||
return event.payload;
|
||||
}
|
||||
|
||||
output.spinner(
|
||||
event.payload.readyState === 'QUEUED' ? 'Queued' : 'Building',
|
||||
0
|
||||
|
||||
@@ -51,10 +51,8 @@ import link from '../output/link';
|
||||
import sleep from '../sleep';
|
||||
import { Output } from '../output';
|
||||
import { relative } from '../path-helpers';
|
||||
import { getDistTag } from '../get-dist-tag';
|
||||
import getVercelConfigPath from '../config/local-path';
|
||||
import { MissingDotenvVarsError } from '../errors-ts';
|
||||
import cliPkg from '../pkg';
|
||||
import { getVercelDirectory } from '../projects/link';
|
||||
import { staticFiles as getFiles } from '../get-files';
|
||||
import { validateConfig } from '../validate-config';
|
||||
@@ -85,7 +83,7 @@ import {
|
||||
HttpHeadersConfig,
|
||||
EnvConfigs,
|
||||
} from './types';
|
||||
import { ProjectSettings } from '@vercel-internals/types';
|
||||
import type { ProjectSettings } from '@vercel-internals/types';
|
||||
import { treeKill } from '../tree-kill';
|
||||
import { applyOverriddenHeaders, nodeHeadersToFetchHeaders } from './headers';
|
||||
import { formatQueryString, parseQueryString } from './parse-query-string';
|
||||
@@ -593,7 +591,7 @@ export default class DevServer {
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, pkg, {
|
||||
tag: getDistTag(cliPkg.version) === 'canary' ? 'canary' : 'latest',
|
||||
tag: 'latest',
|
||||
functions: vercelConfig.functions,
|
||||
projectSettings: projectSettings || this.projectSettings,
|
||||
featHandleMiss,
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
import { VercelConfig } from '@vercel/client';
|
||||
import { HandleValue, Route } from '@vercel/routing-utils';
|
||||
import { Output } from '../output';
|
||||
import { ProjectSettings } from '@vercel-internals/types';
|
||||
import type { ProjectSettings } from '@vercel-internals/types';
|
||||
import { BuilderWithPkg } from '../build/import-builders';
|
||||
|
||||
export { VercelConfig };
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
DNSConflictingRecord,
|
||||
isAPIError,
|
||||
} from '../errors-ts';
|
||||
import { DNSRecordData } from '@vercel-internals/types';
|
||||
import type { DNSRecordData } from '@vercel-internals/types';
|
||||
|
||||
type Response = {
|
||||
uid: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import chalk from 'chalk';
|
||||
import { DNSRecordData } from '@vercel-internals/types';
|
||||
import type { DNSRecordData } from '@vercel-internals/types';
|
||||
import textInput from '../input/text';
|
||||
import promptBool from '../input/prompt-bool';
|
||||
import Client from '../client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DNSRecord } from '@vercel-internals/types';
|
||||
import type { DNSRecord } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
|
||||
export default async function getDNSRecordById(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DNSRecord } from '@vercel-internals/types';
|
||||
import type { DNSRecord } from '@vercel-internals/types';
|
||||
import { DomainNotFound } from '../errors-ts';
|
||||
import { Output } from '../output';
|
||||
import Client from '../client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DNSRecordData } from '@vercel-internals/types';
|
||||
import type { DNSRecordData } from '@vercel-internals/types';
|
||||
|
||||
export default function parseAddArgs(
|
||||
args: string[]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import retry from 'async-retry';
|
||||
import { DomainAlreadyExists, InvalidDomain, isAPIError } from '../errors-ts';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import type { Domain } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
|
||||
type Response = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import chalk from 'chalk';
|
||||
import Client from '../client';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import type { Domain } from '@vercel-internals/types';
|
||||
import {
|
||||
DomainPermissionDenied,
|
||||
DomainNotFound,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Client from '../client';
|
||||
import { DomainConfig } from '@vercel-internals/types';
|
||||
import type { DomainConfig } from '@vercel-internals/types';
|
||||
import { isAPIError } from '../errors-ts';
|
||||
|
||||
export async function getDomainConfig(client: Client, domainName: string) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import type { Domain } from '@vercel-internals/types';
|
||||
|
||||
export type DomainRegistrar = 'Vercel' | 'Purchase in Process' | 'Third Party';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import chalk from 'chalk';
|
||||
import Client from '../client';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import type { Domain } from '@vercel-internals/types';
|
||||
import { isAPIError } from '../errors-ts';
|
||||
|
||||
type Response = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import type { Domain } from '@vercel-internals/types';
|
||||
|
||||
export default function isDomainExternal(domain: Domain) {
|
||||
return domain.serviceType !== 'zeit.world';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import psl from 'psl';
|
||||
import { NowError } from '../now-error';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import type { Domain } from '@vercel-internals/types';
|
||||
import { Output } from '../output';
|
||||
import * as ERRORS from '../errors-ts';
|
||||
import addDomain from './add-domain';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as ERRORS from '../errors-ts';
|
||||
import Client from '../client';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import type { Domain } from '@vercel-internals/types';
|
||||
|
||||
type Response = {
|
||||
domain: Domain;
|
||||
|
||||
2
packages/cli/src/util/env/add-env-record.ts
vendored
2
packages/cli/src/util/env/add-env-record.ts
vendored
@@ -1,6 +1,6 @@
|
||||
import { Output } from '../output';
|
||||
import Client from '../client';
|
||||
import {
|
||||
import type {
|
||||
ProjectEnvTarget,
|
||||
ProjectEnvVariable,
|
||||
ProjectEnvType,
|
||||
|
||||
26
packages/cli/src/util/env/env-target.ts
vendored
26
packages/cli/src/util/env/env-target.ts
vendored
@@ -1,22 +1,22 @@
|
||||
import { ProjectEnvTarget } from '@vercel-internals/types';
|
||||
import type { ProjectEnvTarget } from '@vercel-internals/types';
|
||||
import { PROJECT_ENV_TARGET } from '@vercel-internals/constants';
|
||||
import title from 'title';
|
||||
|
||||
function envTargets(): string[] {
|
||||
return Object.values(ProjectEnvTarget);
|
||||
}
|
||||
|
||||
export function getEnvTargetChoices() {
|
||||
return Object.entries(ProjectEnvTarget).map(([key, value]) => ({
|
||||
name: key,
|
||||
value: value,
|
||||
}));
|
||||
}
|
||||
export const envTargetChoices = PROJECT_ENV_TARGET.map(t => ({
|
||||
name: title(t),
|
||||
value: t,
|
||||
}));
|
||||
|
||||
export function isValidEnvTarget(
|
||||
target?: string
|
||||
): target is ProjectEnvTarget | undefined {
|
||||
return typeof target === 'undefined' || envTargets().includes(target);
|
||||
// Specify `map` returns strings, instead of string constants so `.includes` works
|
||||
return (
|
||||
typeof target === 'undefined' ||
|
||||
envTargetChoices.map<string>(c => c.value).includes(target)
|
||||
);
|
||||
}
|
||||
|
||||
export function getEnvTargetPlaceholder() {
|
||||
return `<${envTargets().join(' | ')}>`;
|
||||
return `<${envTargetChoices.map(c => c.value).join(' | ')}>`;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import title from 'title';
|
||||
import { ProjectEnvVariable } from '@vercel-internals/types';
|
||||
import type { ProjectEnvVariable } from '@vercel-internals/types';
|
||||
|
||||
export default function formatEnvTarget(env: ProjectEnvVariable): string {
|
||||
const target = (Array.isArray(env.target) ? env.target : [env.target || ''])
|
||||
|
||||
5
packages/cli/src/util/env/get-env-records.ts
vendored
5
packages/cli/src/util/env/get-env-records.ts
vendored
@@ -1,6 +1,9 @@
|
||||
import { Output } from '../output';
|
||||
import Client from '../client';
|
||||
import { ProjectEnvVariable, ProjectEnvTarget } from '@vercel-internals/types';
|
||||
import type {
|
||||
ProjectEnvVariable,
|
||||
ProjectEnvTarget,
|
||||
} from '@vercel-internals/types';
|
||||
import { URLSearchParams } from 'url';
|
||||
|
||||
/** The CLI command that was used that needs the environment variables. */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Output } from '../output';
|
||||
import Client from '../client';
|
||||
import { ProjectEnvVariable } from '@vercel-internals/types';
|
||||
import type { ProjectEnvVariable } from '@vercel-internals/types';
|
||||
|
||||
export default async function removeEnvRecord(
|
||||
output: Output,
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import semver from 'semver';
|
||||
|
||||
export function getDistTag(version: string): string {
|
||||
const parsed = semver.parse(version);
|
||||
if (parsed && typeof parsed.prerelease[0] === 'string') {
|
||||
return parsed.prerelease[0] as string;
|
||||
}
|
||||
return 'latest';
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import Client from './client';
|
||||
import getUser from './get-user';
|
||||
import getTeamById from './teams/get-team-by-id';
|
||||
import { TeamDeleted } from './errors-ts';
|
||||
import { Team } from '@vercel-internals/types';
|
||||
import type { Team } from '@vercel-internals/types';
|
||||
|
||||
interface GetScopeOptions {
|
||||
getTeam?: boolean;
|
||||
|
||||
@@ -1,31 +1,8 @@
|
||||
import { Stats } from 'fs';
|
||||
import { readFile, realpath } from 'fs-extra';
|
||||
import { sep, dirname, join, resolve } from 'path';
|
||||
import { lstat, readlink, readFile, realpath } from 'fs-extra';
|
||||
import { isCanary } from './is-canary';
|
||||
import { scanParentDirs } from '@vercel/build-utils';
|
||||
import { getPkgName } from './pkg-name';
|
||||
|
||||
async function isYarn(): Promise<boolean> {
|
||||
let s: Stats;
|
||||
let binPath = process.argv[1];
|
||||
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
s = await lstat(binPath);
|
||||
if (s.isSymbolicLink()) {
|
||||
binPath = resolve(dirname(binPath), await readlink(binPath));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
const pkgPath = join(dirname(binPath), '..', 'package.json');
|
||||
/*
|
||||
* Generally, pkgPath looks like:
|
||||
* "/Users/username/.config/yarn/global/node_modules/vercel/package.json"
|
||||
* "/usr/local/share/.config/yarn/global/node_modules/vercel/package.json"
|
||||
*/
|
||||
return pkgPath.includes(join('yarn', 'global'));
|
||||
}
|
||||
|
||||
async function getConfigPrefix() {
|
||||
const paths = [
|
||||
process.env.npm_config_userconfig || process.env.NPM_CONFIG_USERCONFIG,
|
||||
@@ -76,6 +53,10 @@ async function isGlobal() {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (installPath.includes(['', 'pnpm', 'global', ''].join(sep))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (installPath.includes(['', 'fnm', 'node-versions', ''].join(sep))) {
|
||||
return true;
|
||||
}
|
||||
@@ -99,16 +80,26 @@ async function isGlobal() {
|
||||
}
|
||||
|
||||
export default async function getUpdateCommand(): Promise<string> {
|
||||
const tag = isCanary() ? 'canary' : 'latest';
|
||||
const pkgAndVersion = `${getPkgName()}@${tag}`;
|
||||
const pkgAndVersion = `${getPkgName()}@latest`;
|
||||
|
||||
const entrypoint = await realpath(process.argv[1]);
|
||||
let { cliType, lockfilePath } = await scanParentDirs(
|
||||
dirname(dirname(entrypoint))
|
||||
);
|
||||
if (!lockfilePath) {
|
||||
// Global installs for npm do not have a lockfile
|
||||
cliType = 'npm';
|
||||
}
|
||||
const yarn = cliType === 'yarn';
|
||||
|
||||
let install = yarn ? 'add' : 'i';
|
||||
if (await isGlobal()) {
|
||||
return (await isYarn())
|
||||
? `yarn global add ${pkgAndVersion}`
|
||||
: `npm i -g ${pkgAndVersion}`;
|
||||
if (yarn) {
|
||||
install = 'global add';
|
||||
} else {
|
||||
install = 'i -g';
|
||||
}
|
||||
}
|
||||
|
||||
return (await isYarn())
|
||||
? `yarn add ${pkgAndVersion}`
|
||||
: `npm i ${pkgAndVersion}`;
|
||||
return `${cliType} ${install} ${pkgAndVersion}`;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Client from './client';
|
||||
import { User } from '@vercel-internals/types';
|
||||
import type { User } from '@vercel-internals/types';
|
||||
import { APIError, InvalidToken, MissingUser } from './errors-ts';
|
||||
|
||||
export default async function getUser(client: Client) {
|
||||
|
||||
@@ -36,7 +36,7 @@ export interface CreateOptions {
|
||||
project?: string;
|
||||
wantsPublic: boolean;
|
||||
prebuilt?: boolean;
|
||||
rootDirectory?: string;
|
||||
rootDirectory?: string | null;
|
||||
meta: Dictionary<string>;
|
||||
gitMetadata?: GitMetadata;
|
||||
regions?: string[];
|
||||
@@ -49,6 +49,7 @@ export interface CreateOptions {
|
||||
deployStamp: () => string;
|
||||
projectSettings?: any;
|
||||
skipAutoDetectionConfirmation?: boolean;
|
||||
noWait?: boolean;
|
||||
}
|
||||
|
||||
export interface RemoveOptions {
|
||||
@@ -128,6 +129,7 @@ export default class Now extends EventEmitter {
|
||||
deployStamp,
|
||||
projectSettings,
|
||||
skipAutoDetectionConfirmation,
|
||||
noWait,
|
||||
}: CreateOptions,
|
||||
org: Org,
|
||||
isSettingUpProject: boolean,
|
||||
@@ -174,6 +176,7 @@ export default class Now extends EventEmitter {
|
||||
cwd,
|
||||
prebuilt,
|
||||
rootDirectory,
|
||||
noWait,
|
||||
});
|
||||
|
||||
if (deployment && deployment.warnings) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import chalk from 'chalk';
|
||||
import frameworkList, { Framework } from '@vercel/frameworks';
|
||||
import Client from '../client';
|
||||
import { isSettingValue } from '../is-setting-value';
|
||||
import { ProjectSettings } from '@vercel-internals/types';
|
||||
import type { ProjectSettings } from '@vercel-internals/types';
|
||||
|
||||
const settingMap = {
|
||||
buildCommand: 'Build Command',
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import pkg from '../../package.json';
|
||||
|
||||
export function isCanary() {
|
||||
return pkg.version.includes('canary');
|
||||
}
|
||||
@@ -12,9 +12,10 @@ export const parseEnv = (env?: string | string[] | Dictionary<string>) => {
|
||||
}
|
||||
|
||||
if (Array.isArray(env)) {
|
||||
const startingDict: Dictionary<string> = {};
|
||||
return env.reduce((o, e) => {
|
||||
let key;
|
||||
let value;
|
||||
let key: string | undefined;
|
||||
let value: string | undefined;
|
||||
const equalsSign = e.indexOf('=');
|
||||
|
||||
if (equalsSign === -1) {
|
||||
@@ -24,9 +25,12 @@ export const parseEnv = (env?: string | string[] | Dictionary<string>) => {
|
||||
value = e.slice(equalsSign + 1);
|
||||
}
|
||||
|
||||
o[key] = value;
|
||||
if (typeof value !== 'undefined') {
|
||||
o[key] = value;
|
||||
}
|
||||
|
||||
return o;
|
||||
}, {} as Dictionary<string | undefined>);
|
||||
}, startingDict);
|
||||
}
|
||||
|
||||
// assume it's already an Object
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import chalk from 'chalk';
|
||||
import Client from '../client';
|
||||
import { ProjectAliasTarget } from '@vercel-internals/types';
|
||||
import type { ProjectAliasTarget } from '@vercel-internals/types';
|
||||
import { isAPIError } from '../errors-ts';
|
||||
|
||||
export async function addDomainToProject(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Client from '../client';
|
||||
import { Project } from '@vercel-internals/types';
|
||||
import type { Project } from '@vercel-internals/types';
|
||||
|
||||
export default async function createProject(
|
||||
client: Client,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Client from '../client';
|
||||
import { Project } from '@vercel-internals/types';
|
||||
import type { Project } from '@vercel-internals/types';
|
||||
import { URLSearchParams } from 'url';
|
||||
import { isAPIError } from '../errors-ts';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Client from '../client';
|
||||
import { Project } from '@vercel-internals/types';
|
||||
import type { Project } from '@vercel-internals/types';
|
||||
import { isAPIError, ProjectNotFound } from '../errors-ts';
|
||||
|
||||
export default async function getProjectByNameOrId(
|
||||
|
||||
@@ -12,7 +12,7 @@ import { InvalidToken, isAPIError, ProjectNotFound } from '../errors-ts';
|
||||
import getUser from '../get-user';
|
||||
import getTeamById from '../teams/get-team-by-id';
|
||||
import { Output } from '../output';
|
||||
import {
|
||||
import type {
|
||||
Project,
|
||||
ProjectLinkResult,
|
||||
Org,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import chalk from 'chalk';
|
||||
import Client from '../client';
|
||||
import { ProjectAliasTarget } from '@vercel-internals/types';
|
||||
import type { ProjectAliasTarget } from '@vercel-internals/types';
|
||||
import { isAPIError } from '../errors-ts';
|
||||
|
||||
export async function removeDomainFromProject(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Team } from '@vercel-internals/types';
|
||||
import type { Team } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
|
||||
export default async function createTeam(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Client from '../client';
|
||||
import { Team } from '@vercel-internals/types';
|
||||
import type { Team } from '@vercel-internals/types';
|
||||
|
||||
const teamCache = new Map<string, Team>();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { URLSearchParams } from 'url';
|
||||
import Client from '../client';
|
||||
import { Team } from '@vercel-internals/types';
|
||||
import type { Team } from '@vercel-internals/types';
|
||||
import { APIError, InvalidToken } from '../errors-ts';
|
||||
|
||||
export interface GetTeamsV1Options {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Team } from '@vercel-internals/types';
|
||||
import type { Team } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
|
||||
export default async function patchTeam(
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user