vercel 56.4.0 → 56.5.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/chunks/{add-XY2LNFK3.js → add-6GRH6G2M.js} +4 -4
- package/dist/chunks/{add-2HLAH42D.js → add-KNK5E2YT.js} +3 -3
- package/dist/chunks/{chunk-WM3UMX65.js → chunk-23U6FANO.js} +1 -1
- package/dist/chunks/chunk-2473DUBR.js +15 -0
- package/dist/chunks/{chunk-C4TEOOGB.js → chunk-26TEKOBZ.js} +63 -6
- package/dist/chunks/{chunk-S7HMSWGQ.js → chunk-3BHSS5E2.js} +2 -2
- package/dist/chunks/{chunk-PEC4ROHM.js → chunk-4MK452Y5.js} +5 -5
- package/dist/chunks/{chunk-ORMDX3GR.js → chunk-ARKHETJP.js} +1 -1
- package/dist/chunks/chunk-BM36UWE2.js +245 -0
- package/dist/chunks/{chunk-VZGX4CKB.js → chunk-CM3DLBDY.js} +1 -1
- package/dist/chunks/{chunk-SLCLT4P5.js → chunk-DI3HR3K6.js} +1 -1
- package/dist/chunks/{chunk-OSXJ6G4O.js → chunk-DOF6CJLL.js} +3 -3
- package/dist/chunks/chunk-E336ZXPP.js +43 -0
- package/dist/chunks/{chunk-K6YMSJMZ.js → chunk-EYICIM2K.js} +4 -4
- package/dist/chunks/chunk-FHEMFAHB.js +320 -0
- package/dist/chunks/{chunk-JGXABANG.js → chunk-G4MTGCZ5.js} +1 -1
- package/dist/chunks/{chunk-IN3RG4AU.js → chunk-GAOAGU5K.js} +1 -1
- package/dist/chunks/{chunk-UA3D44SL.js → chunk-GNV7547O.js} +1 -1
- package/dist/chunks/{chunk-2KNVJ7ET.js → chunk-IBP2XAUH.js} +103 -3
- package/dist/chunks/{chunk-JIK3GTU3.js → chunk-JQG5EDRD.js} +1 -1
- package/dist/chunks/{chunk-ENIJVO7C.js → chunk-PPEQUJ7T.js} +2 -2
- package/dist/chunks/{chunk-EJNFC5AV.js → chunk-PRYNIKBZ.js} +1 -1
- package/dist/chunks/{chunk-BRTMH4PL.js → chunk-SWEPOMSA.js} +1 -1
- package/dist/chunks/{chunk-QX4337BT.js → chunk-TMK6RSYW.js} +842 -842
- package/dist/chunks/chunk-WR7JTCGL.js +104 -0
- package/dist/chunks/{chunk-4QRRJEYO.js → chunk-X43U65TH.js} +2 -2
- package/dist/chunks/chunk-YTFJGKRG.js +247 -0
- package/dist/chunks/{compile-vercel-config-4Q4YZ44O.js → compile-vercel-config-IFET4E6H.js} +2 -2
- package/dist/chunks/config-validator.mjs +1 -0
- package/dist/chunks/{delete-AUDPLCMU.js → delete-PXB5WRH7.js} +3 -3
- package/dist/chunks/delete-X2MUMONI.js +150 -0
- package/dist/chunks/{disable-WFPXR7GZ.js → disable-GBL3SHJL.js} +3 -3
- package/dist/chunks/{discard-RVFKIZZG.js → discard-XVVSRGDR.js} +3 -3
- package/dist/chunks/{edit-KO5KX4WU.js → edit-EIHRP6XT.js} +4 -4
- package/dist/chunks/edit-K5Y2BDJO.js +153 -0
- package/dist/chunks/{enable-I5HE32DI.js → enable-W7AMJWKH.js} +3 -3
- package/dist/chunks/{export-4Y5L2TOT.js → export-N3AZ2KOO.js} +3 -3
- package/dist/chunks/{image-QC5MVWKN.js → image-DRTGVPVJ.js} +3 -3
- package/dist/chunks/{inspect-Q5BKZNVI.js → inspect-5YUAEI3L.js} +3 -3
- package/dist/chunks/{inspect-BULBAPNR.js → inspect-AAIVWSJI.js} +3 -3
- package/dist/chunks/{inspect-JUGFKEGR.js → inspect-DYXTX6P4.js} +3 -3
- package/dist/chunks/{inspect-PJDCPARM.js → inspect-IPSAYR2C.js} +3 -3
- package/dist/chunks/inspect-SLZLI6ZC.js +205 -0
- package/dist/chunks/{list-FJT44SB6.js → list-IF2YW73F.js} +2 -2
- package/dist/chunks/list-K2HLGUXV.js +360 -0
- package/dist/chunks/{list-N7OA4FBI.js → list-V7VTXVK4.js} +3 -3
- package/dist/chunks/{login-BPE774JW.js → login-7C6HQEOG.js} +3 -3
- package/dist/chunks/{ls-YV554CRJ.js → ls-2NU353QP.js} +3 -3
- package/dist/chunks/{ls-H52WO65Y.js → ls-NKECPPOR.js} +3 -3
- package/dist/chunks/{ls-E47M6P5O.js → ls-QQQHOJBE.js} +3 -3
- package/dist/chunks/{ls-26VFGQ6P.js → ls-RH6Y4XBS.js} +4 -4
- package/dist/chunks/open-2FAPZA6V.js +106 -0
- package/dist/chunks/{publish-DUTEBRX3.js → publish-G7PB64LJ.js} +3 -3
- package/dist/chunks/{query-QDOKUCHX.js → query-D4QBT4WR.js} +2 -2
- package/dist/chunks/{reorder-L2M3YGJ4.js → reorder-3Z7YIPAX.js} +3 -3
- package/dist/chunks/reply-7QQBXL5H.js +167 -0
- package/dist/chunks/resolve-UYKTDZEX.js +228 -0
- package/dist/chunks/{restore-BVDNAJVC.js → restore-Q2DR7SMW.js} +3 -3
- package/dist/chunks/{rm-VHWBHG3A.js → rm-O4M4GFSK.js} +3 -3
- package/dist/chunks/{rm-7KSHXSTB.js → rm-OCLUTM57.js} +4 -4
- package/dist/chunks/{rm-4OQ7G6UX.js → rm-PCWMEHQ2.js} +3 -3
- package/dist/chunks/{rule-inspect-AT6IEOUF.js → rule-inspect-XJ47UEG7.js} +4 -4
- package/dist/chunks/{rules-SQFCUKWS.js → rules-LIH5FLPJ.js} +6 -6
- package/dist/chunks/{schema-PWSCMD24.js → schema-OFALTXXM.js} +2 -2
- package/dist/chunks/{tags-BT7ZGJP2.js → tags-P4HIAI6D.js} +2 -2
- package/dist/chunks/{update-PTDGBKEH.js → update-E3ZQAFBS.js} +4 -4
- package/dist/commands/build/index.js +11 -11
- package/dist/commands/deploy/index.js +13 -12
- package/dist/commands/dev/index.js +10 -10
- package/dist/commands/env/index.js +9 -8
- package/dist/commands/link/index.js +8 -7
- package/dist/commands/list/index.js +5 -5
- package/dist/commands-bulk.js +2744 -1982
- package/dist/index.js +19 -8
- package/dist/vc.js +6 -1
- package/dist/version.mjs +1 -1
- package/package.json +92 -12
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
handleRulesApiError,
|
|
10
10
|
parseRulesFlagsAndScope,
|
|
11
11
|
rulesCollectionPath
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-SWEPOMSA.js";
|
|
13
|
+
import "./chunk-23U6FANO.js";
|
|
14
14
|
import "./chunk-BUZRVER7.js";
|
|
15
15
|
import {
|
|
16
16
|
validateJsonOutput
|
|
@@ -18,13 +18,13 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
rulesAddSubcommand
|
|
20
20
|
} from "./chunk-STJJ3DFO.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-TMK6RSYW.js";
|
|
22
|
+
import "./chunk-ECCWJHC6.js";
|
|
22
23
|
import {
|
|
23
24
|
AGENT_REASON,
|
|
24
25
|
buildCommandWithGlobalFlags,
|
|
25
26
|
outputAgentError
|
|
26
27
|
} from "./chunk-UDWRZXIT.js";
|
|
27
|
-
import "./chunk-ECCWJHC6.js";
|
|
28
28
|
import {
|
|
29
29
|
parseArguments,
|
|
30
30
|
printError
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
handleVcrApiError,
|
|
10
10
|
resolveVcrScope,
|
|
11
11
|
validateVcrJsonOutput
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DI3HR3K6.js";
|
|
13
13
|
import {
|
|
14
14
|
outputError
|
|
15
15
|
} from "./chunk-BUZRVER7.js";
|
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
} from "./chunk-3VS4DTAU.js";
|
|
20
20
|
import "./chunk-GIL3VAUR.js";
|
|
21
21
|
import "./chunk-FYQPTH5C.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-TMK6RSYW.js";
|
|
23
|
+
import "./chunk-ECCWJHC6.js";
|
|
23
24
|
import {
|
|
24
25
|
AGENT_REASON,
|
|
25
26
|
buildCommandWithGlobalFlags,
|
|
26
27
|
outputAgentError
|
|
27
28
|
} from "./chunk-UDWRZXIT.js";
|
|
28
|
-
import "./chunk-ECCWJHC6.js";
|
|
29
29
|
import {
|
|
30
30
|
parseArguments,
|
|
31
31
|
printError
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
|
|
8
|
+
// src/util/can-prompt.ts
|
|
9
|
+
function canPrompt(client) {
|
|
10
|
+
return Boolean(client.stdin.isTTY) && !client.nonInteractive;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
canPrompt
|
|
15
|
+
};
|
|
@@ -19,12 +19,15 @@ import {
|
|
|
19
19
|
require_lib,
|
|
20
20
|
require_minimatch,
|
|
21
21
|
require_pluralize
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TMK6RSYW.js";
|
|
23
23
|
import {
|
|
24
24
|
CantParseJSONFile,
|
|
25
25
|
cmd,
|
|
26
26
|
code
|
|
27
27
|
} from "./chunk-KSSNLCL4.js";
|
|
28
|
+
import {
|
|
29
|
+
pkg_default
|
|
30
|
+
} from "./chunk-P4QNYOFB.js";
|
|
28
31
|
import {
|
|
29
32
|
output_manager_default,
|
|
30
33
|
require_dist
|
|
@@ -10903,7 +10906,7 @@ function notNull(value) {
|
|
|
10903
10906
|
|
|
10904
10907
|
// src/util/build/import-builders.ts
|
|
10905
10908
|
var import_npm_package_arg = __toESM(require_npa(), 1);
|
|
10906
|
-
var
|
|
10909
|
+
var import_semver2 = __toESM(require_semver(), 1);
|
|
10907
10910
|
var import_fs_extra3 = __toESM(require_lib(), 1);
|
|
10908
10911
|
var import_fs_detectors = __toESM(require_dist3(), 1);
|
|
10909
10912
|
import { dirname, join as join2 } from "path";
|
|
@@ -10975,6 +10978,7 @@ var import_error_utils2 = __toESM(require_dist(), 1);
|
|
|
10975
10978
|
|
|
10976
10979
|
// src/util/build/install-builders.ts
|
|
10977
10980
|
var import_pluralize = __toESM(require_pluralize(), 1);
|
|
10981
|
+
var import_semver = __toESM(require_semver(), 1);
|
|
10978
10982
|
var import_fs_extra2 = __toESM(require_lib(), 1);
|
|
10979
10983
|
var import_execa = __toESM(require_execa(), 1);
|
|
10980
10984
|
import { URL } from "url";
|
|
@@ -11009,10 +11013,12 @@ async function untracedInstallBuilders(buildersDir, buildersToAdd) {
|
|
|
11009
11013
|
buildersToAdd
|
|
11010
11014
|
).join(", ")}`
|
|
11011
11015
|
);
|
|
11016
|
+
const buildUtilsVersion = pkg_default.dependencies?.["@vercel/build-utils"];
|
|
11017
|
+
const buildUtilsSpec = buildUtilsVersion && (0, import_semver.validRange)(buildUtilsVersion) ? `@vercel/build-utils@${buildUtilsVersion}` : "@vercel/build-utils";
|
|
11012
11018
|
try {
|
|
11013
11019
|
const { stderr } = await (0, import_execa.default)(
|
|
11014
11020
|
"npm",
|
|
11015
|
-
["install",
|
|
11021
|
+
["install", buildUtilsSpec, ...buildersToAdd],
|
|
11016
11022
|
{
|
|
11017
11023
|
cwd: buildersDir,
|
|
11018
11024
|
stdio: "pipe",
|
|
@@ -11095,14 +11101,45 @@ async function installBuilders(buildersDir, buildersToAdd, span, installReasons)
|
|
|
11095
11101
|
|
|
11096
11102
|
// src/util/build/import-builders.ts
|
|
11097
11103
|
var require_ = createRequire(__filename);
|
|
11104
|
+
var builderPins;
|
|
11105
|
+
function getBuilderPins() {
|
|
11106
|
+
if (!builderPins) {
|
|
11107
|
+
builderPins = /* @__PURE__ */ new Map();
|
|
11108
|
+
const peerDependencies = pkg_default.peerDependencies ?? {};
|
|
11109
|
+
for (const [name, version2] of Object.entries(peerDependencies)) {
|
|
11110
|
+
if ((0, import_semver2.validRange)(version2)) {
|
|
11111
|
+
builderPins.set(name, version2);
|
|
11112
|
+
}
|
|
11113
|
+
}
|
|
11114
|
+
}
|
|
11115
|
+
return builderPins;
|
|
11116
|
+
}
|
|
11117
|
+
function isBareSpec(parsed) {
|
|
11118
|
+
return parsed.type === "tag" && parsed.rawSpec === "";
|
|
11119
|
+
}
|
|
11120
|
+
function pinBuilderSpecs(specs) {
|
|
11121
|
+
const pins = getBuilderPins();
|
|
11122
|
+
const pinnedSpecs = /* @__PURE__ */ new Map();
|
|
11123
|
+
for (const spec of specs) {
|
|
11124
|
+
const parsed = (0, import_npm_package_arg.default)(spec);
|
|
11125
|
+
if (parsed.name && isBareSpec(parsed)) {
|
|
11126
|
+
const version2 = pins.get(parsed.name);
|
|
11127
|
+
if (version2) {
|
|
11128
|
+
pinnedSpecs.set(spec, `${parsed.name}@${version2}`);
|
|
11129
|
+
}
|
|
11130
|
+
}
|
|
11131
|
+
}
|
|
11132
|
+
return pinnedSpecs;
|
|
11133
|
+
}
|
|
11098
11134
|
async function importBuilders(builderSpecs, cwd, span) {
|
|
11099
11135
|
const buildersDir = join2(cwd, VERCEL_DIR, "builders");
|
|
11100
11136
|
let importResult = await resolveBuilders(buildersDir, builderSpecs);
|
|
11101
11137
|
if ("buildersToAdd" in importResult) {
|
|
11102
11138
|
const { buildersToAdd, installReasons } = importResult;
|
|
11139
|
+
const pinnedSpecs = pinBuilderSpecs(buildersToAdd);
|
|
11103
11140
|
const installResult = await installBuilders(
|
|
11104
11141
|
buildersDir,
|
|
11105
|
-
buildersToAdd,
|
|
11142
|
+
new Set(Array.from(buildersToAdd, (spec) => pinnedSpecs.get(spec) ?? spec)),
|
|
11106
11143
|
span,
|
|
11107
11144
|
installReasons
|
|
11108
11145
|
);
|
|
@@ -11112,7 +11149,18 @@ async function importBuilders(builderSpecs, cwd, span) {
|
|
|
11112
11149
|
installResult
|
|
11113
11150
|
);
|
|
11114
11151
|
if ("buildersToAdd" in importResult) {
|
|
11115
|
-
|
|
11152
|
+
const { buildersToAdd: failed, installReasons: reasons } = importResult;
|
|
11153
|
+
const failures = Array.from(failed, (spec) => {
|
|
11154
|
+
const reason = reasons.get(spec);
|
|
11155
|
+
return reason ? `${spec} (${reason})` : spec;
|
|
11156
|
+
});
|
|
11157
|
+
const err = new Error(
|
|
11158
|
+
`Failed to load Builders after installing them: ${failures.join(
|
|
11159
|
+
", "
|
|
11160
|
+
)}. Retry the build. If the failure persists, contact Vercel Support.`
|
|
11161
|
+
);
|
|
11162
|
+
err.link = "https://vercel.link/builder-dependencies-install-failed";
|
|
11163
|
+
throw err;
|
|
11116
11164
|
}
|
|
11117
11165
|
}
|
|
11118
11166
|
const resolvedBuildersDebug = [];
|
|
@@ -11183,6 +11231,15 @@ async function resolveBuilders(buildersDir, builderSpecs, resolvedSpecs) {
|
|
|
11183
11231
|
`\`package.json\` for "${name}" does not contain a "version" field`
|
|
11184
11232
|
);
|
|
11185
11233
|
}
|
|
11234
|
+
const peerVersion = getBuilderPins().get(name);
|
|
11235
|
+
if (isBareSpec(parsed) && peerVersion && pkgPath.startsWith(buildersDir) && !(0, import_semver2.satisfies)(builderPkg.version, peerVersion)) {
|
|
11236
|
+
output_manager_default.debug(
|
|
11237
|
+
`Cached "${name}@${builderPkg.version}" does not satisfy "${peerVersion}"`
|
|
11238
|
+
);
|
|
11239
|
+
buildersToAdd.add(spec);
|
|
11240
|
+
installReasons.set(spec, "peer-version-mismatch");
|
|
11241
|
+
continue;
|
|
11242
|
+
}
|
|
11186
11243
|
if (parsed.type === "version" && parsed.rawSpec !== builderPkg.version) {
|
|
11187
11244
|
output_manager_default.debug(
|
|
11188
11245
|
`Installed version "${name}@${builderPkg.version}" does not match "${parsed.rawSpec}"`
|
|
@@ -11191,7 +11248,7 @@ async function resolveBuilders(buildersDir, builderSpecs, resolvedSpecs) {
|
|
|
11191
11248
|
installReasons.set(spec, "version-mismatch");
|
|
11192
11249
|
continue;
|
|
11193
11250
|
}
|
|
11194
|
-
if (parsed.type === "range" && !(0,
|
|
11251
|
+
if (parsed.type === "range" && !(0, import_semver2.satisfies)(builderPkg.version, parsed.rawSpec)) {
|
|
11195
11252
|
output_manager_default.debug(
|
|
11196
11253
|
`Installed version "${name}@${builderPkg.version}" is not compatible with "${parsed.rawSpec}"`
|
|
11197
11254
|
);
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
PromptBackError,
|
|
12
12
|
PromptCanceledError,
|
|
13
13
|
getLocalPathConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GNV7547O.js";
|
|
15
15
|
import {
|
|
16
16
|
DEFAULT_VERCEL_CONFIG_FILENAME,
|
|
17
17
|
VERCEL_CONFIG_EXTENSIONS,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
useKeypress,
|
|
39
39
|
usePrefix,
|
|
40
40
|
useState
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-TMK6RSYW.js";
|
|
42
42
|
import {
|
|
43
43
|
require_load_json_file
|
|
44
44
|
} from "./chunk-ECCWJHC6.js";
|
|
@@ -7,17 +7,17 @@ const __dirname = __dirname_(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
getUpdateCommandInfo,
|
|
9
9
|
isGlobal
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GAOAGU5K.js";
|
|
11
11
|
import {
|
|
12
12
|
getGlobalPathConfig,
|
|
13
13
|
progress,
|
|
14
14
|
writeToConfigFile
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3BHSS5E2.js";
|
|
16
16
|
import {
|
|
17
17
|
apiCommand,
|
|
18
18
|
listSubcommand3 as listSubcommand,
|
|
19
19
|
loginCommand
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-IBP2XAUH.js";
|
|
21
21
|
import {
|
|
22
22
|
require_semver
|
|
23
23
|
} from "./chunk-IB5L4LKZ.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./chunk-DMSLNAVH.js";
|
|
27
27
|
import {
|
|
28
28
|
login
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-TMK6RSYW.js";
|
|
30
30
|
import {
|
|
31
31
|
TelemetryClient,
|
|
32
32
|
isNativeBinaryInstall
|
|
@@ -1278,7 +1278,7 @@ function generateCurlCommand(config, baseUrl) {
|
|
|
1278
1278
|
for (const [key, value] of Object.entries(config.headers)) {
|
|
1279
1279
|
parts.push(`-H '${key}: ${escapeShellArg(value)}'`);
|
|
1280
1280
|
}
|
|
1281
|
-
if (config.body) {
|
|
1281
|
+
if (config.method !== "GET" && config.body) {
|
|
1282
1282
|
const bodyStr = typeof config.body === "string" ? config.body : JSON.stringify(config.body);
|
|
1283
1283
|
parts.push(`-H 'Content-Type: application/json'`);
|
|
1284
1284
|
parts.push(`-d '${escapeShellArg(bodyStr)}'`);
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import {
|
|
8
|
+
ALIGNED_LABEL_WIDTH
|
|
9
|
+
} from "./chunk-TMK6RSYW.js";
|
|
10
|
+
import {
|
|
11
|
+
require_ms
|
|
12
|
+
} from "./chunk-GGP5R3FU.js";
|
|
13
|
+
import {
|
|
14
|
+
require_source
|
|
15
|
+
} from "./chunk-S7KYDPEM.js";
|
|
16
|
+
import {
|
|
17
|
+
__toESM
|
|
18
|
+
} from "./chunk-TZ2YI2VH.js";
|
|
19
|
+
|
|
20
|
+
// src/commands/comments/format.ts
|
|
21
|
+
var import_chalk = __toESM(require_source(), 1);
|
|
22
|
+
var import_ms = __toESM(require_ms(), 1);
|
|
23
|
+
function alignedRow(label, value) {
|
|
24
|
+
return ` ${import_chalk.default.bold(label.padEnd(ALIGNED_LABEL_WIDTH))}${value}`;
|
|
25
|
+
}
|
|
26
|
+
function actorLabel(actor) {
|
|
27
|
+
if (!actor) {
|
|
28
|
+
return "-";
|
|
29
|
+
}
|
|
30
|
+
const base = actor.name || actor.username || actor.id;
|
|
31
|
+
return actor.type === "app" ? `${base} (app)` : base;
|
|
32
|
+
}
|
|
33
|
+
function relativeAge(timestamp) {
|
|
34
|
+
if (!timestamp || !Number.isFinite(timestamp)) {
|
|
35
|
+
return "-";
|
|
36
|
+
}
|
|
37
|
+
const delta = Date.now() - timestamp;
|
|
38
|
+
if (delta < 1e3) {
|
|
39
|
+
return "now";
|
|
40
|
+
}
|
|
41
|
+
return (0, import_ms.default)(delta);
|
|
42
|
+
}
|
|
43
|
+
function displayPath(thread) {
|
|
44
|
+
const href = thread.context?.href;
|
|
45
|
+
if (href) {
|
|
46
|
+
try {
|
|
47
|
+
return new URL(href).pathname;
|
|
48
|
+
} catch {
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return thread.context?.path || "/";
|
|
52
|
+
}
|
|
53
|
+
function truncate(text, max) {
|
|
54
|
+
const normalized = text.replace(/\s+/g, " ").trim();
|
|
55
|
+
const segmenter = new Intl.Segmenter();
|
|
56
|
+
const graphemes = [...segmenter.segment(normalized)];
|
|
57
|
+
if (graphemes.length <= max) {
|
|
58
|
+
return normalized;
|
|
59
|
+
}
|
|
60
|
+
return `${graphemes.slice(0, Math.max(0, max - 1)).map((s) => s.segment).join("")}\u2026`;
|
|
61
|
+
}
|
|
62
|
+
function firstMessageText(thread) {
|
|
63
|
+
return thread.messages[0]?.text ?? "";
|
|
64
|
+
}
|
|
65
|
+
function threadAge(thread) {
|
|
66
|
+
return relativeAge(thread.messages[0]?.timestamp);
|
|
67
|
+
}
|
|
68
|
+
function renderThreadSummary(thread, complete) {
|
|
69
|
+
const replies = thread.messageCount - 1;
|
|
70
|
+
const rootAuthorId = complete ? thread.messages[0]?.author.id : void 0;
|
|
71
|
+
const names = [];
|
|
72
|
+
const seen = /* @__PURE__ */ new Set();
|
|
73
|
+
for (const message of thread.messages) {
|
|
74
|
+
const { author } = message;
|
|
75
|
+
if (author.id === rootAuthorId || seen.has(author.id)) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
seen.add(author.id);
|
|
79
|
+
names.push(actorLabel(author));
|
|
80
|
+
}
|
|
81
|
+
const shown = names.slice(0, 3);
|
|
82
|
+
const overflow = names.length - shown.length;
|
|
83
|
+
const participants = shown.length > 0 ? `${shown.join(", ")}${overflow > 0 ? ` +${overflow} more` : ""}` : void 0;
|
|
84
|
+
const lastTimestamp = thread.messages[thread.messages.length - 1]?.timestamp;
|
|
85
|
+
const parts = [`\u2192 ${replies} ${replies === 1 ? "reply" : "replies"}`];
|
|
86
|
+
if (participants) {
|
|
87
|
+
parts.push(participants);
|
|
88
|
+
}
|
|
89
|
+
parts.push(`last ${relativeAge(lastTimestamp)} ago`);
|
|
90
|
+
return parts.join(" \xB7 ");
|
|
91
|
+
}
|
|
92
|
+
function renderThreadRow(thread, opts) {
|
|
93
|
+
const complete = thread.messageCount <= thread.messages.length;
|
|
94
|
+
const dot = thread.resolved ? import_chalk.default.dim("\u25CB") : "\u25CF";
|
|
95
|
+
const author = complete ? actorLabel(thread.messages[0]?.author) : "\u2026";
|
|
96
|
+
const columns = [
|
|
97
|
+
dot,
|
|
98
|
+
thread.id,
|
|
99
|
+
import_chalk.default.dim(threadAge(thread)),
|
|
100
|
+
author,
|
|
101
|
+
displayPath(thread)
|
|
102
|
+
];
|
|
103
|
+
if (opts.showBranch && thread.branch) {
|
|
104
|
+
columns.push(import_chalk.default.dim(thread.branch));
|
|
105
|
+
}
|
|
106
|
+
if (thread.isLocalhost) {
|
|
107
|
+
columns.push(import_chalk.default.dim("localhost"));
|
|
108
|
+
}
|
|
109
|
+
const lines = [` ${columns.join(" ")}`];
|
|
110
|
+
if (complete) {
|
|
111
|
+
const excerpt = truncate(firstMessageText(thread), 80);
|
|
112
|
+
if (excerpt) {
|
|
113
|
+
lines.push(` \u201C${excerpt}\u201D`);
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
lines.push(
|
|
117
|
+
import_chalk.default.dim(" (long thread \u2014 inspect for the full conversation)")
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
const selection = thread.context?.selection;
|
|
121
|
+
if (selection) {
|
|
122
|
+
lines.push(import_chalk.default.dim(` \u2192 selected: \u201C${truncate(selection, 60)}\u201D`));
|
|
123
|
+
}
|
|
124
|
+
if (thread.messageCount > 1) {
|
|
125
|
+
lines.push(import_chalk.default.dim(` ${renderThreadSummary(thread, complete)}`));
|
|
126
|
+
}
|
|
127
|
+
const meta = [];
|
|
128
|
+
const reactionCount = thread.messages.reduce(
|
|
129
|
+
(acc, message) => acc + (message.reactions?.length ?? 0),
|
|
130
|
+
0
|
|
131
|
+
);
|
|
132
|
+
if (reactionCount > 0) {
|
|
133
|
+
meta.push(
|
|
134
|
+
`${reactionCount} ${reactionCount === 1 ? "reaction" : "reactions"}`
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
const attachmentCount = thread.messages.reduce(
|
|
138
|
+
(acc, message) => acc + (message.attachments?.length ?? 0),
|
|
139
|
+
0
|
|
140
|
+
);
|
|
141
|
+
if (attachmentCount > 0) {
|
|
142
|
+
meta.push(
|
|
143
|
+
`${attachmentCount} ${attachmentCount === 1 ? "attachment" : "attachments"}`
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
if (thread.resolved) {
|
|
147
|
+
meta.push(`resolved by ${actorLabel(thread.resolvedBy)}`);
|
|
148
|
+
}
|
|
149
|
+
if (meta.length > 0) {
|
|
150
|
+
lines.push(import_chalk.default.dim(` ${meta.join(" \xB7 ")}`));
|
|
151
|
+
}
|
|
152
|
+
return lines.join("\n");
|
|
153
|
+
}
|
|
154
|
+
function renderReactions(message) {
|
|
155
|
+
if (!message.reactions || message.reactions.length === 0) {
|
|
156
|
+
return void 0;
|
|
157
|
+
}
|
|
158
|
+
return message.reactions.map((r) => `${r.emoji} ${r.name} \xB7 ${r.users.length}`).join(" ");
|
|
159
|
+
}
|
|
160
|
+
function renderMessage(message) {
|
|
161
|
+
const lines = [
|
|
162
|
+
`${import_chalk.default.bold(actorLabel(message.author))} \xB7 ${relativeAge(message.timestamp)} ago \xB7 ${import_chalk.default.dim(message.id)}`
|
|
163
|
+
];
|
|
164
|
+
for (const textLine of message.text.split("\n")) {
|
|
165
|
+
lines.push(` ${textLine}`);
|
|
166
|
+
}
|
|
167
|
+
for (const attachment of message.attachments ?? []) {
|
|
168
|
+
const dimensions = attachment.width && attachment.height ? ` (${attachment.width}\xD7${attachment.height})` : "";
|
|
169
|
+
lines.push(
|
|
170
|
+
`${import_chalk.default.dim(` \u2192 attachment ${attachment.filename}${dimensions}`)} ${import_chalk.default.cyan(attachment.url)}`
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
const reactions = renderReactions(message);
|
|
174
|
+
if (reactions) {
|
|
175
|
+
lines.push(` ${reactions}`);
|
|
176
|
+
}
|
|
177
|
+
return lines.join("\n");
|
|
178
|
+
}
|
|
179
|
+
function renderThreadDetail(thread, messages, opts) {
|
|
180
|
+
const sections = [];
|
|
181
|
+
const status = thread.resolved ? import_chalk.default.dim(`resolved by ${actorLabel(thread.resolvedBy)}`) : "unresolved";
|
|
182
|
+
const headline = [import_chalk.default.bold(thread.id), status];
|
|
183
|
+
if (thread.branch) {
|
|
184
|
+
headline.push(import_chalk.default.dim(thread.branch));
|
|
185
|
+
}
|
|
186
|
+
if (thread.isLocalhost) {
|
|
187
|
+
headline.push(import_chalk.default.dim("localhost"));
|
|
188
|
+
}
|
|
189
|
+
sections.push(headline.join(" \xB7 "));
|
|
190
|
+
const headerLines = [];
|
|
191
|
+
const path = displayPath(thread);
|
|
192
|
+
const pageTitle = thread.context?.pageTitle;
|
|
193
|
+
headerLines.push(pageTitle ? `${path} \u2014 \u201C${pageTitle}\u201D` : path);
|
|
194
|
+
if (thread.context?.href) {
|
|
195
|
+
headerLines.push(import_chalk.default.cyan(thread.context.href));
|
|
196
|
+
}
|
|
197
|
+
sections.push(headerLines.join("\n"));
|
|
198
|
+
const contextLines = [];
|
|
199
|
+
if (thread.context?.selection) {
|
|
200
|
+
contextLines.push(alignedRow("Selected", `\u201C${thread.context.selection}\u201D`));
|
|
201
|
+
}
|
|
202
|
+
if (thread.context?.selector) {
|
|
203
|
+
contextLines.push(alignedRow("Element", thread.context.selector));
|
|
204
|
+
}
|
|
205
|
+
for (const link of thread.links ?? []) {
|
|
206
|
+
contextLines.push(
|
|
207
|
+
alignedRow("Linked", `${link.label} \u2014 ${import_chalk.default.cyan(link.link)}`)
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
if (contextLines.length > 0) {
|
|
211
|
+
sections.push(contextLines.join("\n"));
|
|
212
|
+
}
|
|
213
|
+
sections.push(messages.map(renderMessage).join("\n\n"));
|
|
214
|
+
if (opts.showContext) {
|
|
215
|
+
const extra = [];
|
|
216
|
+
if (thread.context?.frameworkContext) {
|
|
217
|
+
extra.push(
|
|
218
|
+
`${import_chalk.default.bold("Framework context")}
|
|
219
|
+
${thread.context.frameworkContext}`
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
if (thread.context?.device) {
|
|
223
|
+
extra.push(
|
|
224
|
+
`${import_chalk.default.bold("Device")}
|
|
225
|
+
${JSON.stringify(thread.context.device, null, 2)}`
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
if (extra.length > 0) {
|
|
229
|
+
sections.push(extra.join("\n\n"));
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (thread.webUrl) {
|
|
233
|
+
sections.push(`Open in Vercel \u2192 ${import_chalk.default.cyan(thread.webUrl)}`);
|
|
234
|
+
}
|
|
235
|
+
return sections.join("\n\n");
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export {
|
|
239
|
+
actorLabel,
|
|
240
|
+
displayPath,
|
|
241
|
+
truncate,
|
|
242
|
+
threadAge,
|
|
243
|
+
renderThreadRow,
|
|
244
|
+
renderThreadDetail
|
|
245
|
+
};
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
progress,
|
|
11
11
|
require_dist as require_dist2,
|
|
12
12
|
sleep
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3BHSS5E2.js";
|
|
14
14
|
import {
|
|
15
15
|
suggestNextCommands
|
|
16
16
|
} from "./chunk-XBN2O34P.js";
|
|
17
17
|
import {
|
|
18
18
|
CommandTimeout
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IBP2XAUH.js";
|
|
20
20
|
import {
|
|
21
21
|
showPluginTipIfNeeded
|
|
22
22
|
} from "./chunk-NJUPUGOE.js";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
require_dist as require_dist3,
|
|
34
34
|
require_pluralize,
|
|
35
35
|
ua_default
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-TMK6RSYW.js";
|
|
37
37
|
import {
|
|
38
38
|
require_strip_ansi,
|
|
39
39
|
responseError
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
|
|
8
|
+
// src/commands/comments/threads.ts
|
|
9
|
+
function parseThreadArg(arg) {
|
|
10
|
+
if (!/^https?:\/\//i.test(arg)) {
|
|
11
|
+
return { id: arg };
|
|
12
|
+
}
|
|
13
|
+
let url;
|
|
14
|
+
try {
|
|
15
|
+
url = new URL(arg);
|
|
16
|
+
} catch {
|
|
17
|
+
return void 0;
|
|
18
|
+
}
|
|
19
|
+
const segments = url.pathname.split("/").filter(Boolean);
|
|
20
|
+
const cIndex = segments.lastIndexOf("c");
|
|
21
|
+
if (cIndex !== -1 && cIndex + 1 < segments.length) {
|
|
22
|
+
const id = safeDecode(segments[cIndex + 1]);
|
|
23
|
+
if (!id) {
|
|
24
|
+
return void 0;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
id,
|
|
28
|
+
teamSlug: cIndex > 1 ? safeDecode(segments[0]) : void 0
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return void 0;
|
|
32
|
+
}
|
|
33
|
+
function safeDecode(segment) {
|
|
34
|
+
try {
|
|
35
|
+
return decodeURIComponent(segment) || void 0;
|
|
36
|
+
} catch {
|
|
37
|
+
return void 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
parseThreadArg
|
|
43
|
+
};
|
|
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
8
|
writeProjectSettings
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JQG5EDRD.js";
|
|
10
10
|
import {
|
|
11
11
|
autoInstallVercelPlugin
|
|
12
12
|
} from "./chunk-NJUPUGOE.js";
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
} from "./chunk-64IF634X.js";
|
|
16
16
|
import {
|
|
17
17
|
ensureLink
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-X43U65TH.js";
|
|
19
19
|
import {
|
|
20
20
|
pullCommand
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-PRYNIKBZ.js";
|
|
22
22
|
import {
|
|
23
23
|
help
|
|
24
24
|
} from "./chunk-DMSLNAVH.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
envPullCommandLogic,
|
|
29
29
|
humanizePath,
|
|
30
30
|
parseTarget
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-TMK6RSYW.js";
|
|
32
32
|
import {
|
|
33
33
|
TelemetryClient
|
|
34
34
|
} from "./chunk-ECCWJHC6.js";
|