vercel 56.5.0 → 57.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.
Files changed (90) hide show
  1. package/dist/chunks/{add-6GRH6G2M.js → add-7M577U56.js} +6 -5
  2. package/dist/chunks/{add-KNK5E2YT.js → add-YRZTDNXX.js} +2 -2
  3. package/dist/chunks/{chunk-4MK452Y5.js → chunk-2EDWKVNP.js} +8 -8
  4. package/dist/chunks/{chunk-YS6EDZHB.js → chunk-2MJROFVC.js} +5 -1
  5. package/dist/chunks/{chunk-JQG5EDRD.js → chunk-3242RXCN.js} +1 -1
  6. package/dist/chunks/chunk-3PGXYIKC.js +147 -0
  7. package/dist/chunks/{chunk-3BHSS5E2.js → chunk-4PGF367U.js} +47 -210
  8. package/dist/chunks/{chunk-ARKHETJP.js → chunk-555WJSO5.js} +1 -1
  9. package/dist/chunks/chunk-5AJPMLDV.js +28 -0
  10. package/dist/chunks/{chunk-IBP2XAUH.js → chunk-A2TYQBX2.js} +17 -3
  11. package/dist/chunks/{chunk-V5P25P7F.js → chunk-A3NYPUKZ.js} +7 -12
  12. package/dist/chunks/{chunk-W346YNDN.js → chunk-DWMH5M4Q.js} +4 -1
  13. package/dist/chunks/{chunk-BM36UWE2.js → chunk-F5PQWDOC.js} +1 -1
  14. package/dist/chunks/{chunk-DOF6CJLL.js → chunk-F7X55TOY.js} +15 -839
  15. package/dist/chunks/chunk-FGDKMNEN.js +21 -0
  16. package/dist/chunks/{chunk-DI3HR3K6.js → chunk-GP5VCTEU.js} +1 -1
  17. package/dist/chunks/chunk-GZLPFESR.js +48 -0
  18. package/dist/chunks/{chunk-X43U65TH.js → chunk-HD7B425F.js} +2 -2
  19. package/dist/chunks/{chunk-CM3DLBDY.js → chunk-IOAZNR6Z.js} +1 -1
  20. package/dist/chunks/{chunk-STJJ3DFO.js → chunk-KCF6S3XF.js} +16 -1
  21. package/dist/chunks/{chunk-YTFJGKRG.js → chunk-LMHT3QR3.js} +1 -1
  22. package/dist/chunks/{chunk-SWEPOMSA.js → chunk-MAHINYBW.js} +4 -3
  23. package/dist/chunks/{chunk-G4MTGCZ5.js → chunk-MIFDRYTN.js} +1 -1
  24. package/dist/chunks/{chunk-PRYNIKBZ.js → chunk-NH43BFJ3.js} +1 -1
  25. package/dist/chunks/{chunk-Z7NPYIZ6.js → chunk-NM43FFV6.js} +0 -8
  26. package/dist/chunks/{chunk-PPEQUJ7T.js → chunk-NRNMT43R.js} +3 -3
  27. package/dist/chunks/chunk-OF2GNB42.js +53 -0
  28. package/dist/chunks/chunk-PRWJUY5U.js +848 -0
  29. package/dist/chunks/{chunk-F5OMERHI.js → chunk-QZD5DKUR.js} +10 -23
  30. package/dist/chunks/{chunk-26TEKOBZ.js → chunk-RAFH25WW.js} +8 -1
  31. package/dist/chunks/{chunk-GAOAGU5K.js → chunk-RYO6FJFB.js} +1 -1
  32. package/dist/chunks/{chunk-23U6FANO.js → chunk-T4NODP6Y.js} +11 -18
  33. package/dist/chunks/{chunk-TMK6RSYW.js → chunk-TBR2Q37Y.js} +1202 -947
  34. package/dist/chunks/chunk-V4RMJKQP.js +36 -0
  35. package/dist/chunks/{chunk-6RTK6BWX.js → chunk-YA3WQFLY.js} +1 -1
  36. package/dist/chunks/{chunk-EYICIM2K.js → chunk-YOZCJHLZ.js} +4 -4
  37. package/dist/chunks/{compile-vercel-config-IFET4E6H.js → compile-vercel-config-3OHO3TJA.js} +1 -1
  38. package/dist/chunks/config-validator.mjs +1 -1
  39. package/dist/chunks/{delete-X2MUMONI.js → delete-3DZOCWCC.js} +2 -2
  40. package/dist/chunks/{delete-PXB5WRH7.js → delete-VOSJLNEA.js} +2 -2
  41. package/dist/chunks/{disable-GBL3SHJL.js → disable-LQDEVRQF.js} +2 -2
  42. package/dist/chunks/{discard-XVVSRGDR.js → discard-RGV4JKXQ.js} +2 -2
  43. package/dist/chunks/{edit-EIHRP6XT.js → edit-SFIEOQ24.js} +3 -3
  44. package/dist/chunks/{edit-K5Y2BDJO.js → edit-UPZPI54L.js} +2 -2
  45. package/dist/chunks/{enable-W7AMJWKH.js → enable-6UVH35WC.js} +2 -2
  46. package/dist/chunks/{export-N3AZ2KOO.js → export-6CEG3CK7.js} +2 -2
  47. package/dist/chunks/{image-DRTGVPVJ.js → image-CQRCD2OE.js} +3 -3
  48. package/dist/chunks/{inspect-SLZLI6ZC.js → inspect-4ZAH3RFT.js} +3 -3
  49. package/dist/chunks/inspect-EXQBIAFF.js +587 -0
  50. package/dist/chunks/{inspect-AAIVWSJI.js → inspect-K5ZMQG7X.js} +2 -2
  51. package/dist/chunks/{inspect-DYXTX6P4.js → inspect-UM3LDRPV.js} +2 -2
  52. package/dist/chunks/{inspect-IPSAYR2C.js → inspect-ZFRY3X3H.js} +2 -2
  53. package/dist/chunks/{list-V7VTXVK4.js → list-4DRVM7Q4.js} +41 -54
  54. package/dist/chunks/{list-IF2YW73F.js → list-FJCBOCCA.js} +1 -1
  55. package/dist/chunks/{list-K2HLGUXV.js → list-KCUHD4OA.js} +3 -3
  56. package/dist/chunks/{login-7C6HQEOG.js → login-DFGYNU3K.js} +2 -2
  57. package/dist/chunks/{ls-QQQHOJBE.js → ls-34NCZKBE.js} +2 -2
  58. package/dist/chunks/{ls-NKECPPOR.js → ls-4QHHVXXD.js} +2 -2
  59. package/dist/chunks/{ls-2NU353QP.js → ls-CG6A7UXF.js} +2 -2
  60. package/dist/chunks/ls-RHEQ6YQB.js +188 -0
  61. package/dist/chunks/{open-2FAPZA6V.js → open-E3XADEMX.js} +2 -2
  62. package/dist/chunks/{publish-G7PB64LJ.js → publish-Z3AQRUCS.js} +2 -2
  63. package/dist/chunks/{query-D4QBT4WR.js → query-3EV66DO3.js} +8 -8
  64. package/dist/chunks/{reorder-3Z7YIPAX.js → reorder-VA5E5ZJT.js} +2 -2
  65. package/dist/chunks/{reply-7QQBXL5H.js → reply-SNSCNKAW.js} +2 -2
  66. package/dist/chunks/{resolve-UYKTDZEX.js → resolve-6ZX4RTXX.js} +2 -2
  67. package/dist/chunks/{restore-Q2DR7SMW.js → restore-NEHI5B5P.js} +2 -2
  68. package/dist/chunks/{rm-PCWMEHQ2.js → rm-22B22E47.js} +2 -2
  69. package/dist/chunks/{rm-O4M4GFSK.js → rm-E5ZVLAKO.js} +2 -2
  70. package/dist/chunks/{rm-OCLUTM57.js → rm-FR6KE744.js} +6 -5
  71. package/dist/chunks/rule-inspect-DMP2CKJQ.js +283 -0
  72. package/dist/chunks/{rules-LIH5FLPJ.js → rules-EYGXEI2Z.js} +7 -7
  73. package/dist/chunks/{schema-OFALTXXM.js → schema-2IIWOBSQ.js} +6 -4
  74. package/dist/chunks/{tags-P4HIAI6D.js → tags-ZDVYRHAY.js} +2 -2
  75. package/dist/chunks/{update-E3ZQAFBS.js → update-QH4DQMZV.js} +6 -5
  76. package/dist/commands/build/index.js +42 -10
  77. package/dist/commands/deploy/index.js +34 -24
  78. package/dist/commands/dev/index.js +10 -13
  79. package/dist/commands/env/index.js +8 -7
  80. package/dist/commands/link/index.js +8 -8
  81. package/dist/commands/list/index.js +2 -2
  82. package/dist/commands-bulk.js +1836 -1796
  83. package/dist/index.js +19 -20
  84. package/dist/vc.js +54 -18
  85. package/dist/version.mjs +1 -1
  86. package/package.json +38 -38
  87. package/dist/chunks/chunk-GNV7547O.js +0 -86
  88. package/dist/chunks/inspect-5YUAEI3L.js +0 -351
  89. package/dist/chunks/ls-RH6Y4XBS.js +0 -113
  90. package/dist/chunks/rule-inspect-XJ47UEG7.js +0 -141
