vercel-cli 48.0.0__py3-none-any.whl → 48.0.2__py3-none-any.whl
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.
Potentially problematic release.
This version of vercel-cli might be problematic. Click here for more details.
- vercel_cli/vendor/dist/index.js +292 -247
- vercel_cli/vendor/package.json +1 -1
- {vercel_cli-48.0.0.dist-info → vercel_cli-48.0.2.dist-info}/METADATA +1 -1
- {vercel_cli-48.0.0.dist-info → vercel_cli-48.0.2.dist-info}/RECORD +6 -6
- {vercel_cli-48.0.0.dist-info → vercel_cli-48.0.2.dist-info}/WHEEL +0 -0
- {vercel_cli-48.0.0.dist-info → vercel_cli-48.0.2.dist-info}/entry_points.txt +0 -0
vercel_cli/vendor/dist/index.js
CHANGED
|
@@ -126772,6 +126772,102 @@ var init_repo_info_to_url = __esm({
|
|
|
126772
126772
|
}
|
|
126773
126773
|
});
|
|
126774
126774
|
|
|
126775
|
+
// src/util/input/list.ts
|
|
126776
|
+
function getLength(input) {
|
|
126777
|
+
let biggestLength = 0;
|
|
126778
|
+
for (const line of input.split("\n")) {
|
|
126779
|
+
const str = (0, import_strip_ansi3.default)(line);
|
|
126780
|
+
if (str.length > biggestLength) {
|
|
126781
|
+
biggestLength = str.length;
|
|
126782
|
+
}
|
|
126783
|
+
}
|
|
126784
|
+
return biggestLength;
|
|
126785
|
+
}
|
|
126786
|
+
async function list3(client2, {
|
|
126787
|
+
message: message2 = "the question",
|
|
126788
|
+
// eslint-disable-line no-unused-vars
|
|
126789
|
+
choices: _choices = [
|
|
126790
|
+
{
|
|
126791
|
+
name: "something\ndescription\ndetails\netc",
|
|
126792
|
+
value: "something unique",
|
|
126793
|
+
short: "generally the first line of `name`"
|
|
126794
|
+
}
|
|
126795
|
+
],
|
|
126796
|
+
pageSize = 15,
|
|
126797
|
+
// Show 15 lines without scrolling (~4 credit cards)
|
|
126798
|
+
separator = false,
|
|
126799
|
+
// Puts a blank separator between each choice
|
|
126800
|
+
cancel = "end",
|
|
126801
|
+
// Whether the `cancel` option will be at the `start` or the `end`,
|
|
126802
|
+
eraseFinalAnswer = false
|
|
126803
|
+
// If true, the line with the final answer that inquirer prints will be erased before returning
|
|
126804
|
+
}) {
|
|
126805
|
+
let biggestLength = 0;
|
|
126806
|
+
let selected;
|
|
126807
|
+
for (const choice of _choices) {
|
|
126808
|
+
if ("name" in choice) {
|
|
126809
|
+
const length = getLength(choice.name);
|
|
126810
|
+
if (length > biggestLength) {
|
|
126811
|
+
biggestLength = length;
|
|
126812
|
+
}
|
|
126813
|
+
}
|
|
126814
|
+
}
|
|
126815
|
+
const choices = _choices.map((choice) => {
|
|
126816
|
+
if (choice instanceof Separator) {
|
|
126817
|
+
return choice;
|
|
126818
|
+
}
|
|
126819
|
+
if ("separator" in choice) {
|
|
126820
|
+
const prefix = `\u2500\u2500 ${choice.separator} `;
|
|
126821
|
+
const suffix = "\u2500".repeat(biggestLength - getLength(prefix));
|
|
126822
|
+
return new Separator(`${prefix}${suffix}`);
|
|
126823
|
+
}
|
|
126824
|
+
if ("short" in choice) {
|
|
126825
|
+
if (choice.selected) {
|
|
126826
|
+
if (selected)
|
|
126827
|
+
throw new Error("Only one choice may be selected");
|
|
126828
|
+
selected = choice.short;
|
|
126829
|
+
}
|
|
126830
|
+
return choice;
|
|
126831
|
+
}
|
|
126832
|
+
throw new Error("Invalid choice");
|
|
126833
|
+
});
|
|
126834
|
+
if (separator) {
|
|
126835
|
+
for (let i = 0; i < choices.length; i += 2) {
|
|
126836
|
+
choices.splice(i, 0, new Separator(" "));
|
|
126837
|
+
}
|
|
126838
|
+
}
|
|
126839
|
+
const cancelSeparator = new Separator("\u2500".repeat(biggestLength));
|
|
126840
|
+
const _cancel = {
|
|
126841
|
+
name: "Cancel",
|
|
126842
|
+
value: "",
|
|
126843
|
+
short: ""
|
|
126844
|
+
};
|
|
126845
|
+
if (cancel === "start") {
|
|
126846
|
+
choices.unshift(_cancel, cancelSeparator);
|
|
126847
|
+
} else {
|
|
126848
|
+
choices.push(cancelSeparator, _cancel);
|
|
126849
|
+
}
|
|
126850
|
+
const answer = await client2.input.select({
|
|
126851
|
+
message: message2,
|
|
126852
|
+
choices,
|
|
126853
|
+
pageSize,
|
|
126854
|
+
default: selected
|
|
126855
|
+
});
|
|
126856
|
+
if (eraseFinalAnswer === true) {
|
|
126857
|
+
process.stdout.write(eraseLines(2));
|
|
126858
|
+
}
|
|
126859
|
+
return answer;
|
|
126860
|
+
}
|
|
126861
|
+
var import_strip_ansi3;
|
|
126862
|
+
var init_list4 = __esm({
|
|
126863
|
+
"src/util/input/list.ts"() {
|
|
126864
|
+
"use strict";
|
|
126865
|
+
init_esm8();
|
|
126866
|
+
import_strip_ansi3 = __toESM3(require_strip_ansi2());
|
|
126867
|
+
init_erase_lines();
|
|
126868
|
+
}
|
|
126869
|
+
});
|
|
126870
|
+
|
|
126775
126871
|
// src/util/git/connect-git-provider.ts
|
|
126776
126872
|
async function disconnectGitProvider(client2, org, projectId) {
|
|
126777
126873
|
const fetchUrl = `/v9/projects/${projectId}/link`;
|
|
@@ -126831,6 +126927,18 @@ function formatProvider(type) {
|
|
|
126831
126927
|
return type;
|
|
126832
126928
|
}
|
|
126833
126929
|
}
|
|
126930
|
+
function buildRepoUrl(provider, org, repo) {
|
|
126931
|
+
switch (provider) {
|
|
126932
|
+
case "github":
|
|
126933
|
+
return `https://github.com/${org}/${repo}`;
|
|
126934
|
+
case "gitlab":
|
|
126935
|
+
return `https://gitlab.com/${org}/${repo}`;
|
|
126936
|
+
case "bitbucket":
|
|
126937
|
+
return `https://bitbucket.org/${org}/${repo}`;
|
|
126938
|
+
default:
|
|
126939
|
+
return null;
|
|
126940
|
+
}
|
|
126941
|
+
}
|
|
126834
126942
|
function getURL(input) {
|
|
126835
126943
|
let url3 = null;
|
|
126836
126944
|
try {
|
|
@@ -126868,6 +126976,120 @@ function printRemoteUrls(remoteUrls) {
|
|
|
126868
126976
|
`);
|
|
126869
126977
|
}
|
|
126870
126978
|
}
|
|
126979
|
+
async function selectRemoteUrl(client2, remoteUrls) {
|
|
126980
|
+
const choices = [];
|
|
126981
|
+
for (const [urlKey, urlValue] of Object.entries(remoteUrls)) {
|
|
126982
|
+
choices.push({
|
|
126983
|
+
name: `${urlValue} ${import_chalk38.default.gray(`(${urlKey})`)}`,
|
|
126984
|
+
value: urlValue,
|
|
126985
|
+
short: urlKey
|
|
126986
|
+
});
|
|
126987
|
+
}
|
|
126988
|
+
return await list3(client2, {
|
|
126989
|
+
message: "Which remote do you want to connect?",
|
|
126990
|
+
choices
|
|
126991
|
+
});
|
|
126992
|
+
}
|
|
126993
|
+
async function selectAndParseRemoteUrl(client2, remoteUrls) {
|
|
126994
|
+
let remoteUrl;
|
|
126995
|
+
if (Object.keys(remoteUrls).length > 1) {
|
|
126996
|
+
output_manager_default.log("Found multiple remote URLs.");
|
|
126997
|
+
remoteUrl = await selectRemoteUrl(client2, remoteUrls);
|
|
126998
|
+
} else {
|
|
126999
|
+
remoteUrl = Object.values(remoteUrls)[0];
|
|
127000
|
+
}
|
|
127001
|
+
if (remoteUrl === "") {
|
|
127002
|
+
output_manager_default.log("Canceled");
|
|
127003
|
+
return null;
|
|
127004
|
+
}
|
|
127005
|
+
const repoInfo = parseRepoUrl(remoteUrl);
|
|
127006
|
+
if (!repoInfo) {
|
|
127007
|
+
output_manager_default.log(`Connecting Git repository: ${import_chalk38.default.cyan(remoteUrl)}`);
|
|
127008
|
+
output_manager_default.error(
|
|
127009
|
+
`Failed to parse Git repo data from the following remote URL: ${link_default(
|
|
127010
|
+
remoteUrl
|
|
127011
|
+
)}`
|
|
127012
|
+
);
|
|
127013
|
+
return null;
|
|
127014
|
+
}
|
|
127015
|
+
return repoInfo;
|
|
127016
|
+
}
|
|
127017
|
+
async function checkExistsAndConnect({
|
|
127018
|
+
client: client2,
|
|
127019
|
+
confirm,
|
|
127020
|
+
org,
|
|
127021
|
+
project,
|
|
127022
|
+
gitProviderLink,
|
|
127023
|
+
provider,
|
|
127024
|
+
repoPath,
|
|
127025
|
+
gitOrg,
|
|
127026
|
+
repo
|
|
127027
|
+
}) {
|
|
127028
|
+
const displayUrl = buildRepoUrl(provider, gitOrg, repo) || repoPath;
|
|
127029
|
+
output_manager_default.log(
|
|
127030
|
+
`Connecting ${formatProvider(provider)} repository: ${import_chalk38.default.cyan(displayUrl)}`
|
|
127031
|
+
);
|
|
127032
|
+
if (!gitProviderLink) {
|
|
127033
|
+
const connect2 = await connectGitProvider(
|
|
127034
|
+
client2,
|
|
127035
|
+
project.id,
|
|
127036
|
+
provider,
|
|
127037
|
+
repoPath
|
|
127038
|
+
);
|
|
127039
|
+
if (typeof connect2 === "number") {
|
|
127040
|
+
return connect2;
|
|
127041
|
+
}
|
|
127042
|
+
} else {
|
|
127043
|
+
const connectedProvider = gitProviderLink.type;
|
|
127044
|
+
const connectedOrg = gitProviderLink.org;
|
|
127045
|
+
const connectedRepo = gitProviderLink.repo;
|
|
127046
|
+
const connectedRepoPath = `${connectedOrg}/${connectedRepo}`;
|
|
127047
|
+
const isSameRepo = connectedProvider === provider && connectedOrg === gitOrg && connectedRepo === repo;
|
|
127048
|
+
if (isSameRepo) {
|
|
127049
|
+
output_manager_default.log(
|
|
127050
|
+
`${import_chalk38.default.cyan(connectedRepoPath)} is already connected to your project.`
|
|
127051
|
+
);
|
|
127052
|
+
return 1;
|
|
127053
|
+
}
|
|
127054
|
+
const shouldReplaceRepo = await confirmRepoConnect(
|
|
127055
|
+
client2,
|
|
127056
|
+
confirm,
|
|
127057
|
+
connectedProvider,
|
|
127058
|
+
connectedRepoPath
|
|
127059
|
+
);
|
|
127060
|
+
if (!shouldReplaceRepo) {
|
|
127061
|
+
return 0;
|
|
127062
|
+
}
|
|
127063
|
+
await disconnectGitProvider(client2, org, project.id);
|
|
127064
|
+
const connect2 = await connectGitProvider(
|
|
127065
|
+
client2,
|
|
127066
|
+
project.id,
|
|
127067
|
+
provider,
|
|
127068
|
+
repoPath
|
|
127069
|
+
);
|
|
127070
|
+
if (typeof connect2 === "number") {
|
|
127071
|
+
return connect2;
|
|
127072
|
+
}
|
|
127073
|
+
}
|
|
127074
|
+
output_manager_default.log("Connected");
|
|
127075
|
+
}
|
|
127076
|
+
async function confirmRepoConnect(client2, yes, connectedProvider, connectedRepoPath) {
|
|
127077
|
+
let shouldReplaceProject = yes;
|
|
127078
|
+
if (!shouldReplaceProject) {
|
|
127079
|
+
shouldReplaceProject = await client2.input.confirm(
|
|
127080
|
+
`Looks like you already have a ${formatProvider(
|
|
127081
|
+
connectedProvider
|
|
127082
|
+
)} repository connected: ${import_chalk38.default.cyan(
|
|
127083
|
+
connectedRepoPath
|
|
127084
|
+
)}. Do you want to replace it?`,
|
|
127085
|
+
true
|
|
127086
|
+
);
|
|
127087
|
+
if (!shouldReplaceProject) {
|
|
127088
|
+
output_manager_default.log("Canceled. Repo not connected.");
|
|
127089
|
+
}
|
|
127090
|
+
}
|
|
127091
|
+
return shouldReplaceProject;
|
|
127092
|
+
}
|
|
126871
127093
|
var import_url7, import_chalk38;
|
|
126872
127094
|
var init_connect_git_provider = __esm({
|
|
126873
127095
|
"src/util/git/connect-git-provider.ts"() {
|
|
@@ -126877,6 +127099,7 @@ var init_connect_git_provider = __esm({
|
|
|
126877
127099
|
init_link();
|
|
126878
127100
|
init_errors_ts();
|
|
126879
127101
|
init_output_manager();
|
|
127102
|
+
init_list4();
|
|
126880
127103
|
}
|
|
126881
127104
|
});
|
|
126882
127105
|
|
|
@@ -145876,6 +146099,7 @@ async function setupAndLink(client2, path11, {
|
|
|
145876
146099
|
org.slug,
|
|
145877
146100
|
successEmoji
|
|
145878
146101
|
);
|
|
146102
|
+
await connectGitRepository(client2, path11, project, autoConfirm, org);
|
|
145879
146103
|
return { status: "linked", org, project };
|
|
145880
146104
|
} catch (err) {
|
|
145881
146105
|
if (isAPIError(err) && err.code === "too_many_projects") {
|
|
@@ -145886,6 +146110,43 @@ async function setupAndLink(client2, path11, {
|
|
|
145886
146110
|
return { status: "error", exitCode: 1 };
|
|
145887
146111
|
}
|
|
145888
146112
|
}
|
|
146113
|
+
async function connectGitRepository(client2, path11, project, autoConfirm, org) {
|
|
146114
|
+
try {
|
|
146115
|
+
const gitConfig = await parseGitConfig((0, import_path26.join)(path11, ".git/config"));
|
|
146116
|
+
if (!gitConfig) {
|
|
146117
|
+
return;
|
|
146118
|
+
}
|
|
146119
|
+
const remoteUrls = pluckRemoteUrls(gitConfig);
|
|
146120
|
+
if (!remoteUrls || Object.keys(remoteUrls).length === 0) {
|
|
146121
|
+
return;
|
|
146122
|
+
}
|
|
146123
|
+
const shouldConnect = autoConfirm || await client2.input.confirm(
|
|
146124
|
+
`Detected a repository. Connect it to this project?`,
|
|
146125
|
+
true
|
|
146126
|
+
);
|
|
146127
|
+
if (!shouldConnect) {
|
|
146128
|
+
return;
|
|
146129
|
+
}
|
|
146130
|
+
const repoInfo = await selectAndParseRemoteUrl(client2, remoteUrls);
|
|
146131
|
+
if (!repoInfo) {
|
|
146132
|
+
return;
|
|
146133
|
+
}
|
|
146134
|
+
await checkExistsAndConnect({
|
|
146135
|
+
client: client2,
|
|
146136
|
+
confirm: autoConfirm,
|
|
146137
|
+
gitProviderLink: project.link,
|
|
146138
|
+
org,
|
|
146139
|
+
gitOrg: repoInfo.org,
|
|
146140
|
+
project,
|
|
146141
|
+
// Type assertion since we only need the id
|
|
146142
|
+
provider: repoInfo.provider,
|
|
146143
|
+
repo: repoInfo.repo,
|
|
146144
|
+
repoPath: `${repoInfo.org}/${repoInfo.repo}`
|
|
146145
|
+
});
|
|
146146
|
+
} catch (error3) {
|
|
146147
|
+
output_manager_default.debug(`Failed to connect git repository: ${error3}`);
|
|
146148
|
+
}
|
|
146149
|
+
}
|
|
145889
146150
|
var import_chalk52, import_fs_extra17, import_path26, import_frameworks4;
|
|
145890
146151
|
var init_setup_and_link = __esm({
|
|
145891
146152
|
"src/util/link/setup-and-link.ts"() {
|
|
@@ -145896,6 +146157,8 @@ var init_setup_and_link = __esm({
|
|
|
145896
146157
|
init_link2();
|
|
145897
146158
|
init_create_project();
|
|
145898
146159
|
init_error2();
|
|
146160
|
+
init_create_git_meta();
|
|
146161
|
+
init_connect_git_provider();
|
|
145899
146162
|
init_humanize_path();
|
|
145900
146163
|
init_global_path();
|
|
145901
146164
|
init_select_org();
|
|
@@ -170910,13 +171173,13 @@ var init_import2 = __esm({
|
|
|
170910
171173
|
|
|
170911
171174
|
// src/util/strlen.ts
|
|
170912
171175
|
function strlen(str) {
|
|
170913
|
-
return (0,
|
|
171176
|
+
return (0, import_strip_ansi4.default)(str).length;
|
|
170914
171177
|
}
|
|
170915
|
-
var
|
|
171178
|
+
var import_strip_ansi4;
|
|
170916
171179
|
var init_strlen = __esm({
|
|
170917
171180
|
"src/util/strlen.ts"() {
|
|
170918
171181
|
"use strict";
|
|
170919
|
-
|
|
171182
|
+
import_strip_ansi4 = __toESM3(require_strip_ansi2());
|
|
170920
171183
|
}
|
|
170921
171184
|
});
|
|
170922
171185
|
|
|
@@ -174422,102 +174685,6 @@ var init_env2 = __esm({
|
|
|
174422
174685
|
}
|
|
174423
174686
|
});
|
|
174424
174687
|
|
|
174425
|
-
// src/util/input/list.ts
|
|
174426
|
-
function getLength(input) {
|
|
174427
|
-
let biggestLength = 0;
|
|
174428
|
-
for (const line of input.split("\n")) {
|
|
174429
|
-
const str = (0, import_strip_ansi4.default)(line);
|
|
174430
|
-
if (str.length > biggestLength) {
|
|
174431
|
-
biggestLength = str.length;
|
|
174432
|
-
}
|
|
174433
|
-
}
|
|
174434
|
-
return biggestLength;
|
|
174435
|
-
}
|
|
174436
|
-
async function list3(client2, {
|
|
174437
|
-
message: message2 = "the question",
|
|
174438
|
-
// eslint-disable-line no-unused-vars
|
|
174439
|
-
choices: _choices = [
|
|
174440
|
-
{
|
|
174441
|
-
name: "something\ndescription\ndetails\netc",
|
|
174442
|
-
value: "something unique",
|
|
174443
|
-
short: "generally the first line of `name`"
|
|
174444
|
-
}
|
|
174445
|
-
],
|
|
174446
|
-
pageSize = 15,
|
|
174447
|
-
// Show 15 lines without scrolling (~4 credit cards)
|
|
174448
|
-
separator = false,
|
|
174449
|
-
// Puts a blank separator between each choice
|
|
174450
|
-
cancel = "end",
|
|
174451
|
-
// Whether the `cancel` option will be at the `start` or the `end`,
|
|
174452
|
-
eraseFinalAnswer = false
|
|
174453
|
-
// If true, the line with the final answer that inquirer prints will be erased before returning
|
|
174454
|
-
}) {
|
|
174455
|
-
let biggestLength = 0;
|
|
174456
|
-
let selected;
|
|
174457
|
-
for (const choice of _choices) {
|
|
174458
|
-
if ("name" in choice) {
|
|
174459
|
-
const length = getLength(choice.name);
|
|
174460
|
-
if (length > biggestLength) {
|
|
174461
|
-
biggestLength = length;
|
|
174462
|
-
}
|
|
174463
|
-
}
|
|
174464
|
-
}
|
|
174465
|
-
const choices = _choices.map((choice) => {
|
|
174466
|
-
if (choice instanceof Separator) {
|
|
174467
|
-
return choice;
|
|
174468
|
-
}
|
|
174469
|
-
if ("separator" in choice) {
|
|
174470
|
-
const prefix = `\u2500\u2500 ${choice.separator} `;
|
|
174471
|
-
const suffix = "\u2500".repeat(biggestLength - getLength(prefix));
|
|
174472
|
-
return new Separator(`${prefix}${suffix}`);
|
|
174473
|
-
}
|
|
174474
|
-
if ("short" in choice) {
|
|
174475
|
-
if (choice.selected) {
|
|
174476
|
-
if (selected)
|
|
174477
|
-
throw new Error("Only one choice may be selected");
|
|
174478
|
-
selected = choice.short;
|
|
174479
|
-
}
|
|
174480
|
-
return choice;
|
|
174481
|
-
}
|
|
174482
|
-
throw new Error("Invalid choice");
|
|
174483
|
-
});
|
|
174484
|
-
if (separator) {
|
|
174485
|
-
for (let i = 0; i < choices.length; i += 2) {
|
|
174486
|
-
choices.splice(i, 0, new Separator(" "));
|
|
174487
|
-
}
|
|
174488
|
-
}
|
|
174489
|
-
const cancelSeparator = new Separator("\u2500".repeat(biggestLength));
|
|
174490
|
-
const _cancel = {
|
|
174491
|
-
name: "Cancel",
|
|
174492
|
-
value: "",
|
|
174493
|
-
short: ""
|
|
174494
|
-
};
|
|
174495
|
-
if (cancel === "start") {
|
|
174496
|
-
choices.unshift(_cancel, cancelSeparator);
|
|
174497
|
-
} else {
|
|
174498
|
-
choices.push(cancelSeparator, _cancel);
|
|
174499
|
-
}
|
|
174500
|
-
const answer = await client2.input.select({
|
|
174501
|
-
message: message2,
|
|
174502
|
-
choices,
|
|
174503
|
-
pageSize,
|
|
174504
|
-
default: selected
|
|
174505
|
-
});
|
|
174506
|
-
if (eraseFinalAnswer === true) {
|
|
174507
|
-
process.stdout.write(eraseLines(2));
|
|
174508
|
-
}
|
|
174509
|
-
return answer;
|
|
174510
|
-
}
|
|
174511
|
-
var import_strip_ansi4;
|
|
174512
|
-
var init_list4 = __esm({
|
|
174513
|
-
"src/util/input/list.ts"() {
|
|
174514
|
-
"use strict";
|
|
174515
|
-
init_esm8();
|
|
174516
|
-
import_strip_ansi4 = __toESM3(require_strip_ansi2());
|
|
174517
|
-
init_erase_lines();
|
|
174518
|
-
}
|
|
174519
|
-
});
|
|
174520
|
-
|
|
174521
174688
|
// src/util/telemetry/commands/git/connect.ts
|
|
174522
174689
|
var GitConnectTelemetryClient;
|
|
174523
174690
|
var init_connect = __esm({
|
|
@@ -174635,46 +174802,24 @@ async function connect(client2, argv) {
|
|
|
174635
174802
|
);
|
|
174636
174803
|
return 1;
|
|
174637
174804
|
}
|
|
174638
|
-
|
|
174639
|
-
if (Object.keys(remoteUrls).length > 1) {
|
|
174640
|
-
output_manager_default.log("Found multiple remote URLs.");
|
|
174641
|
-
remoteUrl = await selectRemoteUrl(client2, remoteUrls);
|
|
174642
|
-
} else {
|
|
174643
|
-
remoteUrl = Object.values(remoteUrls)[0];
|
|
174644
|
-
}
|
|
174645
|
-
if (remoteUrl === "") {
|
|
174646
|
-
output_manager_default.log("Canceled");
|
|
174647
|
-
return 0;
|
|
174648
|
-
}
|
|
174649
|
-
output_manager_default.log(`Connecting Git remote: ${link_default(remoteUrl)}`);
|
|
174650
|
-
const repoInfo = parseRepoUrl(remoteUrl);
|
|
174805
|
+
const repoInfo = await selectAndParseRemoteUrl(client2, remoteUrls);
|
|
174651
174806
|
if (!repoInfo) {
|
|
174652
|
-
|
|
174653
|
-
`Failed to parse Git repo data from the following remote URL: ${link_default(
|
|
174654
|
-
remoteUrl
|
|
174655
|
-
)}`
|
|
174656
|
-
);
|
|
174657
|
-
return 1;
|
|
174807
|
+
return Object.keys(remoteUrls).length > 1 ? 0 : 1;
|
|
174658
174808
|
}
|
|
174659
|
-
const
|
|
174660
|
-
const repoPath = `${gitOrg}/${repo}`;
|
|
174661
|
-
const checkAndConnect = await checkExistsAndConnect({
|
|
174809
|
+
const result = await checkExistsAndConnect({
|
|
174662
174810
|
client: client2,
|
|
174663
174811
|
confirm,
|
|
174812
|
+
gitProviderLink,
|
|
174664
174813
|
org,
|
|
174814
|
+
gitOrg: repoInfo.org,
|
|
174665
174815
|
project,
|
|
174666
|
-
|
|
174667
|
-
|
|
174668
|
-
repoPath
|
|
174669
|
-
gitOrg,
|
|
174670
|
-
repo
|
|
174816
|
+
provider: repoInfo.provider,
|
|
174817
|
+
repo: repoInfo.repo,
|
|
174818
|
+
repoPath: `${repoInfo.org}/${repoInfo.repo}`
|
|
174671
174819
|
});
|
|
174672
|
-
if (typeof
|
|
174673
|
-
return
|
|
174820
|
+
if (typeof result === "number") {
|
|
174821
|
+
return result;
|
|
174674
174822
|
}
|
|
174675
|
-
output_manager_default.log(
|
|
174676
|
-
`Connected ${formatProvider(provider)} repository ${import_chalk93.default.cyan(repoPath)}!`
|
|
174677
|
-
);
|
|
174678
174823
|
return 0;
|
|
174679
174824
|
}
|
|
174680
174825
|
async function connectArg({
|
|
@@ -174685,7 +174830,6 @@ async function connectArg({
|
|
|
174685
174830
|
repoInfo
|
|
174686
174831
|
}) {
|
|
174687
174832
|
const { url: repoUrl } = repoInfo;
|
|
174688
|
-
output_manager_default.log(`Connecting Git remote: ${link_default(repoUrl)}`);
|
|
174689
174833
|
const parsedRepoArg = parseRepoUrl(repoUrl);
|
|
174690
174834
|
if (!parsedRepoArg) {
|
|
174691
174835
|
output_manager_default.error(
|
|
@@ -174693,25 +174837,20 @@ async function connectArg({
|
|
|
174693
174837
|
);
|
|
174694
174838
|
return 1;
|
|
174695
174839
|
}
|
|
174696
|
-
const
|
|
174697
|
-
const repoPath = `${gitOrg}/${repo}`;
|
|
174698
|
-
const connect2 = await checkExistsAndConnect({
|
|
174840
|
+
const result = await checkExistsAndConnect({
|
|
174699
174841
|
client: client2,
|
|
174700
174842
|
confirm,
|
|
174843
|
+
gitProviderLink: project.link,
|
|
174701
174844
|
org,
|
|
174845
|
+
gitOrg: parsedRepoArg.org,
|
|
174702
174846
|
project,
|
|
174703
|
-
|
|
174704
|
-
|
|
174705
|
-
repoPath
|
|
174706
|
-
gitOrg,
|
|
174707
|
-
repo
|
|
174847
|
+
provider: parsedRepoArg.provider,
|
|
174848
|
+
repo: parsedRepoArg.repo,
|
|
174849
|
+
repoPath: `${parsedRepoArg.org}/${parsedRepoArg.repo}`
|
|
174708
174850
|
});
|
|
174709
|
-
if (typeof
|
|
174710
|
-
return
|
|
174851
|
+
if (typeof result === "number") {
|
|
174852
|
+
return result;
|
|
174711
174853
|
}
|
|
174712
|
-
output_manager_default.log(
|
|
174713
|
-
`Connected ${formatProvider(provider)} repository ${import_chalk93.default.cyan(repoPath)}!`
|
|
174714
|
-
);
|
|
174715
174854
|
return 0;
|
|
174716
174855
|
}
|
|
174717
174856
|
async function connectArgWithLocalGit({
|
|
@@ -174734,28 +174873,20 @@ async function connectArgWithLocalGit({
|
|
|
174734
174873
|
return 1;
|
|
174735
174874
|
}
|
|
174736
174875
|
if (shouldConnect) {
|
|
174737
|
-
const
|
|
174738
|
-
const repoPath = `${gitOrg}/${repo}`;
|
|
174739
|
-
output_manager_default.log(`Connecting Git remote: ${link_default(repoUrl)}`);
|
|
174740
|
-
const connect2 = await checkExistsAndConnect({
|
|
174876
|
+
const result = await checkExistsAndConnect({
|
|
174741
174877
|
client: client2,
|
|
174742
174878
|
confirm,
|
|
174879
|
+
gitProviderLink: project.link,
|
|
174743
174880
|
org,
|
|
174881
|
+
gitOrg: repoInfo.org,
|
|
174744
174882
|
project,
|
|
174745
|
-
|
|
174746
|
-
|
|
174747
|
-
repoPath
|
|
174748
|
-
gitOrg,
|
|
174749
|
-
repo
|
|
174883
|
+
provider: repoInfo.provider,
|
|
174884
|
+
repo: repoInfo.repo,
|
|
174885
|
+
repoPath: `${repoInfo.org}/${repoInfo.repo}`
|
|
174750
174886
|
});
|
|
174751
|
-
if (typeof
|
|
174752
|
-
return
|
|
174887
|
+
if (typeof result === "number") {
|
|
174888
|
+
return result;
|
|
174753
174889
|
}
|
|
174754
|
-
output_manager_default.log(
|
|
174755
|
-
`Connected ${formatProvider(provider)} repository ${import_chalk93.default.cyan(
|
|
174756
|
-
repoPath
|
|
174757
|
-
)}!`
|
|
174758
|
-
);
|
|
174759
174890
|
}
|
|
174760
174891
|
return 0;
|
|
174761
174892
|
}
|
|
@@ -174801,91 +174932,6 @@ async function promptConnectArg({
|
|
|
174801
174932
|
}
|
|
174802
174933
|
return shouldConnect;
|
|
174803
174934
|
}
|
|
174804
|
-
async function checkExistsAndConnect({
|
|
174805
|
-
client: client2,
|
|
174806
|
-
confirm,
|
|
174807
|
-
org,
|
|
174808
|
-
project,
|
|
174809
|
-
gitProviderLink,
|
|
174810
|
-
provider,
|
|
174811
|
-
repoPath,
|
|
174812
|
-
gitOrg,
|
|
174813
|
-
repo
|
|
174814
|
-
}) {
|
|
174815
|
-
if (!gitProviderLink) {
|
|
174816
|
-
const connect2 = await connectGitProvider(
|
|
174817
|
-
client2,
|
|
174818
|
-
project.id,
|
|
174819
|
-
provider,
|
|
174820
|
-
repoPath
|
|
174821
|
-
);
|
|
174822
|
-
if (typeof connect2 === "number") {
|
|
174823
|
-
return connect2;
|
|
174824
|
-
}
|
|
174825
|
-
} else {
|
|
174826
|
-
const connectedProvider = gitProviderLink.type;
|
|
174827
|
-
const connectedOrg = gitProviderLink.org;
|
|
174828
|
-
const connectedRepo = gitProviderLink.repo;
|
|
174829
|
-
const connectedRepoPath = `${connectedOrg}/${connectedRepo}`;
|
|
174830
|
-
const isSameRepo = connectedProvider === provider && connectedOrg === gitOrg && connectedRepo === repo;
|
|
174831
|
-
if (isSameRepo) {
|
|
174832
|
-
output_manager_default.log(
|
|
174833
|
-
`${import_chalk93.default.cyan(connectedRepoPath)} is already connected to your project.`
|
|
174834
|
-
);
|
|
174835
|
-
return 1;
|
|
174836
|
-
}
|
|
174837
|
-
const shouldReplaceRepo = await confirmRepoConnect(
|
|
174838
|
-
client2,
|
|
174839
|
-
confirm,
|
|
174840
|
-
connectedProvider,
|
|
174841
|
-
connectedRepoPath
|
|
174842
|
-
);
|
|
174843
|
-
if (!shouldReplaceRepo) {
|
|
174844
|
-
return 0;
|
|
174845
|
-
}
|
|
174846
|
-
await disconnectGitProvider(client2, org, project.id);
|
|
174847
|
-
const connect2 = await connectGitProvider(
|
|
174848
|
-
client2,
|
|
174849
|
-
project.id,
|
|
174850
|
-
provider,
|
|
174851
|
-
repoPath
|
|
174852
|
-
);
|
|
174853
|
-
if (typeof connect2 === "number") {
|
|
174854
|
-
return connect2;
|
|
174855
|
-
}
|
|
174856
|
-
}
|
|
174857
|
-
}
|
|
174858
|
-
async function confirmRepoConnect(client2, yes, connectedProvider, connectedRepoPath) {
|
|
174859
|
-
let shouldReplaceProject = yes;
|
|
174860
|
-
if (!shouldReplaceProject) {
|
|
174861
|
-
shouldReplaceProject = await client2.input.confirm(
|
|
174862
|
-
`Looks like you already have a ${formatProvider(
|
|
174863
|
-
connectedProvider
|
|
174864
|
-
)} repository connected: ${import_chalk93.default.cyan(
|
|
174865
|
-
connectedRepoPath
|
|
174866
|
-
)}. Do you want to replace it?`,
|
|
174867
|
-
true
|
|
174868
|
-
);
|
|
174869
|
-
if (!shouldReplaceProject) {
|
|
174870
|
-
output_manager_default.log("Canceled. Repo not connected.");
|
|
174871
|
-
}
|
|
174872
|
-
}
|
|
174873
|
-
return shouldReplaceProject;
|
|
174874
|
-
}
|
|
174875
|
-
async function selectRemoteUrl(client2, remoteUrls) {
|
|
174876
|
-
const choices = [];
|
|
174877
|
-
for (const [urlKey, urlValue] of Object.entries(remoteUrls)) {
|
|
174878
|
-
choices.push({
|
|
174879
|
-
name: `${urlValue} ${import_chalk93.default.gray(`(${urlKey})`)}`,
|
|
174880
|
-
value: urlValue,
|
|
174881
|
-
short: urlKey
|
|
174882
|
-
});
|
|
174883
|
-
}
|
|
174884
|
-
return await list3(client2, {
|
|
174885
|
-
message: "Which remote do you want to connect?",
|
|
174886
|
-
choices
|
|
174887
|
-
});
|
|
174888
|
-
}
|
|
174889
174935
|
var import_chalk93, import_path39;
|
|
174890
174936
|
var init_connect2 = __esm({
|
|
174891
174937
|
"src/commands/git/connect.ts"() {
|
|
@@ -174893,7 +174939,6 @@ var init_connect2 = __esm({
|
|
|
174893
174939
|
import_chalk93 = __toESM3(require_source());
|
|
174894
174940
|
import_path39 = require("path");
|
|
174895
174941
|
init_create_git_meta();
|
|
174896
|
-
init_list4();
|
|
174897
174942
|
init_link();
|
|
174898
174943
|
init_pkg_name();
|
|
174899
174944
|
init_connect_git_provider();
|
vercel_cli/vendor/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vercel-cli
|
|
3
|
-
Version: 48.0.
|
|
3
|
+
Version: 48.0.2
|
|
4
4
|
Summary: Vercel CLI packaged for Python (bundled Node.js, vendored npm)
|
|
5
5
|
Project-URL: Homepage, https://github.com/nuage-studio/vercel-cli-python
|
|
6
6
|
Project-URL: Repository, https://github.com/nuage-studio/vercel-cli-python
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
vercel_cli/vendor/LICENSE,sha256=sHDXe_ssUqHdaZbeDOX2TEmgylXIibFjqWPd9csAHuI,11343
|
|
2
2
|
vercel_cli/vendor/README.md,sha256=2ZrJzd7x21xlpsOZ9QKG6478zbXb8-3YN8cPyzPxZNk,1799
|
|
3
|
-
vercel_cli/vendor/package.json,sha256=
|
|
3
|
+
vercel_cli/vendor/package.json,sha256=Gxq394FGg_xoV2LuoZf7NUtbt_fh-teoxprPl_wFiNM,1261
|
|
4
4
|
vercel_cli/vendor/dist/VERCEL_DIR_README.txt,sha256=9dHtD1AyrhKJMfRkWbX6oa9jGfwt-z56X-VKhL-T29Y,520
|
|
5
5
|
vercel_cli/vendor/dist/builder-worker.js,sha256=RgutTXJcurRisV2NtlruuPDtCBOi8eHSGCo3n4GcCIM,1969
|
|
6
6
|
vercel_cli/vendor/dist/get-latest-worker.js,sha256=w7nK8nQtlYad_SKuFQGw_sg7_bb-p0uHOf1MYiwrUNs,7964
|
|
7
|
-
vercel_cli/vendor/dist/index.js,sha256=
|
|
7
|
+
vercel_cli/vendor/dist/index.js,sha256=vSm1kTA8AJ0WSS0Bu0EN-HEfCP9V6Yl_aF8CwMw5g0A,8859642
|
|
8
8
|
vercel_cli/vendor/dist/vc.js,sha256=AAC4u6uwjpO0KfFVuLRs5YWXjW4aMCkgSj_45hR3W8k,340
|
|
9
9
|
vercel_cli/vendor/node_modules/.package-lock.json,sha256=gfpJC3qtwTs1Lur0Dgt3ptrO4UwbX6YkqzhrKQgjY6o,1002
|
|
10
10
|
vercel_cli/vendor/node_modules/@vercel/build-utils/CHANGELOG.md,sha256=ji-V7NgIUH1Fj-lmUh0LmIxhS6bq_0TW7xFH0e9yiF8,18051
|
|
@@ -97,7 +97,7 @@ vercel_cli/vendor/node_modules/@vercel/python/LICENSE,sha256=sHDXe_ssUqHdaZbeDOX
|
|
|
97
97
|
vercel_cli/vendor/node_modules/@vercel/python/package.json,sha256=7FIHqqKqng5jeEOZWZP516OdmJTyS4OM-r5Mhb8mSCo,1044
|
|
98
98
|
vercel_cli/vendor/node_modules/@vercel/python/vc_init.py,sha256=A7949hQi18B9yqPkTr1bepToi7nKRh_yRP7GwmsI-Ww,28201
|
|
99
99
|
vercel_cli/vendor/node_modules/@vercel/python/dist/index.js,sha256=G5daDqyPBQM_vPQGZC-OrHdYt3aKOuVUwvPKqeETjSU,107035
|
|
100
|
-
vercel_cli-48.0.
|
|
101
|
-
vercel_cli-48.0.
|
|
102
|
-
vercel_cli-48.0.
|
|
103
|
-
vercel_cli-48.0.
|
|
100
|
+
vercel_cli-48.0.2.dist-info/METADATA,sha256=foZysDc7otKYC9qbP4eZ2MvbervlnU8A0ZNcJgG1NrQ,7085
|
|
101
|
+
vercel_cli-48.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
102
|
+
vercel_cli-48.0.2.dist-info/entry_points.txt,sha256=3iHkg20gi2BZorK1g5UlyZY3tN5E1vJX6PX5-ibn9fI,83
|
|
103
|
+
vercel_cli-48.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|