vercel 36.0.0 → 37.0.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/README.md +1 -1
- package/dist/index.js +263 -290
- package/package.json +4 -4
package/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<p align="center">Develop. Preview. Ship.</p>
|
7
7
|
</p>
|
8
8
|
|
9
|
-
[
|
9
|
+
[Join the Vercel Community](https://vercel.community/)
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
package/dist/index.js
CHANGED
@@ -62540,7 +62540,7 @@ var require_package = __commonJS2({
|
|
62540
62540
|
"../client/package.json"(exports2, module2) {
|
62541
62541
|
module2.exports = {
|
62542
62542
|
name: "@vercel/client",
|
62543
|
-
version: "13.
|
62543
|
+
version: "13.4.0",
|
62544
62544
|
main: "dist/index.js",
|
62545
62545
|
typings: "dist/index.d.ts",
|
62546
62546
|
homepage: "https://vercel.com",
|
@@ -63539,7 +63539,7 @@ var require_utils8 = __commonJS2({
|
|
63539
63539
|
module2.exports = __toCommonJS4(utils_exports);
|
63540
63540
|
var import_fetch2 = require_fetch2();
|
63541
63541
|
var import_path44 = require("path");
|
63542
|
-
var
|
63542
|
+
var import_url23 = require("url");
|
63543
63543
|
var import_ignore = __toESM4(require_ignore());
|
63544
63544
|
var import_pkg5 = require_pkg();
|
63545
63545
|
var import_build_utils19 = require("@vercel/build-utils");
|
@@ -63731,7 +63731,7 @@ ${clearRelative(ignoreFile)}`);
|
|
63731
63731
|
url3 += `${url3.includes("?") ? "&" : "?"}teamId=${VERCEL_TEAM_ID}`;
|
63732
63732
|
}
|
63733
63733
|
if (opts.teamId) {
|
63734
|
-
const parsedUrl = new
|
63734
|
+
const parsedUrl = new import_url23.URL(url3);
|
63735
63735
|
parsedUrl.searchParams.set("teamId", opts.teamId);
|
63736
63736
|
url3 = parsedUrl.toString();
|
63737
63737
|
delete opts.teamId;
|
@@ -63849,9 +63849,9 @@ var require_query_string = __commonJS2({
|
|
63849
63849
|
generateQueryString: () => generateQueryString
|
63850
63850
|
});
|
63851
63851
|
module2.exports = __toCommonJS4(query_string_exports);
|
63852
|
-
var
|
63852
|
+
var import_url23 = require("url");
|
63853
63853
|
function generateQueryString(clientOptions) {
|
63854
|
-
const options = new
|
63854
|
+
const options = new import_url23.URLSearchParams();
|
63855
63855
|
if (clientOptions.teamId) {
|
63856
63856
|
options.set("teamId", clientOptions.teamId);
|
63857
63857
|
}
|
@@ -121961,6 +121961,9 @@ var require_detect_builders = __commonJS2({
|
|
121961
121961
|
var __toCommonJS4 = (mod) => __copyProps4(__defProp4({}, "__esModule", { value: true }), mod);
|
121962
121962
|
var detect_builders_exports = {};
|
121963
121963
|
__export4(detect_builders_exports, {
|
121964
|
+
REGEX_MIDDLEWARE_FILES: () => REGEX_MIDDLEWARE_FILES,
|
121965
|
+
REGEX_NON_VERCEL_PLATFORM_FILES: () => REGEX_NON_VERCEL_PLATFORM_FILES2,
|
121966
|
+
REGEX_VERCEL_PLATFORM_FILES: () => REGEX_VERCEL_PLATFORM_FILES,
|
121964
121967
|
detectApiDirectory: () => detectApiDirectory3,
|
121965
121968
|
detectApiExtensions: () => detectApiExtensions3,
|
121966
121969
|
detectBuilders: () => detectBuilders4,
|
@@ -121973,6 +121976,9 @@ var require_detect_builders = __commonJS2({
|
|
121973
121976
|
var import_path44 = require("path");
|
121974
121977
|
var import_frameworks6 = __toESM4(require_frameworks());
|
121975
121978
|
var import_is_official_runtime = require_is_official_runtime();
|
121979
|
+
var REGEX_MIDDLEWARE_FILES = "middleware.[jt]s";
|
121980
|
+
var REGEX_VERCEL_PLATFORM_FILES = `api/**,package.json,${REGEX_MIDDLEWARE_FILES}`;
|
121981
|
+
var REGEX_NON_VERCEL_PLATFORM_FILES2 = `!{${REGEX_VERCEL_PLATFORM_FILES}}`;
|
121976
121982
|
var slugToFramework = new Map(
|
121977
121983
|
import_frameworks6.default.map((f) => [f.slug, f])
|
121978
121984
|
);
|
@@ -122129,7 +122135,7 @@ var require_detect_builders = __commonJS2({
|
|
122129
122135
|
} else if (apiBuilders.length && hasNoneApiFiles) {
|
122130
122136
|
frontendBuilder = {
|
122131
122137
|
use: "@vercel/static",
|
122132
|
-
src:
|
122138
|
+
src: REGEX_NON_VERCEL_PLATFORM_FILES2,
|
122133
122139
|
config: {
|
122134
122140
|
zeroConfig: true
|
122135
122141
|
}
|
@@ -122251,7 +122257,7 @@ var require_detect_builders = __commonJS2({
|
|
122251
122257
|
const config3 = { zeroConfig: true };
|
122252
122258
|
return [
|
122253
122259
|
{
|
122254
|
-
src:
|
122260
|
+
src: REGEX_MIDDLEWARE_FILES,
|
122255
122261
|
use: `@vercel/node`,
|
122256
122262
|
config: { ...config3, middleware: true }
|
122257
122263
|
},
|
@@ -130185,6 +130191,7 @@ var require_dist27 = __commonJS2({
|
|
130185
130191
|
GetWorkspaceOptions: () => import_get_workspaces.GetWorkspaceOptions,
|
130186
130192
|
GetWorkspacePackagePathsOptions: () => import_get_workspace_package_paths.GetWorkspacePackagePathsOptions,
|
130187
130193
|
LocalFileSystemDetector: () => import_local_file_system_detector.LocalFileSystemDetector,
|
130194
|
+
REGEX_NON_VERCEL_PLATFORM_FILES: () => import_detect_builders2.REGEX_NON_VERCEL_PLATFORM_FILES,
|
130188
130195
|
Workspace: () => import_get_workspaces.Workspace,
|
130189
130196
|
WorkspaceType: () => import_get_workspaces.WorkspaceType,
|
130190
130197
|
detectApiDirectory: () => import_detect_builders.detectApiDirectory,
|
@@ -130219,6 +130226,7 @@ var require_dist27 = __commonJS2({
|
|
130219
130226
|
var import_is_official_runtime = require_is_official_runtime();
|
130220
130227
|
var import_package_managers = require_package_managers();
|
130221
130228
|
__reExport(src_exports2, require_get_monorepo_default_settings(), module2.exports);
|
130229
|
+
var import_detect_builders2 = require_detect_builders();
|
130222
130230
|
}
|
130223
130231
|
});
|
130224
130232
|
|
@@ -130625,7 +130633,7 @@ var require_superstatic = __commonJS2({
|
|
130625
130633
|
sourceToRegex: () => sourceToRegex
|
130626
130634
|
});
|
130627
130635
|
module2.exports = __toCommonJS4(superstatic_exports);
|
130628
|
-
var
|
130636
|
+
var import_url23 = require("url");
|
130629
130637
|
var import_path_to_regexp = require_dist28();
|
130630
130638
|
var UN_NAMED_SEGMENT = "__UN_NAMED_SEGMENT__";
|
130631
130639
|
function getCleanUrls2(filePaths) {
|
@@ -130841,7 +130849,7 @@ var require_superstatic = __commonJS2({
|
|
130841
130849
|
indexes[name] = "$" + name;
|
130842
130850
|
escapedDestination = escapeSegment(escapedDestination, name);
|
130843
130851
|
});
|
130844
|
-
const parsedDestination = (0,
|
130852
|
+
const parsedDestination = (0, import_url23.parse)(escapedDestination, true);
|
130845
130853
|
delete parsedDestination.href;
|
130846
130854
|
delete parsedDestination.path;
|
130847
130855
|
delete parsedDestination.search;
|
@@ -130893,7 +130901,7 @@ var require_superstatic = __commonJS2({
|
|
130893
130901
|
}
|
130894
130902
|
}
|
130895
130903
|
}
|
130896
|
-
destination = (0,
|
130904
|
+
destination = (0, import_url23.format)({
|
130897
130905
|
...rest,
|
130898
130906
|
hostname: hostname2,
|
130899
130907
|
pathname,
|
@@ -131507,7 +131515,7 @@ var require_dist29 = __commonJS2({
|
|
131507
131515
|
normalizeRoutes: () => normalizeRoutes2
|
131508
131516
|
});
|
131509
131517
|
module2.exports = __toCommonJS4(src_exports2);
|
131510
|
-
var
|
131518
|
+
var import_url23 = require("url");
|
131511
131519
|
var import_superstatic = require_superstatic();
|
131512
131520
|
var import_append = require_append();
|
131513
131521
|
var import_merge2 = require_merge3();
|
@@ -131638,7 +131646,7 @@ var require_dist29 = __commonJS2({
|
|
131638
131646
|
}
|
131639
131647
|
if (destination) {
|
131640
131648
|
try {
|
131641
|
-
const { hostname: hostname2, pathname, query } = (0,
|
131649
|
+
const { hostname: hostname2, pathname, query } = (0, import_url23.parse)(destination, true);
|
131642
131650
|
(0, import_superstatic.sourceToRegex)(hostname2 || "").segments.forEach(
|
131643
131651
|
(name) => destinationSegments.add(name)
|
131644
131652
|
);
|
@@ -139465,7 +139473,11 @@ async function getEnvRecords(output2, client2, projectId, source, {
|
|
139465
139473
|
);
|
139466
139474
|
const query = new import_url11.URLSearchParams();
|
139467
139475
|
if (target) {
|
139468
|
-
|
139476
|
+
let targetParam = "target";
|
139477
|
+
if (target !== "production" && target !== "preview" && target !== "development") {
|
139478
|
+
targetParam = "customEnvironmentId";
|
139479
|
+
}
|
139480
|
+
query.set(targetParam, target);
|
139469
139481
|
}
|
139470
139482
|
if (gitBranch) {
|
139471
139483
|
query.set("gitBranch", gitBranch);
|
@@ -143366,7 +143378,7 @@ var init_process_deployment = __esm({
|
|
143366
143378
|
});
|
143367
143379
|
|
143368
143380
|
// src/util/index.ts
|
143369
|
-
var import_events3, import_querystring3, import_url14, import_async_retry5, import_ms8, import_node_fetch3,
|
143381
|
+
var import_events3, import_querystring3, import_url14, import_async_retry5, import_ms8, import_node_fetch3, import_bytes4, import_chalk46, Now;
|
143370
143382
|
var init_util = __esm({
|
143371
143383
|
"src/util/index.ts"() {
|
143372
143384
|
"use strict";
|
@@ -143376,7 +143388,6 @@ var init_util = __esm({
|
|
143376
143388
|
import_async_retry5 = __toESM3(require_dist11());
|
143377
143389
|
import_ms8 = __toESM3(require_ms2());
|
143378
143390
|
import_node_fetch3 = __toESM3(require_lib14());
|
143379
|
-
import_url15 = require("url");
|
143380
143391
|
import_bytes4 = __toESM3(require_bytes());
|
143381
143392
|
import_chalk46 = __toESM3(require_source());
|
143382
143393
|
init_ua();
|
@@ -143575,62 +143586,6 @@ var init_util = __esm({
|
|
143575
143586
|
}
|
143576
143587
|
return new Error(error3.message || error3.errorMessage);
|
143577
143588
|
}
|
143578
|
-
async list(app, { version: version2 = 4, meta = {}, nextTimestamp, target } = {}, prod) {
|
143579
|
-
const fetchRetry = async (url3, options = {}) => {
|
143580
|
-
return this.retry(
|
143581
|
-
async (bail) => {
|
143582
|
-
const res = await this._fetch(url3, options);
|
143583
|
-
if (res.status === 200) {
|
143584
|
-
return res.json();
|
143585
|
-
}
|
143586
|
-
if (res.status > 200 && res.status < 500) {
|
143587
|
-
return bail(await responseError2(res, "Failed to list deployments"));
|
143588
|
-
}
|
143589
|
-
throw await responseError2(res, "Failed to list deployments");
|
143590
|
-
},
|
143591
|
-
{
|
143592
|
-
retries: 3,
|
143593
|
-
minTimeout: 2500,
|
143594
|
-
onRetry: this._onRetry
|
143595
|
-
}
|
143596
|
-
);
|
143597
|
-
};
|
143598
|
-
if (!app && !Object.keys(meta).length) {
|
143599
|
-
const query2 = new import_url15.URLSearchParams({ limit: 20 .toString() });
|
143600
|
-
if (nextTimestamp) {
|
143601
|
-
query2.set("until", String(nextTimestamp));
|
143602
|
-
}
|
143603
|
-
const { projects, pagination } = await fetchRetry(
|
143604
|
-
`/v4/projects/?${query2}`
|
143605
|
-
);
|
143606
|
-
const deployments = await Promise.all(
|
143607
|
-
projects.map(async ({ id: projectId }) => {
|
143608
|
-
const query3 = new import_url15.URLSearchParams({ limit: "1", projectId });
|
143609
|
-
const { deployments: deployments2 } = await fetchRetry(
|
143610
|
-
`/v${version2}/now/deployments?${query3}`
|
143611
|
-
);
|
143612
|
-
return deployments2[0];
|
143613
|
-
})
|
143614
|
-
);
|
143615
|
-
return { deployments: deployments.filter((x) => x), pagination };
|
143616
|
-
}
|
143617
|
-
const query = new import_url15.URLSearchParams();
|
143618
|
-
if (app) {
|
143619
|
-
query.set("app", app);
|
143620
|
-
}
|
143621
|
-
Object.keys(meta).map((key) => query.set(`meta-${key}`, meta[key]));
|
143622
|
-
query.set("limit", "20");
|
143623
|
-
if (nextTimestamp) {
|
143624
|
-
query.set("until", String(nextTimestamp));
|
143625
|
-
}
|
143626
|
-
if (prod) {
|
143627
|
-
query.set("target", "production");
|
143628
|
-
} else if (target) {
|
143629
|
-
query.set("target", target);
|
143630
|
-
}
|
143631
|
-
const response = await fetchRetry(`/v${version2}/now/deployments?${query}`);
|
143632
|
-
return response;
|
143633
|
-
}
|
143634
143589
|
async findDeployment(hostOrId) {
|
143635
143590
|
const { debug: debug3 } = this._output;
|
143636
143591
|
let id = hostOrId && !hostOrId.includes(".");
|
@@ -144089,16 +144044,18 @@ var init_command4 = __esm({
|
|
144089
144044
|
// src/util/parse-target.ts
|
144090
144045
|
function parseTarget({
|
144091
144046
|
output: output2,
|
144092
|
-
|
144093
|
-
|
144094
|
-
prodFlagValue
|
144047
|
+
flagName,
|
144048
|
+
flags
|
144095
144049
|
}) {
|
144050
|
+
const targetFlagName = `--${flagName}`;
|
144051
|
+
const targetFlagValue = flags[targetFlagName];
|
144052
|
+
const prodFlagValue = flags["--prod"];
|
144096
144053
|
if (prodFlagValue && targetFlagValue) {
|
144097
144054
|
output2.warn(
|
144098
|
-
`Both \`--prod\` and
|
144055
|
+
`Both \`--prod\` and \`${targetFlagName}\` detected. Ignoring \`--prod\`.`
|
144099
144056
|
);
|
144100
144057
|
}
|
144101
|
-
if (targetFlagValue) {
|
144058
|
+
if (typeof targetFlagValue === "string") {
|
144102
144059
|
const lowerCaseTarget = targetFlagValue.toLowerCase();
|
144103
144060
|
output2.debug(`Setting target to ${lowerCaseTarget}`);
|
144104
144061
|
return lowerCaseTarget;
|
@@ -144161,8 +144118,8 @@ async function main(client2) {
|
|
144161
144118
|
const autoConfirm = Boolean(parsedArgs.flags["--yes"]);
|
144162
144119
|
const environment = parseTarget({
|
144163
144120
|
output: client2.output,
|
144164
|
-
|
144165
|
-
|
144121
|
+
flagName: "environment",
|
144122
|
+
flags: parsedArgs.flags
|
144166
144123
|
}) || "development";
|
144167
144124
|
const link4 = await ensureLink("pull", client2, cwd, { autoConfirm });
|
144168
144125
|
if (typeof link4 === "number") {
|
@@ -147852,7 +147809,7 @@ async function installBuilders(buildersDir, buildersToAdd, output2) {
|
|
147852
147809
|
} else {
|
147853
147810
|
const notFound = /GET (.*) - Not found/.exec(message2);
|
147854
147811
|
if (notFound) {
|
147855
|
-
const url3 = new
|
147812
|
+
const url3 = new import_url15.URL(notFound[1]);
|
147856
147813
|
const packageName2 = decodeURIComponent(url3.pathname.slice(1));
|
147857
147814
|
message2 = `The package ${code(
|
147858
147815
|
packageName2
|
@@ -147900,11 +147857,11 @@ function getErrorMessage(err, execaMessage) {
|
|
147900
147857
|
}
|
147901
147858
|
return execaMessage;
|
147902
147859
|
}
|
147903
|
-
var
|
147860
|
+
var import_url15, import_pluralize4, import_npm_package_arg, import_semver2, import_path25, import_module2, import_fs_extra16, import_fs_detectors2, import_execa3, import_error_utils16, require_;
|
147904
147861
|
var init_import_builders = __esm({
|
147905
147862
|
"src/util/build/import-builders.ts"() {
|
147906
147863
|
"use strict";
|
147907
|
-
|
147864
|
+
import_url15 = require("url");
|
147908
147865
|
import_pluralize4 = __toESM3(require_pluralize());
|
147909
147866
|
import_npm_package_arg = __toESM3(require_npa());
|
147910
147867
|
import_semver2 = __toESM3(require_semver());
|
@@ -148330,9 +148287,8 @@ async function main2(client2) {
|
|
148330
148287
|
}
|
148331
148288
|
const target = parseTarget({
|
148332
148289
|
output: output2,
|
148333
|
-
|
148334
|
-
|
148335
|
-
prodFlagValue: parsedArgs.flags["--prod"]
|
148290
|
+
flagName: "target",
|
148291
|
+
flags: parsedArgs.flags
|
148336
148292
|
}) || "preview";
|
148337
148293
|
const yes = Boolean(parsedArgs.flags["--yes"]);
|
148338
148294
|
try {
|
@@ -150298,9 +150254,8 @@ var init_deploy = __esm({
|
|
150298
150254
|
}
|
150299
150255
|
const target = parseTarget({
|
150300
150256
|
output: output2,
|
150301
|
-
|
150302
|
-
|
150303
|
-
prodFlagValue: parsedArguments.flags["--prod"]
|
150257
|
+
flagName: "target",
|
150258
|
+
flags: parsedArguments.flags
|
150304
150259
|
});
|
150305
150260
|
const archive = parsedArguments.flags["--archive"];
|
150306
150261
|
if (typeof archive === "string" && !isValidArchive(archive)) {
|
@@ -166595,7 +166550,7 @@ function getRoutesTypes(routes2 = []) {
|
|
166595
166550
|
}
|
166596
166551
|
async function devRouter(reqUrl = "/", reqMethod, routes2, devServer, vercelConfig, previousHeaders, missRoutes, phase) {
|
166597
166552
|
let result;
|
166598
|
-
let { pathname: reqPathname, search: reqSearch } =
|
166553
|
+
let { pathname: reqPathname, search: reqSearch } = import_url16.default.parse(reqUrl);
|
166599
166554
|
reqPathname = reqPathname || "/";
|
166600
166555
|
const reqQuery = parseQueryString(reqSearch);
|
166601
166556
|
const combinedHeaders = { ...previousHeaders };
|
@@ -166643,7 +166598,7 @@ async function devRouter(reqUrl = "/", reqMethod, routes2, devServer, vercelConf
|
|
166643
166598
|
}
|
166644
166599
|
const isDestUrl = isURL(destPath);
|
166645
166600
|
if (routeConfig.check && devServer && vercelConfig && phase !== "hit" && !isDestUrl) {
|
166646
|
-
let { pathname } =
|
166601
|
+
let { pathname } = import_url16.default.parse(destPath);
|
166647
166602
|
pathname = pathname || "/";
|
166648
166603
|
const hasDestFile = await devServer.hasFilesystem(
|
166649
166604
|
pathname,
|
@@ -166696,7 +166651,7 @@ async function devRouter(reqUrl = "/", reqMethod, routes2, devServer, vercelConf
|
|
166696
166651
|
if (!destPath.startsWith("/")) {
|
166697
166652
|
destPath = `/${destPath}`;
|
166698
166653
|
}
|
166699
|
-
let { pathname: destPathname, search: destSearch } =
|
166654
|
+
let { pathname: destPathname, search: destSearch } = import_url16.default.parse(destPath);
|
166700
166655
|
destPathname = destPathname || "/";
|
166701
166656
|
const destQuery = parseQueryString(destSearch);
|
166702
166657
|
Object.assign(destQuery, reqQuery);
|
@@ -166732,11 +166687,11 @@ async function devRouter(reqUrl = "/", reqMethod, routes2, devServer, vercelConf
|
|
166732
166687
|
}
|
166733
166688
|
return result;
|
166734
166689
|
}
|
166735
|
-
var
|
166690
|
+
var import_url16, import_pcre_to_regexp, import_routing_utils3;
|
166736
166691
|
var init_router = __esm({
|
166737
166692
|
"src/util/dev/router.ts"() {
|
166738
166693
|
"use strict";
|
166739
|
-
|
166694
|
+
import_url16 = __toESM3(require("url"));
|
166740
166695
|
import_pcre_to_regexp = __toESM3(require_dist31());
|
166741
166696
|
init_is_url();
|
166742
166697
|
import_routing_utils3 = __toESM3(require_dist29());
|
@@ -167517,7 +167472,7 @@ function parseListen(str, defaultPort = 3e3) {
|
|
167517
167472
|
if (!isNaN(port)) {
|
167518
167473
|
return [port];
|
167519
167474
|
}
|
167520
|
-
const url3 = (0,
|
167475
|
+
const url3 = (0, import_url17.parse)(str);
|
167521
167476
|
switch (url3.protocol) {
|
167522
167477
|
case "pipe:": {
|
167523
167478
|
const cutStr = str.replace(/^pipe:/, "");
|
@@ -167552,11 +167507,11 @@ function parseListen(str, defaultPort = 3e3) {
|
|
167552
167507
|
function replaceLocalhost(address) {
|
167553
167508
|
return address.replace("[::]", "localhost").replace("0.0.0.0", "localhost");
|
167554
167509
|
}
|
167555
|
-
var
|
167510
|
+
var import_url17;
|
167556
167511
|
var init_parse_listen = __esm({
|
167557
167512
|
"src/util/dev/parse-listen.ts"() {
|
167558
167513
|
"use strict";
|
167559
|
-
|
167514
|
+
import_url17 = require("url");
|
167560
167515
|
}
|
167561
167516
|
});
|
167562
167517
|
|
@@ -167784,11 +167739,11 @@ function buildMatchEquals(a, b) {
|
|
167784
167739
|
return false;
|
167785
167740
|
return true;
|
167786
167741
|
}
|
167787
|
-
var
|
167742
|
+
var import_url18, import_http3, import_fs_extra21, import_chalk58, import_node_fetch5, import_pluralize7, import_raw_body, import_async_listen3, import_minimatch4, import_http_proxy, import_crypto3, import_serve_handler, import_chokidar, import_dotenv2, import_path36, import_once, import_directory, import_get_port, import_is_port_reachable, import_fast_deep_equal, import_npm_package_arg2, import_json_parse_better_errors3, import_client11, import_routing_utils5, import_build_utils17, import_fs_detectors6, import_frameworks5, import_error_utils19, frontendRuntimeSet, DevServer;
|
167788
167743
|
var init_server = __esm({
|
167789
167744
|
"src/util/dev/server.ts"() {
|
167790
167745
|
"use strict";
|
167791
|
-
|
167746
|
+
import_url18 = __toESM3(require("url"));
|
167792
167747
|
import_http3 = __toESM3(require("http"));
|
167793
167748
|
import_fs_extra21 = __toESM3(require_lib());
|
167794
167749
|
import_chalk58 = __toESM3(require_source());
|
@@ -167908,7 +167863,7 @@ var init_server = __esm({
|
|
167908
167863
|
*/
|
167909
167864
|
this.serveProjectAsNowV2 = async (req, res, requestId, vercelConfig, routes2 = vercelConfig.routes, callLevel = 0) => {
|
167910
167865
|
const { debug: debug3 } = this.output;
|
167911
|
-
const parsed =
|
167866
|
+
const parsed = import_url18.default.parse(req.url || "/");
|
167912
167867
|
if (typeof parsed.pathname === "string" && parsed.pathname.includes("//")) {
|
167913
167868
|
let location = parsed.pathname.replace(/\/+/g, "/");
|
167914
167869
|
if (parsed.search) {
|
@@ -167931,11 +167886,11 @@ var init_server = __esm({
|
|
167931
167886
|
const getReqUrl = (rr) => {
|
167932
167887
|
if (rr.dest) {
|
167933
167888
|
if (rr.query) {
|
167934
|
-
const destParsed =
|
167889
|
+
const destParsed = import_url18.default.parse(rr.dest);
|
167935
167890
|
const destQuery = parseQueryString(destParsed.search);
|
167936
167891
|
Object.assign(destQuery, rr.query);
|
167937
167892
|
destParsed.search = formatQueryString(destQuery);
|
167938
|
-
return
|
167893
|
+
return import_url18.default.format(destParsed);
|
167939
167894
|
}
|
167940
167895
|
return rr.dest;
|
167941
167896
|
}
|
@@ -168047,7 +168002,7 @@ var init_server = __esm({
|
|
168047
168002
|
prevUrl = rewritePath;
|
168048
168003
|
const beforeRewriteUrl = req.url || "/";
|
168049
168004
|
if (isURL(rewritePath)) {
|
168050
|
-
const rewriteUrlParsed = new
|
168005
|
+
const rewriteUrlParsed = new import_url18.URL(rewritePath);
|
168051
168006
|
if (this.address.origin === rewriteUrlParsed.origin) {
|
168052
168007
|
req.url = rewritePath.slice(rewriteUrlParsed.origin.length) || "/";
|
168053
168008
|
prevUrl = req.url;
|
@@ -168058,9 +168013,9 @@ var init_server = __esm({
|
|
168058
168013
|
return;
|
168059
168014
|
}
|
168060
168015
|
} else {
|
168061
|
-
const rewriteUrlParsed =
|
168062
|
-
rewriteUrlParsed.search =
|
168063
|
-
req.url =
|
168016
|
+
const rewriteUrlParsed = import_url18.default.parse(beforeRewriteUrl);
|
168017
|
+
rewriteUrlParsed.search = import_url18.default.parse(rewritePath).search;
|
168018
|
+
req.url = import_url18.default.format(rewriteUrlParsed);
|
168064
168019
|
}
|
168065
168020
|
debug3(
|
168066
168021
|
`Rewrote incoming HTTP URL from "${beforeRewriteUrl}" to "${req.url}"`
|
@@ -168113,11 +168068,11 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
168113
168068
|
}
|
168114
168069
|
}
|
168115
168070
|
if (routeResult.isDestUrl) {
|
168116
|
-
const destParsed =
|
168071
|
+
const destParsed = import_url18.default.parse(routeResult.dest);
|
168117
168072
|
const destQuery = parseQueryString(destParsed.search);
|
168118
168073
|
Object.assign(destQuery, routeResult.query);
|
168119
168074
|
destParsed.search = formatQueryString(destQuery);
|
168120
|
-
const destUrl =
|
168075
|
+
const destUrl = import_url18.default.format(destParsed);
|
168121
168076
|
debug3(`ProxyPass: ${destUrl}`);
|
168122
168077
|
this.setResponseHeaders(res, requestId);
|
168123
168078
|
return proxyPass(req, res, destUrl, this, requestId);
|
@@ -168256,12 +168211,12 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
168256
168211
|
req.headers[name] = value;
|
168257
168212
|
}
|
168258
168213
|
this.setResponseHeaders(res, requestId);
|
168259
|
-
const origUrl =
|
168214
|
+
const origUrl = import_url18.default.parse(req.url || "/");
|
168260
168215
|
const origQuery = parseQueryString(origUrl.search);
|
168261
168216
|
origUrl.pathname = dest;
|
168262
168217
|
Object.assign(origQuery, query);
|
168263
168218
|
origUrl.search = formatQueryString(origQuery);
|
168264
|
-
req.url =
|
168219
|
+
req.url = import_url18.default.format(origUrl);
|
168265
168220
|
return proxyPass(req, res, upstream, this, requestId, false);
|
168266
168221
|
}
|
168267
168222
|
if (statusCode === 404 && routeResult.phase === "miss" || !this.renderDirectoryListing(req, res, requestPath, requestId)) {
|
@@ -168272,12 +168227,12 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
168272
168227
|
const buildRequestPath = match.buildResults.has(null) ? null : requestPath;
|
168273
168228
|
const buildResult = match.buildResults.get(buildRequestPath);
|
168274
168229
|
if (buildResult && Array.isArray(buildResult.routes) && buildResult.routes.length > 0) {
|
168275
|
-
const origUrl =
|
168230
|
+
const origUrl = import_url18.default.parse(req.url || "/");
|
168276
168231
|
const origQuery = parseQueryString(origUrl.search);
|
168277
168232
|
origUrl.pathname = dest;
|
168278
168233
|
Object.assign(origQuery, query);
|
168279
168234
|
origUrl.search = formatQueryString(origQuery);
|
168280
|
-
const newUrl =
|
168235
|
+
const newUrl = import_url18.default.format(origUrl);
|
168281
168236
|
debug3(
|
168282
168237
|
`Checking build result's ${buildResult.routes.length} \`routes\` to match ${newUrl}`
|
168283
168238
|
);
|
@@ -168353,11 +168308,11 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
168353
168308
|
debug3(
|
168354
168309
|
`Proxying to "${builderPkg.name}" dev server (port=${port}, pid=${pid})`
|
168355
168310
|
);
|
168356
|
-
const origUrl =
|
168311
|
+
const origUrl = import_url18.default.parse(req.url || "/");
|
168357
168312
|
const origQuery = parseQueryString(origUrl.search);
|
168358
168313
|
Object.assign(origQuery, query);
|
168359
168314
|
origUrl.search = formatQueryString(origQuery);
|
168360
|
-
req.url =
|
168315
|
+
req.url = import_url18.default.format({
|
168361
168316
|
pathname: origUrl.pathname,
|
168362
168317
|
search: origUrl.search
|
168363
168318
|
});
|
@@ -168436,11 +168391,11 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
168436
168391
|
return;
|
168437
168392
|
}
|
168438
168393
|
requestId = generateRequestId(this.podId, true);
|
168439
|
-
const origUrl =
|
168394
|
+
const origUrl = import_url18.default.parse(req.url || "/");
|
168440
168395
|
const origQuery = parseQueryString(origUrl.search);
|
168441
168396
|
Object.assign(origQuery, query);
|
168442
168397
|
origUrl.search = formatQueryString(origQuery);
|
168443
|
-
const path11 =
|
168398
|
+
const path11 = import_url18.default.format({
|
168444
168399
|
pathname: origUrl.pathname,
|
168445
168400
|
search: origUrl.search
|
168446
168401
|
});
|
@@ -169061,7 +169016,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
169061
169016
|
}
|
169062
169017
|
}
|
169063
169018
|
}
|
169064
|
-
this._address = new
|
169019
|
+
this._address = new import_url18.URL(replaceLocalhost(address));
|
169065
169020
|
const vercelConfig = await this.getVercelConfig();
|
169066
169021
|
const devCommandPromise = this.runDevCommand();
|
169067
169022
|
const files = await staticFiles(this.cwd, { output: this.output });
|
@@ -172922,14 +172877,6 @@ async function ls5(client2, project, opts, args2, output2) {
|
|
172922
172877
|
return 1;
|
172923
172878
|
}
|
172924
172879
|
const [envTarget, envGitBranch] = args2;
|
172925
|
-
if (!isValidEnvTarget(envTarget)) {
|
172926
|
-
output2.error(
|
172927
|
-
`The Environment ${param(
|
172928
|
-
envTarget
|
172929
|
-
)} is invalid. It must be one of: ${getEnvTargetPlaceholder()}.`
|
172930
|
-
);
|
172931
|
-
return 1;
|
172932
|
-
}
|
172933
172880
|
const lsStamp = stamp_default();
|
172934
172881
|
const [envsResult, customEnvs] = await Promise.all([
|
172935
172882
|
getEnvRecords(output2, client2, project.id, "vercel-cli:env:ls", {
|
@@ -173018,7 +172965,6 @@ var init_ls5 = __esm({
|
|
173018
172965
|
init_get_env_records();
|
173019
172966
|
init_env_target();
|
173020
172967
|
init_stamp();
|
173021
|
-
init_param();
|
173022
172968
|
init_pkg_name();
|
173023
172969
|
init_ellipsis();
|
173024
172970
|
import_error_utils23 = __toESM3(require_dist2());
|
@@ -173360,8 +173306,8 @@ async function main6(client2) {
|
|
173360
173306
|
const { cwd, config: config3 } = client2;
|
173361
173307
|
const target = parseTarget({
|
173362
173308
|
output: output2,
|
173363
|
-
|
173364
|
-
|
173309
|
+
flagName: "environment",
|
173310
|
+
flags: parsedArgs.flags
|
173365
173311
|
}) || "development";
|
173366
173312
|
const link4 = await getLinkedProject(client2, cwd);
|
173367
173313
|
if (link4.status === "error") {
|
@@ -174775,7 +174721,7 @@ async function inspect3(client2) {
|
|
174775
174721
|
const withLogs = parsedArguments.flags["--logs"];
|
174776
174722
|
const startTimestamp = Date.now();
|
174777
174723
|
try {
|
174778
|
-
deploymentIdOrHost = new
|
174724
|
+
deploymentIdOrHost = new import_url19.URL(deploymentIdOrHost).hostname;
|
174779
174725
|
} catch {
|
174780
174726
|
}
|
174781
174727
|
client2.output.spinner(
|
@@ -174920,7 +174866,7 @@ function exitCode(state) {
|
|
174920
174866
|
}
|
174921
174867
|
return 0;
|
174922
174868
|
}
|
174923
|
-
var import_error_utils25, import_chalk89, import_ms17, import_title6,
|
174869
|
+
var import_error_utils25, import_chalk89, import_ms17, import_title6, import_url19;
|
174924
174870
|
var init_inspect2 = __esm({
|
174925
174871
|
"src/commands/inspect/index.ts"() {
|
174926
174872
|
"use strict";
|
@@ -174928,7 +174874,7 @@ var init_inspect2 = __esm({
|
|
174928
174874
|
import_chalk89 = __toESM3(require_source());
|
174929
174875
|
import_ms17 = __toESM3(require_ms2());
|
174930
174876
|
import_title6 = __toESM3(require_lib17());
|
174931
|
-
|
174877
|
+
import_url19 = require("url");
|
174932
174878
|
init_is_deploying();
|
174933
174879
|
init_logs();
|
174934
174880
|
init_error2();
|
@@ -175069,6 +175015,27 @@ var init_link3 = __esm({
|
|
175069
175015
|
}
|
175070
175016
|
});
|
175071
175017
|
|
175018
|
+
// src/util/parse-policy.ts
|
175019
|
+
function parsePolicy(policy) {
|
175020
|
+
if (!policy) {
|
175021
|
+
return {};
|
175022
|
+
}
|
175023
|
+
if (typeof policy === "string") {
|
175024
|
+
policy = [policy];
|
175025
|
+
}
|
175026
|
+
const parsed = {};
|
175027
|
+
for (const item of policy) {
|
175028
|
+
const [key, ...rest] = item.split("=");
|
175029
|
+
parsed[key] = rest.join("=");
|
175030
|
+
}
|
175031
|
+
return parsed;
|
175032
|
+
}
|
175033
|
+
var init_parse_policy = __esm({
|
175034
|
+
"src/util/parse-policy.ts"() {
|
175035
|
+
"use strict";
|
175036
|
+
}
|
175037
|
+
});
|
175038
|
+
|
175072
175039
|
// src/commands/list/command.ts
|
175073
175040
|
var listCommand;
|
175074
175041
|
var init_command16 = __esm({
|
@@ -175094,6 +175061,14 @@ var init_command16 = __esm({
|
|
175094
175061
|
type: [String],
|
175095
175062
|
deprecated: false
|
175096
175063
|
},
|
175064
|
+
{
|
175065
|
+
name: "policy",
|
175066
|
+
description: "See deployments with provided Deployment Retention policies (e.g.: `-p KEY=value`). Can appear many times.",
|
175067
|
+
argument: "KEY=value",
|
175068
|
+
shorthand: "p",
|
175069
|
+
type: [String],
|
175070
|
+
deprecated: false
|
175071
|
+
},
|
175097
175072
|
{
|
175098
175073
|
name: "environment",
|
175099
175074
|
description: "",
|
@@ -175141,8 +175116,17 @@ __export3(list_exports, {
|
|
175141
175116
|
getDeploymentDuration: () => getDeploymentDuration,
|
175142
175117
|
stateString: () => stateString2
|
175143
175118
|
});
|
175119
|
+
function toDate(timestamp) {
|
175120
|
+
const date = new Date(timestamp);
|
175121
|
+
const options = {
|
175122
|
+
year: "2-digit",
|
175123
|
+
month: "2-digit",
|
175124
|
+
day: "2-digit"
|
175125
|
+
};
|
175126
|
+
return date.toLocaleDateString("en-US", options);
|
175127
|
+
}
|
175144
175128
|
async function list2(client2) {
|
175145
|
-
const {
|
175129
|
+
const { print, log: log2, warn, error: error3, note, debug: debug3, spinner } = client2.output;
|
175146
175130
|
let parsedArgs = null;
|
175147
175131
|
const flagsSpecification = getFlagsSpecification(listCommand.options);
|
175148
175132
|
try {
|
@@ -175152,191 +175136,181 @@ async function list2(client2) {
|
|
175152
175136
|
return 1;
|
175153
175137
|
}
|
175154
175138
|
if (parsedArgs.flags["--help"]) {
|
175155
|
-
|
175139
|
+
print(help2(listCommand, { columns: client2.stderr.columns }));
|
175156
175140
|
return 2;
|
175157
175141
|
}
|
175158
175142
|
if ("--confirm" in parsedArgs.flags) {
|
175159
|
-
|
175143
|
+
warn("`--confirm` is deprecated, please use `--yes` instead");
|
175160
175144
|
parsedArgs.flags["--yes"] = parsedArgs.flags["--confirm"];
|
175161
175145
|
}
|
175162
|
-
const { print, log: log2, error: error3, note, debug: debug3, spinner } = output2;
|
175163
175146
|
if (parsedArgs.args.length > 2) {
|
175164
175147
|
error3(`${getCommandName("ls [app]")} accepts at most one argument`);
|
175165
175148
|
return 1;
|
175166
175149
|
}
|
175167
175150
|
const autoConfirm = !!parsedArgs.flags["--yes"];
|
175168
175151
|
const meta = parseMeta(parsedArgs.flags["--meta"]);
|
175152
|
+
const policy = parsePolicy(parsedArgs.flags["--policy"]);
|
175169
175153
|
const target = parseTarget({
|
175170
|
-
output:
|
175171
|
-
|
175172
|
-
|
175173
|
-
prodFlagValue: parsedArgs.flags["--prod"]
|
175154
|
+
output: client2.output,
|
175155
|
+
flagName: "environment",
|
175156
|
+
flags: parsedArgs.flags
|
175174
175157
|
});
|
175175
|
-
let
|
175176
|
-
|
175177
|
-
return link4.exitCode;
|
175178
|
-
}
|
175179
|
-
let { org, project, status } = link4;
|
175180
|
-
const appArg = parsedArgs.args[1];
|
175181
|
-
let app = appArg || project?.name;
|
175182
|
-
let host = void 0;
|
175183
|
-
if (app && !isValidName(app)) {
|
175184
|
-
error3(`The provided argument "${app}" is not a valid project name`);
|
175185
|
-
return 1;
|
175186
|
-
}
|
175187
|
-
if (status === "not_linked" && !app) {
|
175188
|
-
const linkedProject = await ensureLink("list", client2, cwd, {
|
175189
|
-
autoConfirm,
|
175190
|
-
link: link4
|
175191
|
-
});
|
175192
|
-
if (typeof linkedProject === "number") {
|
175193
|
-
return linkedProject;
|
175194
|
-
}
|
175195
|
-
org = linkedProject.org;
|
175196
|
-
project = linkedProject.project;
|
175197
|
-
app = project.name;
|
175198
|
-
}
|
175158
|
+
let project;
|
175159
|
+
let pagination;
|
175199
175160
|
let contextName;
|
175200
|
-
let
|
175201
|
-
|
175202
|
-
|
175203
|
-
|
175204
|
-
if ((
|
175205
|
-
error3(
|
175161
|
+
let app = parsedArgs.args[1];
|
175162
|
+
let deployments = [];
|
175163
|
+
let singleDeployment = false;
|
175164
|
+
if (app) {
|
175165
|
+
if (!isValidName(app)) {
|
175166
|
+
error3(`The provided argument "${app}" is not a valid project name`);
|
175167
|
+
return 1;
|
175168
|
+
}
|
175169
|
+
if (app.includes(".")) {
|
175170
|
+
try {
|
175171
|
+
({ contextName } = await getScope(client2));
|
175172
|
+
} catch (err) {
|
175173
|
+
if ((0, import_error_utils26.isErrnoException)(err) && (err.code === "NOT_AUTHORIZED" || err.code === "TEAM_DELETED")) {
|
175174
|
+
error3(err.message);
|
175175
|
+
return 1;
|
175176
|
+
}
|
175177
|
+
}
|
175178
|
+
if (!contextName) {
|
175179
|
+
error3("No context name found");
|
175180
|
+
return 1;
|
175181
|
+
}
|
175182
|
+
const host = toHost(app);
|
175183
|
+
const deployment = await getDeployment(client2, contextName, host);
|
175184
|
+
if (!deployment.projectId) {
|
175185
|
+
error3(`Could not find a deployment for "${host}"`);
|
175186
|
+
return 1;
|
175187
|
+
}
|
175188
|
+
app = deployment.projectId;
|
175189
|
+
note(
|
175190
|
+
`We suggest using ${getCommandName(
|
175191
|
+
"inspect <deployment>"
|
175192
|
+
)} for retrieving details about a single deployment`
|
175193
|
+
);
|
175194
|
+
deployments.push(deployment);
|
175195
|
+
singleDeployment = true;
|
175196
|
+
}
|
175197
|
+
project = await getProjectByNameOrId(client2, app);
|
175198
|
+
if (project instanceof ProjectNotFound) {
|
175199
|
+
error3(`The provided argument "${app}" is not a valid project name`);
|
175206
175200
|
return 1;
|
175207
175201
|
}
|
175208
|
-
}
|
175209
|
-
if (parsedArgs.flags["--scope"]) {
|
175210
|
-
client2.config.currentTeam = team?.id || void 0;
|
175211
|
-
if (team?.slug)
|
175212
|
-
contextName = team.slug;
|
175213
175202
|
} else {
|
175214
|
-
|
175215
|
-
|
175216
|
-
|
175203
|
+
const link4 = await ensureLink("list", client2, client2.cwd, {
|
175204
|
+
autoConfirm
|
175205
|
+
});
|
175206
|
+
if (typeof link4 === "number")
|
175207
|
+
return link4;
|
175208
|
+
project = link4.project;
|
175209
|
+
client2.config.currentTeam = link4.org.id;
|
175210
|
+
}
|
175211
|
+
if (!contextName) {
|
175212
|
+
try {
|
175213
|
+
({ contextName } = await getScope(client2));
|
175214
|
+
} catch (err) {
|
175215
|
+
if ((0, import_error_utils26.isErrnoException)(err) && (err.code === "NOT_AUTHORIZED" || err.code === "TEAM_DELETED")) {
|
175216
|
+
error3(err.message);
|
175217
|
+
return 1;
|
175218
|
+
}
|
175219
|
+
}
|
175217
175220
|
}
|
175218
|
-
const { currentTeam } = config3;
|
175219
|
-
({ contextName } = await getScope(client2));
|
175220
175221
|
const nextTimestamp = parsedArgs.flags["--next"];
|
175221
|
-
if (
|
175222
|
+
if (Number.isNaN(nextTimestamp)) {
|
175222
175223
|
error3("Please provide a number for flag `--next`");
|
175223
175224
|
return 1;
|
175224
175225
|
}
|
175225
|
-
|
175226
|
-
const
|
175227
|
-
|
175228
|
-
|
175226
|
+
const projectUrl = `https://vercel.com/${contextName}/${project.name}`;
|
175227
|
+
const projectSlugBold = import_chalk90.default.bold(`${contextName}/${project.name}`);
|
175228
|
+
const projectSlugLink = client2.output.link(projectSlugBold, projectUrl, {
|
175229
|
+
fallback: () => projectSlugBold,
|
175230
|
+
color: false
|
175229
175231
|
});
|
175230
|
-
|
175231
|
-
|
175232
|
-
|
175233
|
-
|
175234
|
-
|
175235
|
-
|
175236
|
-
|
175237
|
-
note(
|
175238
|
-
`We suggest using ${getCommandName(
|
175239
|
-
"inspect <deployment>"
|
175240
|
-
)} for retrieving details about a single deployment`
|
175241
|
-
);
|
175242
|
-
const hostParts = asHost.split("-");
|
175243
|
-
if (hostParts.length < 2) {
|
175244
|
-
error3("Only deployment hostnames are allowed, no aliases");
|
175245
|
-
return 1;
|
175232
|
+
if (!singleDeployment) {
|
175233
|
+
spinner(`Fetching deployments in ${import_chalk90.default.bold(contextName)}`);
|
175234
|
+
const start = Date.now();
|
175235
|
+
debug3("Fetching deployments");
|
175236
|
+
const query = new URLSearchParams({ limit: "20", projectId: project.id });
|
175237
|
+
for (const [k, v] of Object.entries(meta)) {
|
175238
|
+
query.set(`meta-${k}`, v);
|
175246
175239
|
}
|
175247
|
-
|
175248
|
-
|
175249
|
-
}
|
175250
|
-
debug3("Fetching deployments");
|
175251
|
-
const response = await now.list(app, {
|
175252
|
-
version: 6,
|
175253
|
-
meta,
|
175254
|
-
nextTimestamp,
|
175255
|
-
target
|
175256
|
-
});
|
175257
|
-
let {
|
175258
|
-
deployments,
|
175259
|
-
pagination
|
175260
|
-
} = response;
|
175261
|
-
let showUsername = false;
|
175262
|
-
for (const deployment of deployments) {
|
175263
|
-
const username = deployment.creator?.username;
|
175264
|
-
if (username !== contextName) {
|
175265
|
-
showUsername = true;
|
175240
|
+
for (const [k, v] of Object.entries(policy)) {
|
175241
|
+
query.set(`policy-${k}`, v);
|
175266
175242
|
}
|
175267
|
-
|
175268
|
-
|
175269
|
-
|
175270
|
-
|
175271
|
-
|
175272
|
-
|
175273
|
-
|
175274
|
-
|
175275
|
-
|
175276
|
-
if (
|
175277
|
-
|
175278
|
-
} else {
|
175279
|
-
throw err;
|
175243
|
+
if (nextTimestamp) {
|
175244
|
+
query.set("until", String(nextTimestamp));
|
175245
|
+
}
|
175246
|
+
if (target) {
|
175247
|
+
query.set("target", target);
|
175248
|
+
}
|
175249
|
+
for await (const chunk of client2.fetchPaginated(`/v6/deployments?${query}`)) {
|
175250
|
+
deployments.push(...chunk.deployments);
|
175251
|
+
pagination = chunk.pagination;
|
175252
|
+
if (deployments.length >= 20) {
|
175253
|
+
break;
|
175280
175254
|
}
|
175281
175255
|
}
|
175282
|
-
if (
|
175283
|
-
|
175284
|
-
|
175256
|
+
if (!deployments.length) {
|
175257
|
+
log2(`No deployments found.`);
|
175258
|
+
return 0;
|
175285
175259
|
}
|
175260
|
+
log2(
|
175261
|
+
`${target === "production" ? `Production deployments` : `Deployments`} for ${projectSlugLink} ${elapsed(Date.now() - start)}`
|
175262
|
+
);
|
175286
175263
|
}
|
175287
|
-
|
175288
|
-
|
175289
|
-
|
175290
|
-
|
175291
|
-
if (
|
175292
|
-
|
175293
|
-
return 0;
|
175294
|
-
}
|
175295
|
-
log2(
|
175296
|
-
`${target === "production" ? `Production deployments` : `Deployments`} for ${import_chalk90.default.bold(app)} under ${import_chalk90.default.bold(contextName)} ${elapsed(
|
175297
|
-
Date.now() - start
|
175298
|
-
)}`
|
175299
|
-
);
|
175300
|
-
log2(
|
175301
|
-
`To list deployments for a project, run ${getCommandName("ls [project]")}.`
|
175302
|
-
);
|
175303
|
-
print("\n");
|
175304
|
-
const headers = ["Age", "Deployment", "Status", "Environment", "Duration"];
|
175305
|
-
if (showUsername)
|
175306
|
-
headers.push("Username");
|
175264
|
+
const headers = ["Age", "Deployment", "Status", "Environment"];
|
175265
|
+
const showPolicy = Object.keys(policy).length > 0;
|
175266
|
+
if (!showPolicy)
|
175267
|
+
headers.push("Duration", "Username");
|
175268
|
+
if (showPolicy)
|
175269
|
+
headers.push("Proposed Expiration");
|
175307
175270
|
const urls = [];
|
175308
|
-
|
175309
|
-
|
175310
|
-
|
175311
|
-
|
175312
|
-
|
175313
|
-
|
175314
|
-
|
175315
|
-
|
175316
|
-
|
175317
|
-
|
175318
|
-
|
175319
|
-
|
175320
|
-
|
175321
|
-
|
175322
|
-
|
175323
|
-
(
|
175324
|
-
|
175325
|
-
|
175326
|
-
|
175327
|
-
)
|
175271
|
+
const tablePrint = table(
|
175272
|
+
[
|
175273
|
+
headers.map((header) => import_chalk90.default.bold(import_chalk90.default.cyan(header))),
|
175274
|
+
...deployments.sort(sortByCreatedAt).map((dep) => {
|
175275
|
+
urls.push(`https://${dep.url}`);
|
175276
|
+
const proposedExp = dep.proposedExpiration ? toDate(Math.min(Date.now(), dep.proposedExpiration)) : "No expiration";
|
175277
|
+
const createdAt = (0, import_ms18.default)(
|
175278
|
+
Date.now() - (dep?.undeletedAt ?? dep.createdAt)
|
175279
|
+
);
|
175280
|
+
const targetName = dep.customEnvironment?.name || (dep.target === "production" ? "Production" : "Preview");
|
175281
|
+
const targetSlug = dep.customEnvironment?.id || dep.target || "preview";
|
175282
|
+
return [
|
175283
|
+
import_chalk90.default.gray(createdAt),
|
175284
|
+
`https://${dep.url}`,
|
175285
|
+
stateString2(dep.readyState || ""),
|
175286
|
+
client2.output.link(
|
175287
|
+
targetName,
|
175288
|
+
`${projectUrl}/settings/environments/${targetSlug}`,
|
175289
|
+
{ fallback: () => targetName, color: false }
|
175290
|
+
),
|
175291
|
+
...!showPolicy ? [import_chalk90.default.gray(getDeploymentDuration(dep))] : [],
|
175292
|
+
...!showPolicy ? [import_chalk90.default.gray(dep.creator?.username)] : [],
|
175293
|
+
...showPolicy ? [import_chalk90.default.gray(proposedExp)] : []
|
175294
|
+
];
|
175295
|
+
}).filter(
|
175296
|
+
(app2) => (
|
175297
|
+
// if an app wasn't supplied to filter by,
|
175298
|
+
// we only want to render one deployment per app
|
175299
|
+
app2 === null ? filterUniqueApps() : () => true
|
175328
175300
|
)
|
175329
|
-
|
175330
|
-
|
175331
|
-
|
175301
|
+
)
|
175302
|
+
],
|
175303
|
+
{ hsep: 5 }
|
175304
|
+
).replace(/^/gm, " ");
|
175305
|
+
print(`
|
175306
|
+
${tablePrint}
|
175332
175307
|
|
175333
|
-
`
|
175334
|
-
);
|
175308
|
+
`);
|
175335
175309
|
if (!client2.stdout.isTTY) {
|
175336
175310
|
client2.stdout.write(urls.join("\n"));
|
175337
175311
|
client2.stdout.write("\n");
|
175338
175312
|
}
|
175339
|
-
if (pagination
|
175313
|
+
if (pagination?.next) {
|
175340
175314
|
const flags = getCommandFlags(parsedArgs.flags, ["--next"]);
|
175341
175315
|
log2(
|
175342
175316
|
`To display the next page, run ${getCommandName(
|
@@ -175376,10 +175350,8 @@ function stateString2(s) {
|
|
175376
175350
|
return import_chalk90.default.gray("UNKNOWN");
|
175377
175351
|
}
|
175378
175352
|
}
|
175379
|
-
function
|
175380
|
-
return
|
175381
|
-
return b.createdAt - a.createdAt;
|
175382
|
-
};
|
175353
|
+
function sortByCreatedAt(a, b) {
|
175354
|
+
return b.createdAt - a.createdAt;
|
175383
175355
|
}
|
175384
175356
|
function filterUniqueApps() {
|
175385
175357
|
const uniqueApps = /* @__PURE__ */ new Set();
|
@@ -175399,16 +175371,15 @@ var init_list2 = __esm({
|
|
175399
175371
|
import_ms18 = __toESM3(require_ms2());
|
175400
175372
|
init_table();
|
175401
175373
|
import_title7 = __toESM3(require_lib17());
|
175402
|
-
init_util();
|
175403
175374
|
init_get_args();
|
175404
175375
|
init_error2();
|
175405
175376
|
init_elapsed();
|
175406
175377
|
init_to_host();
|
175407
175378
|
init_parse_meta();
|
175379
|
+
init_parse_policy();
|
175408
175380
|
init_is_valid_name();
|
175409
175381
|
init_get_command_flags();
|
175410
175382
|
init_pkg_name();
|
175411
|
-
init_link2();
|
175412
175383
|
init_ensure_link();
|
175413
175384
|
init_get_scope();
|
175414
175385
|
init_errors_ts();
|
@@ -175417,6 +175388,8 @@ var init_list2 = __esm({
|
|
175417
175388
|
init_command16();
|
175418
175389
|
init_parse_target();
|
175419
175390
|
init_get_flags_specification();
|
175391
|
+
init_get_deployment();
|
175392
|
+
init_get_project_by_id_or_name();
|
175420
175393
|
}
|
175421
175394
|
});
|
175422
175395
|
|
@@ -177001,7 +176974,7 @@ var init_remove_project = __esm({
|
|
177001
176974
|
// src/util/deploy/get-deployments-by-project-id.ts
|
177002
176975
|
async function getDeploymentsByProjectId(client2, projectId, options = { from: null, limit: 100, continue: false }, total = 0) {
|
177003
176976
|
const limit = options.limit || 100;
|
177004
|
-
const query = new
|
176977
|
+
const query = new import_url20.URLSearchParams();
|
177005
176978
|
query.set("projectId", projectId);
|
177006
176979
|
query.set("limit", limit.toString());
|
177007
176980
|
if (options.from) {
|
@@ -177056,11 +177029,11 @@ async function getDeploymentsByProjectId(client2, projectId, options = { from: n
|
|
177056
177029
|
}
|
177057
177030
|
return deployments;
|
177058
177031
|
}
|
177059
|
-
var
|
177032
|
+
var import_url20;
|
177060
177033
|
var init_get_deployments_by_project_id = __esm({
|
177061
177034
|
"src/util/deploy/get-deployments-by-project-id.ts"() {
|
177062
177035
|
"use strict";
|
177063
|
-
|
177036
|
+
import_url20 = require("url");
|
177064
177037
|
}
|
177065
177038
|
});
|
177066
177039
|
|
@@ -178788,7 +178761,7 @@ function spawnWorker(payload, output2) {
|
|
178788
178761
|
}
|
178789
178762
|
|
178790
178763
|
// src/index.ts
|
178791
|
-
var
|
178764
|
+
var import_url22 = require("url");
|
178792
178765
|
var Sentry = __toESM3(require_dist8());
|
178793
178766
|
init_humanize_path();
|
178794
178767
|
|
@@ -179569,7 +179542,7 @@ var main13 = async () => {
|
|
179569
179542
|
apiUrl = config3.api;
|
179570
179543
|
}
|
179571
179544
|
try {
|
179572
|
-
new
|
179545
|
+
new import_url22.URL(apiUrl);
|
179573
179546
|
} catch (err) {
|
179574
179547
|
output.error(`Please provide a valid URL instead of ${highlight(apiUrl)}.`);
|
179575
179548
|
return 1;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vercel",
|
3
|
-
"version": "
|
3
|
+
"version": "37.0.0",
|
4
4
|
"preferGlobal": true,
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"description": "The command-line interface for Vercel",
|
@@ -29,7 +29,7 @@
|
|
29
29
|
"@vercel/node": "3.2.8",
|
30
30
|
"@vercel/python": "4.3.1",
|
31
31
|
"@vercel/redwood": "2.1.3",
|
32
|
-
"@vercel/remix-builder": "2.2.
|
32
|
+
"@vercel/remix-builder": "2.2.6",
|
33
33
|
"@vercel/ruby": "2.1.0",
|
34
34
|
"@vercel/static-build": "2.5.18",
|
35
35
|
"chokidar": "3.3.1"
|
@@ -83,10 +83,10 @@
|
|
83
83
|
"@vercel-internals/constants": "1.0.4",
|
84
84
|
"@vercel-internals/get-package-json": "1.0.0",
|
85
85
|
"@vercel-internals/types": "2.0.0",
|
86
|
-
"@vercel/client": "13.
|
86
|
+
"@vercel/client": "13.4.0",
|
87
87
|
"@vercel/error-utils": "2.0.2",
|
88
88
|
"@vercel/frameworks": "3.1.1",
|
89
|
-
"@vercel/fs-detectors": "5.2.
|
89
|
+
"@vercel/fs-detectors": "5.2.8",
|
90
90
|
"@vercel/routing-utils": "3.1.0",
|
91
91
|
"@vitest/expect": "1.4.0",
|
92
92
|
"ajv": "6.12.2",
|