@@ -0,0 +1,283 @@
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
+ formatCustomAlertMetric,
9
+ formatCustomAlertTrigger,
10
+ formatRuleScope,
11
+ humanizeReference,
12
+ isCustomAlertRule,
13
+ parseCustomAlertQuery,
14
+ renderAlertTable
15
+ } from "./chunk-3PGXYIKC.js";
16
+ import {
17
+ emitRulesArgParseError,
18
+ handleRulesApiError,
19
+ parseRulesFlagsAndScope,
20
+ rulesItemPath
21
+ } from "./chunk-MAHINYBW.js";
22
+ import "./chunk-T4NODP6Y.js";
23
+ import {
24
+ formatDate
25
+ } from "./chunk-GZLPFESR.js";
26
+ import {
27
+ formatGranularity
28
+ } from "./chunk-5AJPMLDV.js";
29
+ import "./chunk-A3NYPUKZ.js";
30
+ import "./chunk-BUZRVER7.js";
31
+ import "./chunk-FGDKMNEN.js";
32
+ import "./chunk-PRWJUY5U.js";
33
+ import {
34
+ truncateMiddle
35
+ } from "./chunk-OF2GNB42.js";
36
+ import {
37
+ validateJsonOutput
38
+ } from "./chunk-XPKWKPWA.js";
39
+ import {
40
+ rulesInspectSubcommand
41
+ } from "./chunk-KCF6S3XF.js";
42
+ import "./chunk-NZRWTCRM.js";
43
+ import "./chunk-TBR2Q37Y.js";
44
+ import "./chunk-ECCWJHC6.js";
45
+ import {
46
+ AGENT_REASON,
47
+ buildCommandWithGlobalFlags,
48
+ outputAgentError
49
+ } from "./chunk-UDWRZXIT.js";
50
+ import {
51
+ parseArguments,
52
+ printError
53
+ } from "./chunk-SZXT3PDQ.js";
54
+ import {
55
+ getFlagsSpecification,
56
+ isAPIError,
57
+ packageName
58
+ } from "./chunk-KSSNLCL4.js";
59
+ import "./chunk-P4QNYOFB.js";
60
+ import "./chunk-52QYYTM5.js";
61
+ import {
62
+ output_manager_default
63
+ } from "./chunk-OX7KI3LF.js";
64
+ import "./chunk-GGP5R3FU.js";
65
+ import {
66
+ require_source
67
+ } from "./chunk-S7KYDPEM.js";
68
+ import {
69
+ __toESM
70
+ } from "./chunk-TZ2YI2VH.js";
71
+
72
+ // src/commands/alerts/rules/rule-inspect.ts
73
+ var import_chalk = __toESM(require_source(), 1);
74
+ function formatBoolean(value) {
75
+ if (value === void 0) {
76
+ return "-";
77
+ }
78
+ return value ? "yes" : "no";
79
+ }
80
+ function getAlertTypeRows(rule) {
81
+ const types = rule.alertTypes?.map((alertType) => alertType.type) ?? (rule.customAlert ? ["custom_alert"] : []);
82
+ if (types.length === 0) {
83
+ return [];
84
+ }
85
+ const uniqueTypes = [...new Set(types)];
86
+ return [
87
+ [
88
+ uniqueTypes.length === 1 ? "Type" : "Types",
89
+ uniqueTypes.map((value) => humanizeReference(value)).join(", ")
90
+ ]
91
+ ];
92
+ }
93
+ function getNotificationRows(rule) {
94
+ const rows = [];
95
+ if (rule.autosubscribeOwnersInKnock !== void 0) {
96
+ rows.push([
97
+ "Auto-subscribe owners",
98
+ formatBoolean(rule.autosubscribeOwnersInKnock)
99
+ ]);
100
+ }
101
+ if (rule.autosubscribeProjectAdminsInKnock !== void 0) {
102
+ rows.push([
103
+ "Auto-subscribe project admins",
104
+ formatBoolean(rule.autosubscribeProjectAdminsInKnock)
105
+ ]);
106
+ }
107
+ const slackChannels = /* @__PURE__ */ new Set();
108
+ const webhooks = /* @__PURE__ */ new Set();
109
+ for (const notification of rule.notifications ?? []) {
110
+ for (const channel of notification.slack ?? []) {
111
+ slackChannels.add(channel);
112
+ }
113
+ for (const webhook of notification.webhooks ?? []) {
114
+ webhooks.add(webhook);
115
+ }
116
+ }
117
+ if (slackChannels.size > 0) {
118
+ rows.push(["Slack", [...slackChannels].join(", ")]);
119
+ }
120
+ if (webhooks.size > 0) {
121
+ rows.push(["Webhooks", [...webhooks].join(", ")]);
122
+ }
123
+ return rows;
124
+ }
125
+ function getCustomAlertRows(customAlert) {
126
+ const query = parseCustomAlertQuery(customAlert.queryJsonString);
127
+ const granularity = formatGranularity(query.granularity);
128
+ const groupBy = query.groupBy ?? [];
129
+ const rows = [
130
+ ["Title", customAlert.title || "-"],
131
+ ["Metric", formatCustomAlertMetric(customAlert) || "-"],
132
+ ["Trigger", formatCustomAlertTrigger(customAlert) || "-"],
133
+ ...typeof customAlert.minThreshold === "number" ? [["Minimum", String(customAlert.minThreshold)]] : [],
134
+ ...query.event ? [["Event", humanizeReference(query.event)]] : [],
135
+ ...groupBy.length > 0 ? [
136
+ [
137
+ "Group By",
138
+ groupBy.map((value) => humanizeReference(value)).join(", ")
139
+ ]
140
+ ] : [],
141
+ ...granularity ? [["Granularity", granularity]] : [],
142
+ ...customAlert.createdAt ? [["Created At", formatDate(customAlert.createdAt)]] : []
143
+ ];
144
+ return rows.map(([label, value]) => [label, truncateMiddle(value, 96)]);
145
+ }
146
+ function printRule(rule, ruleId) {
147
+ const summaryRows = [
148
+ ["Name", rule.name || "-"],
149
+ ...rule.action === "exclude" ? [["Action", rule.action]] : [],
150
+ ["Scope", formatRuleScope(rule.projectId)],
151
+ ...getAlertTypeRows(rule),
152
+ ...rule.sensitivityLevel !== void 0 ? [["Sensitivity", String(rule.sensitivityLevel)]] : [],
153
+ ...rule.isDefault !== void 0 ? [["Default", formatBoolean(rule.isDefault)]] : [],
154
+ ...rule.owner ? [["Owner", rule.owner]] : [],
155
+ ...rule.teamId ? [["Team id", rule.teamId]] : [],
156
+ ...rule.lastEditedByUserId ? [["Last Edited By", rule.lastEditedByUserId]] : [],
157
+ ...rule.odataFilters ? [["OData Filters", rule.odataFilters]] : []
158
+ ];
159
+ const sections = [
160
+ "",
161
+ `${import_chalk.default.bold("Alert rule")} ${import_chalk.default.cyan(rule.id || ruleId)}`,
162
+ renderAlertTable(summaryRows, 3)
163
+ ];
164
+ const notificationRows = getNotificationRows(rule);
165
+ if (notificationRows.length > 0) {
166
+ sections.push(
167
+ "",
168
+ import_chalk.default.cyan("Notifications"),
169
+ renderAlertTable(notificationRows, 3)
170
+ );
171
+ }
172
+ if (rule.customAlert) {
173
+ sections.push(
174
+ "",
175
+ import_chalk.default.cyan("Custom Alert"),
176
+ renderAlertTable(getCustomAlertRows(rule.customAlert), 3)
177
+ );
178
+ } else if (isCustomAlertRule(rule)) {
179
+ sections.push(
180
+ "",
181
+ import_chalk.default.cyan("Custom Alert"),
182
+ " No custom alert definition returned."
183
+ );
184
+ }
185
+ output_manager_default.print(`${sections.join("\n")}
186
+ `);
187
+ }
188
+ async function ruleInspect(client, argv) {
189
+ let parsedArgs;
190
+ try {
191
+ parsedArgs = parseArguments(
192
+ argv,
193
+ getFlagsSpecification(rulesInspectSubcommand.options)
194
+ );
195
+ } catch (e) {
196
+ emitRulesArgParseError(
197
+ client,
198
+ e,
199
+ "alerts rules inspect <ruleId> --project <name-or-id>"
200
+ );
201
+ printError(e);
202
+ return 1;
203
+ }
204
+ const ruleId = parsedArgs.args[0];
205
+ const fr = validateJsonOutput(parsedArgs.flags);
206
+ if (!fr.valid) {
207
+ outputAgentError(
208
+ client,
209
+ {
210
+ status: "error",
211
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
212
+ message: fr.error
213
+ },
214
+ 1
215
+ );
216
+ output_manager_default.error(fr.error);
217
+ return 1;
218
+ }
219
+ if (!ruleId) {
220
+ outputAgentError(
221
+ client,
222
+ {
223
+ status: "error",
224
+ reason: AGENT_REASON.MISSING_ARGUMENTS,
225
+ message: `Missing rule id. Example: ${packageName} alerts rules inspect <ruleId>`,
226
+ next: [
227
+ {
228
+ command: buildCommandWithGlobalFlags(
229
+ client.argv,
230
+ "alerts rules inspect <ruleId>"
231
+ ),
232
+ when: "Replace <ruleId> with an id from `alerts rules ls`"
233
+ },
234
+ {
235
+ command: buildCommandWithGlobalFlags(
236
+ client.argv,
237
+ "alerts rules ls"
238
+ ),
239
+ when: "List rule ids in the current scope"
240
+ }
241
+ ]
242
+ },
243
+ 1
244
+ );
245
+ output_manager_default.error("Usage: `vercel alerts rules inspect <ruleId>`");
246
+ return 1;
247
+ }
248
+ const scope = await parseRulesFlagsAndScope(
249
+ client,
250
+ {
251
+ "--project": parsedArgs.flags["--project"],
252
+ "--all": parsedArgs.flags["--all"]
253
+ },
254
+ fr.jsonOutput,
255
+ `alerts rules inspect ${ruleId}`
256
+ );
257
+ if (typeof scope === "number") {
258
+ return scope;
259
+ }
260
+ const path = rulesItemPath(scope, ruleId);
261
+ output_manager_default.spinner("Fetching alert rule...");
262
+ try {
263
+ const rule = await client.fetch(path);
264
+ output_manager_default.stopSpinner();
265
+ if (fr.jsonOutput) {
266
+ client.stdout.write(`${JSON.stringify({ rule }, null, 2)}
267
+ `);
268
+ } else {
269
+ printRule(rule, ruleId);
270
+ }
271
+ return 0;
272
+ } catch (err) {
273
+ if (isAPIError(err)) {
274
+ return handleRulesApiError(client, err, fr.jsonOutput);
275
+ }
276
+ throw err;
277
+ } finally {
278
+ output_manager_default.stopSpinner();
279
+ }
280
+ }
281
+ export {
282
+ ruleInspect as default
283
+ };
@@ -29,8 +29,8 @@ var RULES_CONFIG = {
29
29
  update: ["update", "patch"]
30
30
  };
