vercel 30.1.1 → 30.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +52 -39
- package/package.json +8 -8
package/dist/index.js
CHANGED
@@ -225398,7 +225398,6 @@ const path_1 = __webpack_require__(85622);
|
|
225398
225398
|
const chalk_1 = __importDefault(__webpack_require__(90877));
|
225399
225399
|
const url_1 = __webpack_require__(78835);
|
225400
225400
|
const box_1 = __importDefault(__webpack_require__(58587));
|
225401
|
-
const sleep_1 = __importDefault(__webpack_require__(89507));
|
225402
225401
|
const format_date_1 = __importDefault(__webpack_require__(738));
|
225403
225402
|
const link_1 = __importDefault(__webpack_require__(39302));
|
225404
225403
|
const logo_1 = __importDefault(__webpack_require__(66669));
|
@@ -225543,38 +225542,27 @@ async function main(client) {
|
|
225543
225542
|
}
|
225544
225543
|
// Fetch all the project's "READY" deployments with the pagination API
|
225545
225544
|
let deployments = [];
|
225546
|
-
|
225547
|
-
|
225548
|
-
|
225549
|
-
query.set('
|
225550
|
-
|
225551
|
-
|
225552
|
-
|
225553
|
-
|
225554
|
-
|
225555
|
-
|
225556
|
-
|
225557
|
-
}
|
225558
|
-
const res = await client.fetch(`/v6/deployments?${query}`, {
|
225559
|
-
accountId: badDeployment.ownerId,
|
225560
|
-
});
|
225561
|
-
next = res.pagination.next;
|
225562
|
-
let newDeployments = res.deployments;
|
225545
|
+
const query = new url_1.URLSearchParams();
|
225546
|
+
query.set('projectId', projectId);
|
225547
|
+
if (badDeployment.target) {
|
225548
|
+
query.set('target', badDeployment.target);
|
225549
|
+
}
|
225550
|
+
query.set('state', 'READY');
|
225551
|
+
query.set('until', String(badDeployment.createdAt + 1));
|
225552
|
+
for await (const chunk of client.fetchPaginated(`/v6/deployments?${query}`, {
|
225553
|
+
accountId: badDeployment.ownerId,
|
225554
|
+
})) {
|
225555
|
+
let newDeployments = chunk.deployments;
|
225563
225556
|
// If we have the "good" deployment in this chunk, then we're done
|
225564
225557
|
for (let i = 0; i < newDeployments.length; i++) {
|
225565
225558
|
if (newDeployments[i].url === good) {
|
225566
225559
|
// grab all deployments up until the good one
|
225567
225560
|
newDeployments = newDeployments.slice(0, i);
|
225568
|
-
next = undefined;
|
225569
225561
|
break;
|
225570
225562
|
}
|
225571
225563
|
}
|
225572
225564
|
deployments = deployments.concat(newDeployments);
|
225573
|
-
|
225574
|
-
// Small sleep to avoid rate limiting
|
225575
|
-
await (0, sleep_1.default)(100);
|
225576
|
-
}
|
225577
|
-
} while (next);
|
225565
|
+
}
|
225578
225566
|
if (!deployments.length) {
|
225579
225567
|
output.error('Cannot bisect because this project does not have any deployments');
|
225580
225568
|
return 1;
|
@@ -236354,6 +236342,7 @@ const files_1 = __webpack_require__(48695);
|
|
236354
236342
|
const promise_1 = __webpack_require__(60076);
|
236355
236343
|
const errors_ts_1 = __webpack_require__(39240);
|
236356
236344
|
const error_utils_1 = __webpack_require__(39799);
|
236345
|
+
const sleep_1 = __importDefault(__webpack_require__(89507));
|
236357
236346
|
const isSAMLError = (v) => {
|
236358
236347
|
return v && v.saml;
|
236359
236348
|
};
|
@@ -236475,6 +236464,23 @@ class Client extends events_1.EventEmitter {
|
|
236475
236464
|
return contentType.includes('application/json') ? res.json() : res;
|
236476
236465
|
}, opts.retry);
|
236477
236466
|
}
|
236467
|
+
async *fetchPaginated(url, opts) {
|
236468
|
+
const endpoint = typeof url === 'string' ? new url_1.URL(url, this.apiUrl) : new url_1.URL(url.href);
|
236469
|
+
if (!endpoint.searchParams.has('limit')) {
|
236470
|
+
endpoint.searchParams.set('limit', '100');
|
236471
|
+
}
|
236472
|
+
let next;
|
236473
|
+
do {
|
236474
|
+
if (next) {
|
236475
|
+
// Small sleep to avoid rate limiting
|
236476
|
+
await (0, sleep_1.default)(100);
|
236477
|
+
endpoint.searchParams.set('until', String(next));
|
236478
|
+
}
|
236479
|
+
const res = await this.fetch(endpoint.href, opts);
|
236480
|
+
yield res;
|
236481
|
+
next = res.pagination?.next;
|
236482
|
+
} while (next);
|
236483
|
+
}
|
236478
236484
|
_createPromptModule() {
|
236479
236485
|
this.prompt = inquirer_1.default.createPromptModule({
|
236480
236486
|
input: this.stdin,
|
@@ -243301,10 +243307,7 @@ exports.createProxy = void 0;
|
|
243301
243307
|
const http_1 = __webpack_require__(98605);
|
243302
243308
|
const node_fetch_1 = __webpack_require__(91596);
|
243303
243309
|
const node_utils_1 = __webpack_require__(56057);
|
243304
|
-
const toHeaders = (0, node_utils_1.buildToHeaders)({
|
243305
|
-
// @ts-expect-error - `node-fetch` Headers is missing `getAll()`
|
243306
|
-
Headers: node_fetch_1.Headers,
|
243307
|
-
});
|
243310
|
+
const toHeaders = (0, node_utils_1.buildToHeaders)({ Headers: node_fetch_1.Headers });
|
243308
243311
|
function createProxy(client) {
|
243309
243312
|
return (0, http_1.createServer)(async (req, res) => {
|
243310
243313
|
try {
|
@@ -246126,24 +246129,34 @@ async function ensureRepoLink(client, cwd, yes = false) {
|
|
246126
246129
|
}
|
246127
246130
|
const repoUrl = remoteUrls[remoteName];
|
246128
246131
|
output.spinner(`Fetching Projects for ${(0, link_2.default)(repoUrl)} under ${chalk_1.default.bold(org.slug)}…`);
|
246129
|
-
|
246130
|
-
const query = new URLSearchParams({ repoUrl
|
246131
|
-
const
|
246132
|
+
let projects = [];
|
246133
|
+
const query = new URLSearchParams({ repoUrl });
|
246134
|
+
const projectsIterator = client.fetchPaginated(`/v9/projects?${query}`);
|
246135
|
+
let printedFound = false;
|
246136
|
+
for await (const chunk of projectsIterator) {
|
246137
|
+
projects = projects.concat(chunk.projects);
|
246138
|
+
if (!printedFound && projects.length > 0) {
|
246139
|
+
output.log(`${(0, pluralize_1.default)('Project', chunk.projects.length)} linked to ${(0, link_2.default)(repoUrl)} under ${chalk_1.default.bold(org.slug)}:`);
|
246140
|
+
printedFound = true;
|
246141
|
+
}
|
246142
|
+
for (const project of chunk.projects) {
|
246143
|
+
output.print(` * ${chalk_1.default.cyan(`${org.slug}/${project.name}\n`)}`);
|
246144
|
+
}
|
246145
|
+
if (chunk.pagination.next) {
|
246146
|
+
output.spinner(`Found ${chalk_1.default.bold(projects.length)} Projects…`, 0);
|
246147
|
+
}
|
246148
|
+
}
|
246132
246149
|
if (projects.length === 0) {
|
246133
246150
|
output.log(`No Projects are linked to ${(0, link_2.default)(repoUrl)} under ${chalk_1.default.bold(org.slug)}.`);
|
246134
246151
|
// TODO: run detection logic to find potential projects.
|
246135
246152
|
// then prompt user to select valid projects.
|
246136
246153
|
// then create new Projects
|
246137
246154
|
}
|
246138
|
-
else {
|
246139
|
-
output.log(`Found ${chalk_1.default.bold(projects.length)} ${(0, pluralize_1.default)('Project', projects.length)} linked to ${(0, link_2.default)(repoUrl)} under ${chalk_1.default.bold(org.slug)}:`);
|
246140
|
-
}
|
246141
|
-
for (const project of projects) {
|
246142
|
-
output.print(` * ${chalk_1.default.cyan(`${org.slug}/${project.name}\n`)}`);
|
246143
|
-
}
|
246144
246155
|
shouldLink =
|
246145
246156
|
yes ||
|
246146
|
-
(await (0, confirm_1.default)(client, `Link to ${projects.length === 1
|
246157
|
+
(await (0, confirm_1.default)(client, `Link to ${projects.length === 1
|
246158
|
+
? 'this Project'
|
246159
|
+
: `these ${chalk_1.default.bold(projects.length)} Projects`}?`, true));
|
246147
246160
|
if (!shouldLink) {
|
246148
246161
|
output.print(`Canceled. Repository not linked.\n`);
|
246149
246162
|
return;
|
@@ -249930,7 +249943,7 @@ module.exports = JSON.parse("[[[0,44],\"disallowed_STD3_valid\"],[[45,46],\"vali
|
|
249930
249943
|
/***/ ((module) => {
|
249931
249944
|
|
249932
249945
|
"use strict";
|
249933
|
-
module.exports = JSON.parse("{\"name\":\"@vercel/client\",\"version\":\"12.6.
|
249946
|
+
module.exports = JSON.parse("{\"name\":\"@vercel/client\",\"version\":\"12.6.2\",\"main\":\"dist/index.js\",\"typings\":\"dist/index.d.ts\",\"homepage\":\"https://vercel.com\",\"license\":\"Apache-2.0\",\"files\":[\"dist\"],\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/vercel/vercel.git\",\"directory\":\"packages/client\"},\"scripts\":{\"build\":\"tsc\",\"test-e2e\":\"pnpm test tests/create-deployment.test.ts tests/create-legacy-deployment.test.ts tests/paths.test.ts\",\"test\":\"jest --env node --verbose --runInBand --bail\",\"test-unit\":\"pnpm test tests/unit.*test.*\"},\"engines\":{\"node\":\">= 14\"},\"devDependencies\":{\"@types/async-retry\":\"1.4.5\",\"@types/fs-extra\":\"7.0.0\",\"@types/jest\":\"27.4.1\",\"@types/minimatch\":\"3.0.5\",\"@types/ms\":\"0.7.30\",\"@types/node\":\"14.18.33\",\"@types/node-fetch\":\"2.5.4\",\"@types/recursive-readdir\":\"2.2.0\",\"@types/tar-fs\":\"1.16.1\",\"typescript\":\"4.9.5\"},\"dependencies\":{\"@vercel/build-utils\":\"6.7.5\",\"@vercel/routing-utils\":\"2.2.1\",\"@zeit/fetch\":\"5.2.0\",\"async-retry\":\"1.2.3\",\"async-sema\":\"3.0.0\",\"fs-extra\":\"8.0.1\",\"ignore\":\"4.0.6\",\"minimatch\":\"5.0.1\",\"ms\":\"2.1.2\",\"node-fetch\":\"2.6.7\",\"querystring\":\"^0.2.0\",\"sleep-promise\":\"8.0.1\",\"tar-fs\":\"1.16.3\"}}");
|
249934
249947
|
|
249935
249948
|
/***/ }),
|
249936
249949
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vercel",
|
3
|
-
"version": "30.
|
3
|
+
"version": "30.2.0",
|
4
4
|
"preferGlobal": true,
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"description": "The command-line interface for Vercel",
|
@@ -22,16 +22,16 @@
|
|
22
22
|
"node": ">= 14"
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
|
-
"@vercel/build-utils": "6.7.
|
25
|
+
"@vercel/build-utils": "6.7.5",
|
26
26
|
"@vercel/go": "2.5.1",
|
27
27
|
"@vercel/hydrogen": "0.0.64",
|
28
28
|
"@vercel/next": "3.8.6",
|
29
|
-
"@vercel/node": "2.
|
29
|
+
"@vercel/node": "2.15.0",
|
30
30
|
"@vercel/python": "3.1.60",
|
31
31
|
"@vercel/redwood": "1.1.15",
|
32
|
-
"@vercel/remix-builder": "1.8.
|
32
|
+
"@vercel/remix-builder": "1.8.13",
|
33
33
|
"@vercel/ruby": "1.3.76",
|
34
|
-
"@vercel/static-build": "1.3.
|
34
|
+
"@vercel/static-build": "1.3.35"
|
35
35
|
},
|
36
36
|
"devDependencies": {
|
37
37
|
"@alex_neo/jest-expect-message": "1.0.5",
|
@@ -75,10 +75,10 @@
|
|
75
75
|
"@types/which": "3.0.0",
|
76
76
|
"@types/write-json-file": "2.2.1",
|
77
77
|
"@types/yauzl-promise": "2.1.0",
|
78
|
-
"@vercel-internals/constants": "1.0.
|
78
|
+
"@vercel-internals/constants": "1.0.2",
|
79
79
|
"@vercel-internals/get-package-json": "1.0.0",
|
80
|
-
"@vercel-internals/types": "1.0.
|
81
|
-
"@vercel/client": "12.6.
|
80
|
+
"@vercel-internals/types": "1.0.2",
|
81
|
+
"@vercel/client": "12.6.2",
|
82
82
|
"@vercel/error-utils": "1.0.10",
|
83
83
|
"@vercel/frameworks": "1.4.2",
|
84
84
|
"@vercel/fs-detectors": "3.9.3",
|