31
31
  async function rules(client, argv) {
32
- if (argv.length === 0 || argv[0].startsWith("-")) {
33
- const lsFn = (await import("./ls-RH6Y4XBS.js")).default;
32
+ if (argv.length === 0 || argv[0]?.startsWith("-")) {
33
+ const lsFn = (await import("./ls-RHEQ6YQB.js")).default;
34
34
  return lsFn(client, argv);
35
35
  }
36
36
  const { subcommand, args, subcommandOriginal } = getSubcommand(
@@ -63,15 +63,15 @@ async function rules(client, argv) {
63
63
  }
64
64
  switch (subcommand) {
65
65
  case "ls":
66
- return (await import("./ls-RH6Y4XBS.js")).default(client, args);
66
+ return (await import("./ls-RHEQ6YQB.js")).default(client, args);
67
67
  case "add":
68
- return (await import("./add-6GRH6G2M.js")).default(client, args);
68
+ return (await import("./add-7M577U56.js")).default(client, args);
69
69
  case "inspect":
70
- return (await import("./rule-inspect-XJ47UEG7.js")).default(client, args);
70
+ return (await import("./rule-inspect-DMP2CKJQ.js")).default(client, args);
71
71
  case "rm":
72
- return (await import("./rm-OCLUTM57.js")).default(client, args);
72
+ return (await import("./rm-FR6KE744.js")).default(client, args);
73
73
  case "update":
74
- return (await import("./update-E3ZQAFBS.js")).default(client, args);
74
+ return (await import("./update-QH4DQMZV.js")).default(client, args);
75
75
  default:
76
76
  output_manager_default.error(`Unhandled rules subcommand: ${String(subcommandOriginal)}`);
77
77
  return 1;
@@ -7,11 +7,13 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  fetchMetricDetailOrExit,
9
9
  fetchMetricListOrExit
10
- } from "./chunk-6RTK6BWX.js";
10
+ } from "./chunk-YA3WQFLY.js";
11
+ import {
12
+ formatErrorJson
13
+ } from "./chunk-NM43FFV6.js";
11
14
  import {
12
- formatErrorJson,
13
15
  indent_default
14
- } from "./chunk-Z7NPYIZ6.js";
16
+ } from "./chunk-A3NYPUKZ.js";
15
17
  import {
16
18
  formatTable
17
19
  } from "./chunk-ZVLPUREX.js";
@@ -25,7 +27,7 @@ import "./chunk-NZRWTCRM.js";
25
27
  import {
26
28
  getScope,
27
29
  require_pluralize
28
- } from "./chunk-TMK6RSYW.js";
30
+ } from "./chunk-TBR2Q37Y.js";
29
31
  import "./chunk-ECCWJHC6.js";
30
32
  import "./chunk-UDWRZXIT.js";
31
33
  import {
@@ -52,9 +52,9 @@ async function tags(client, argv, telemetry) {
52
52
  }
53
53
  switch (subcommand) {
54
54
  case "ls":
55
- return (await import("./ls-2NU353QP.js")).default(client, args, telemetry);
55
+ return (await import("./ls-CG6A7UXF.js")).default(client, args, telemetry);
56
56
  case "inspect":
57
- return (await import("./inspect-DYXTX6P4.js")).default(client, args, telemetry);
57
+ return (await import("./inspect-UM3LDRPV.js")).default(client, args, telemetry);
58
58
  default:
59
59
  output_manager_default.error(`Unhandled tags subcommand: ${subcommand}`);
60
60
  return 1;
@@ -9,16 +9,16 @@ import {
9
9
  handleRulesApiError,
10
10
  parseRulesFlagsAndScope,
11
11
  rulesItemPath
12
- } from "./chunk-SWEPOMSA.js";
13
- import "./chunk-23U6FANO.js";
12
+ } from "./chunk-MAHINYBW.js";
13
+ import "./chunk-T4NODP6Y.js";
14
14
  import "./chunk-BUZRVER7.js";
15
15
  import {
16
16
  validateJsonOutput
17
17
  } from "./chunk-XPKWKPWA.js";
18
18
  import {
19
19
  rulesUpdateSubcommand
20
- } from "./chunk-STJJ3DFO.js";
21
- import "./chunk-TMK6RSYW.js";
20
+ } from "./chunk-KCF6S3XF.js";
21
+ import "./chunk-TBR2Q37Y.js";
22
22
  import "./chunk-ECCWJHC6.js";
23
23
  import {
24
24
  AGENT_REASON,
@@ -128,7 +128,8 @@ async function update(client, argv) {
128
128
  "--project": parsedArgs.flags["--project"],
129
129
  "--all": parsedArgs.flags["--all"]
130
130
  },
131
- fr.jsonOutput
131
+ fr.jsonOutput,
132
+ `alerts rules update ${ruleId}`
132
133
  );
133
134
  if (typeof scope === "number") {
134
135
  return scope;
@@ -6,22 +6,23 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  OUTPUT_DIR,
9
+ formatResolvedBuilders,
9
10
  getStaticServiceSchedules,
10
11
  importBuilders,
11
12
  isLambda,
12
13
  staticFiles,
13
14
  writeBuildResult
14
- } from "../../chunks/chunk-26TEKOBZ.js";
15
+ } from "../../chunks/chunk-RAFH25WW.js";
15
16
  import {
16
17
  pullCommandLogic
17
- } from "../../chunks/chunk-EYICIM2K.js";
18
+ } from "../../chunks/chunk-YOZCJHLZ.js";
18
19
  import {
19
20
  require_semver
20
21
  } from "../../chunks/chunk-IB5L4LKZ.js";
21
22
  import {
22
23
  pickOverrides,
23
24
  readProjectSettings
24
- } from "../../chunks/chunk-JQG5EDRD.js";
25
+ } from "../../chunks/chunk-3242RXCN.js";
25
26
  import "../../chunks/chunk-R6IGDGX3.js";
26
27
  import "../../chunks/chunk-NJUPUGOE.js";
27
28
  import {
@@ -30,12 +31,12 @@ import {
30
31
  import "../../chunks/chunk-VXYGCOKL.js";
31
32
  import {
32
33
  ensureLink
33
- } from "../../chunks/chunk-X43U65TH.js";
34
- import "../../chunks/chunk-PPEQUJ7T.js";
35
- import "../../chunks/chunk-GNV7547O.js";
34
+ } from "../../chunks/chunk-HD7B425F.js";
35
+ import "../../chunks/chunk-NRNMT43R.js";
36
+ import "../../chunks/chunk-V4RMJKQP.js";
36
37
  import {
37
38
  buildCommand
38
- } from "../../chunks/chunk-PRYNIKBZ.js";
39
+ } from "../../chunks/chunk-NH43BFJ3.js";
39
40
  import {
40
41
  help
41
42
  } from "../../chunks/chunk-DMSLNAVH.js";
@@ -63,7 +64,7 @@ import {
63
64
  resolveProjectCwd,
64
65
  ua_default,
65
66
  validateConfig
66
- } from "../../chunks/chunk-TMK6RSYW.js";
67
+ } from "../../chunks/chunk-TBR2Q37Y.js";
67
68
  import {
68
69
  TelemetryClient
69
70
  } from "../../chunks/chunk-ECCWJHC6.js";
@@ -428,6 +429,23 @@ function warnIfFrameworkMismatch(options) {
428
429
  return "unused-mismatch";
429
430
  }
430
431
 
432
+ // src/util/build/backend-rewrite-warning.ts
433
+ import { isPythonFramework } from "@vercel/build-utils";
434
+ var BACKEND_REWRITE_BEHAVIOR_WARNING = "Internal rewrites in backend framework projects now route requests using the rewritten destination path. This behavior was previously unsupported and may change which application route handles a request. Review your rewrite configuration to ensure this behavior is expected.";
435
+ function hasInternalPathRewrite(rewrites) {
436
+ return rewrites?.some(
437
+ (rewrite) => typeof rewrite.destination === "string" && rewrite.destination.startsWith("/")
438
+ ) ?? false;
439
+ }
440
+ function hasBackendRewriteBehaviorChange({
441
+ projectRewrites,
442
+ builders
443
+ }) {
444
+ return hasInternalPathRewrite(projectRewrites) && (builders ?? []).some(
445
+ (builder) => isPythonFramework(builder.config?.framework)
446
+ );
447
+ }
448
+
431
449
  // src/util/build/validate-build-output.ts
432
450
  var import_fs_extra2 = __toESM(require_lib(), 1);
433
451
  import { join as join2 } from "path";
@@ -4228,8 +4246,18 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
4228
4246
  zeroConfigFallbackRoutes = detectedBuilders.fallbackRoutes || [];
4229
4247
  }
4230
4248
  }
4249
+ if (hasBackendRewriteBehaviorChange({
4250
+ projectRewrites: localConfig.rewrites,
4251
+ builders: builds
4252
+ })) {
4253
+ output_manager_default.warn(BACKEND_REWRITE_BEHAVIOR_WARNING);
4254
+ }
4231
4255
  const builderSpecs = new Set(builds.map((b) => b.use));
4232
- let buildersWithPkgs = await span.child("vc.importBuilders").trace(() => importBuilders(builderSpecs, cwd, span));
4256
+ let buildersWithPkgs = await span.child("vc.importBuilders").trace(async (s) => {
4257
+ const builders = await importBuilders(builderSpecs, cwd, span);
4258
+ s.setAttributes({ resolved: formatResolvedBuilders(builders) });
4259
+ return builders;
4260
+ });
4233
4261
  const filesMap = await span.child("vc.populateFilesMap").trace(async (s) => {
4234
4262
  const map2 = {};
4235
4263
  for (const path of files) {
@@ -4250,7 +4278,11 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
4250
4278
  );
4251
4279
  if (missingBuilderSpecs.size === 0)
4252
4280
  return;
4253
- const importedBuilders = await span.child("vc.importBuilders").trace(() => importBuilders(missingBuilderSpecs, cwd, span));
4281
+ const importedBuilders = await span.child("vc.importBuilders").trace(async (s) => {
4282
+ const builders = await importBuilders(missingBuilderSpecs, cwd, span);
4283
+ s.setAttributes({ resolved: formatResolvedBuilders(builders) });
4284
+ return builders;
4285
+ });
4254
4286
  buildersWithPkgs = new Map([
4255
4287
  ...buildersWithPkgs.entries(),
4256
4288
  ...importedBuilders.entries()
@@ -13,13 +13,9 @@ import {
13
13
  purchaseDomainIfAvailable,
14
14
  require_cjs,
15
15
  setupDomain
16
- } from "../../chunks/chunk-DOF6CJLL.js";
17
- import {
18
- readLocalConfig
19
- } from "../../chunks/chunk-3BHSS5E2.js";
20
- import {
21
- highlight
22
- } from "../../chunks/chunk-V5P25P7F.js";
16
+ } from "../../chunks/chunk-F7X55TOY.js";
17
+ import "../../chunks/chunk-PRWJUY5U.js";
18
+ import "../../chunks/chunk-4PGF367U.js";
23
19
  import "../../chunks/chunk-XBN2O34P.js";
24
20
  import {
25
21
  parseMeta
@@ -36,7 +32,7 @@ import {
36
32
  deprecatedArchiveSplitTgz,
37
33
  getCommandAliases,
38
34
  initSubcommand
39
- } from "../../chunks/chunk-IBP2XAUH.js";
35
+ } from "../../chunks/chunk-A2TYQBX2.js";
40
36
  import "../../chunks/chunk-3VS4DTAU.js";
41
37
  import "../../chunks/chunk-GIL3VAUR.js";
42
38
  import "../../chunks/chunk-FYQPTH5C.js";
@@ -44,13 +40,13 @@ import "../../chunks/chunk-4G6QZSBL.js";
44
40
  import "../../chunks/chunk-VZSZBD4V.js";
45
41
  import "../../chunks/chunk-FHEMFAHB.js";
46
42
  import "../../chunks/chunk-3PKFXNJZ.js";
47
- import "../../chunks/chunk-YS6EDZHB.js";
48
- import "../../chunks/chunk-STJJ3DFO.js";
43
+ import "../../chunks/chunk-2MJROFVC.js";
44
+ import "../../chunks/chunk-KCF6S3XF.js";
49
45
  import "../../chunks/chunk-OGG6UBXK.js";
50
46
  import "../../chunks/chunk-LHFNIZ2P.js";
51
47
  import {
52
48
  pickOverrides
53
- } from "../../chunks/chunk-JQG5EDRD.js";
49
+ } from "../../chunks/chunk-3242RXCN.js";
54
50
  import "../../chunks/chunk-NJUPUGOE.js";
55
51
  import {
56
52
  stamp_default
@@ -58,13 +54,13 @@ import {
58
54
  import "../../chunks/chunk-VXYGCOKL.js";
59
55
  import {
60
56
  ensureLink
61
- } from "../../chunks/chunk-X43U65TH.js";
57
+ } from "../../chunks/chunk-HD7B425F.js";
62
58
  import {
63
59
  validatePaths,
64
60
  validateRootDirectory
65
- } from "../../chunks/chunk-PPEQUJ7T.js";
66
- import "../../chunks/chunk-GNV7547O.js";
67
- import "../../chunks/chunk-PRYNIKBZ.js";
61
+ } from "../../chunks/chunk-NRNMT43R.js";
62
+ import "../../chunks/chunk-V4RMJKQP.js";
63
+ import "../../chunks/chunk-NH43BFJ3.js";
68
64
  import {
69
65
  help
70
66
  } from "../../chunks/chunk-DMSLNAVH.js";
@@ -75,16 +71,18 @@ import {
75
71
  compileVercelConfig,
76
72
  createGitMeta,
77
73
  getDeployment,
74
+ highlight,
78
75
  isOwnerLookupUnavailableLink,
79
76
  mapCertError,
80
77
  param,
81
78
  parseEnv,
82
79
  parseTarget,
83
80
  printAlignedLabel,
81
+ readLocalConfig,
84
82
  require_dist as require_dist2,
85
83
  require_frameworks,
86
84
  require_lib
87
- } from "../../chunks/chunk-TMK6RSYW.js";
85
+ } from "../../chunks/chunk-TBR2Q37Y.js";
88
86
  import {
89
87
  TelemetryClient
90
88
  } from "../../chunks/chunk-ECCWJHC6.js";
@@ -1021,19 +1019,25 @@ async function handleInitDeployment(client, telemetryClient) {
1021
1019
  if (asJson) {
1022
1020
  output_manager_default.stopSpinner();
1023
1021
  const deploymentJson = getDeploymentOutputJson(deployment, client.apiUrl);
1022
+ const isImplicitProduction = deployment.target === "production" && !target;
1024
1023
  const payload = client.nonInteractive ? {
1025
1024
  status: AGENT_STATUS.OK,
1026
1025
  deployment: deploymentJson,
1027
1026
  message: `Deployment ${deployment.url} ready.`,
1027
+ ...isImplicitProduction ? {
1028
+ hint: "This is the project\u2019s first deployment, so it was assigned to production. Future deployments will be preview deployments unless you use --prod."
1029
+ } : {},
1028
1030
  next: [
1029
1031
  {
1030
1032
  command: withGlobalFlags(client, `inspect ${deployment.url}`),
1031
1033
  when: "Inspect deployment"
1032
1034
  },
1033
- {
1034
- command: withGlobalFlags(client, "deploy --prod"),
1035
- when: "Promote to production"
1036
- }
1035
+ ...isImplicitProduction ? [] : [
1036
+ {
1037
+ command: withGlobalFlags(client, "deploy --prod"),
1038
+ when: "Promote to production"
1039
+ }
1040
+ ]
1037
1041
  ]
1038
1042
  } : deploymentJson;
1039
1043
  client.stdout.write(`${JSON.stringify(payload, null, 2)}
@@ -2002,19 +2006,25 @@ ${err.stack}`);
2002
2006
  if (asJson) {
2003
2007
  output_manager_default.stopSpinner();
2004
2008
  const deploymentJson = getDeploymentOutputJson(deployment, client.apiUrl);
2009
+ const isImplicitProduction = deployment.target === "production" && !target;
2005
2010
  const payload = client.nonInteractive ? {
2006
2011
  status: AGENT_STATUS.OK,
2007
2012
  deployment: deploymentJson,
2008
2013
  message: `Deployment ${deployment.url} ready.`,
2014
+ ...isImplicitProduction ? {
2015
+ hint: "This is the project\u2019s first deployment, so it was assigned to production. Future deployments will be preview deployments unless you use --prod."
2016
+ } : {},
2009
2017
  next: [
2010
2018
  {
2011
2019
  command: withGlobalFlags(client, `inspect ${deployment.url}`),
2012
2020
  when: "Inspect deployment"
2013
2021
  },
2014
- {
2015
- command: withGlobalFlags(client, "deploy --prod"),
2016
- when: "Promote to production"
2017
- }
2022
+ ...isImplicitProduction ? [] : [
2023
+ {
2024
+ command: withGlobalFlags(client, "deploy --prod"),
2025
+ when: "Promote to production"
2026
+ }
2027
+ ]
2018
2028
  ]
2019
2029
  } : deploymentJson;
2020
2030
  client.stdout.write(`${JSON.stringify(payload, null, 2)}