vercel 51.2.1 → 51.4.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 (69) hide show
  1. package/dist/chunks/add-RNQLGEYS.js +180 -0
  2. package/dist/chunks/{chunk-XAVGWINL.js → chunk-3GDNTBCE.js} +44 -13
  3. package/dist/chunks/{chunk-SSOWPEZT.js → chunk-4DR2FV6O.js} +2 -2
  4. package/dist/chunks/{chunk-Q6BEDVOU.js → chunk-4PQA6H63.js} +1 -1
  5. package/dist/chunks/{chunk-IS2HEMF4.js → chunk-4RBF6ZDU.js} +4 -2
  6. package/dist/chunks/{chunk-7S7GE4BN.js → chunk-537JTK2U.js} +216 -523
  7. package/dist/chunks/{chunk-K5XJCQQO.js → chunk-5NTBJ33M.js} +1 -1
  8. package/dist/chunks/{chunk-5YQCJTZI.js → chunk-5VKKTHMP.js} +6 -6
  9. package/dist/chunks/{chunk-W6FW7CCT.js → chunk-6C33Y3DC.js} +13 -8
  10. package/dist/chunks/{chunk-5WHDQH2U.js → chunk-7MF47FW3.js} +1 -1
  11. package/dist/chunks/chunk-7ZDERWUW.js +167 -0
  12. package/dist/chunks/{chunk-RK4TKB3D.js → chunk-AUSDBXUD.js} +7 -5
  13. package/dist/chunks/{chunk-BUBUVE23.js → chunk-BJQTGP42.js} +4 -2
  14. package/dist/chunks/{chunk-57RLFBKC.js → chunk-BRQBLRFB.js} +1 -1
  15. package/dist/chunks/chunk-CGTXAXZ4.js +484 -0
  16. package/dist/chunks/{chunk-BQUQ5F7R.js → chunk-CRZM5WM2.js} +4 -2
  17. package/dist/chunks/{chunk-VTQNSCUG.js → chunk-D2D4FJ6S.js} +8 -6
  18. package/dist/chunks/{chunk-G6MVEB4W.js → chunk-DKFFXOHJ.js} +3 -3
  19. package/dist/chunks/chunk-DVQ4SIWF.js +183 -0
  20. package/dist/chunks/{chunk-A4NVECX5.js → chunk-ECRBC4HL.js} +4 -581
  21. package/dist/chunks/{chunk-L2BKVTHL.js → chunk-G6RXZLQ2.js} +2 -2
  22. package/dist/chunks/{chunk-4YZKA4FN.js → chunk-GE6G37P4.js} +1 -1
  23. package/dist/chunks/{chunk-NELCIT4M.js → chunk-GLDQ23LD.js} +1 -1
  24. package/dist/chunks/{chunk-QQTF2FEY.js → chunk-HNU5CXW4.js} +9 -5
  25. package/dist/chunks/chunk-HQXVCOH6.js +139 -0
  26. package/dist/chunks/{chunk-3FMFPD7F.js → chunk-L2JUC7NX.js} +2 -2
  27. package/dist/chunks/{chunk-Y5YCSB6X.js → chunk-LDXYSGPZ.js} +2 -2
  28. package/dist/chunks/{chunk-U5J73OA3.js → chunk-N45K6NXC.js} +1 -1
  29. package/dist/chunks/{chunk-5DLMAFQU.js → chunk-NKJC5SI4.js} +6 -4
  30. package/dist/chunks/{chunk-FSOFFJDV.js → chunk-O7SQKNIT.js} +1 -1
  31. package/dist/chunks/{chunk-XRR5HDB3.js → chunk-P56KWLXY.js} +2 -2
  32. package/dist/chunks/{chunk-EHZKWVK2.js → chunk-PBGN54ZH.js} +5 -5
  33. package/dist/chunks/chunk-RFMC2QXQ.js +602 -0
  34. package/dist/chunks/{chunk-W5K4YCTI.js → chunk-RJD5NYGF.js} +5 -3
  35. package/dist/chunks/{chunk-WXNT7WJO.js → chunk-TAOVG4PS.js} +49 -4
  36. package/dist/chunks/{chunk-4EGCWWSR.js → chunk-UJ4JXXED.js} +143 -16
  37. package/dist/chunks/{chunk-2IAZZEVQ.js → chunk-UWKTUK3W.js} +4 -2
  38. package/dist/chunks/{chunk-VE7MY76H.js → chunk-VGWGLBUC.js} +4 -2
  39. package/dist/chunks/{compile-vercel-config-2GV46IDP.js → compile-vercel-config-ZVY7LBE3.js} +4 -2
  40. package/dist/chunks/{delete-PXMYSQGR.js → delete-SKTJMJNP.js} +7 -5
  41. package/dist/chunks/{disable-2ZQ4OG4A.js → disable-AG7I6DPV.js} +7 -5
  42. package/dist/chunks/{discard-FQZTZ5HK.js → discard-LUK6LBLT.js} +7 -5
  43. package/dist/chunks/{edit-F3J7Q5SZ.js → edit-3BR5HP3U.js} +8 -6
  44. package/dist/chunks/{enable-ZW4W33H5.js → enable-4JNLOKSM.js} +7 -5
  45. package/dist/chunks/{export-ZZV6ESIW.js → export-YLZ6QSHG.js} +7 -5
  46. package/dist/chunks/inspect-HUJLUQAV.js +353 -0
  47. package/dist/chunks/{list-SSIMVNNN.js → list-EPU4SB3E.js} +10 -7
  48. package/dist/chunks/{list-VFPV4TUW.js → list-RMA56KYZ.js} +115 -85
  49. package/dist/chunks/ls-7HHDYE6F.js +114 -0
  50. package/dist/chunks/{publish-3K76MNS3.js → publish-6YE4OUDI.js} +7 -5
  51. package/dist/chunks/{query-CY7JJSSX.js → query-VNBKOI65.js} +15 -12
  52. package/dist/chunks/{reorder-6L7MENN5.js → reorder-VFM23ESC.js} +7 -5
  53. package/dist/chunks/{restore-XUYXOJQ2.js → restore-VX34SXVF.js} +7 -5
  54. package/dist/chunks/rm-5KXF2PY3.js +164 -0
  55. package/dist/chunks/rule-inspect-JG7AE5TI.js +142 -0
  56. package/dist/chunks/rules-XRJBT22L.js +83 -0
  57. package/dist/chunks/{schema-G5FSLZVA.js → schema-FUOKCZTW.js} +9 -7
  58. package/dist/chunks/{types-A4EAQ6F6.js → types-QNN5CDCB.js} +6 -4
  59. package/dist/chunks/update-4FMWTIJK.js +196 -0
  60. package/dist/commands/build/index.js +36 -43
  61. package/dist/commands/deploy/index.js +171 -32
  62. package/dist/commands/dev/index.js +36 -31
  63. package/dist/commands/env/index.js +32 -27
  64. package/dist/commands/link/index.js +21 -17
  65. package/dist/commands/list/index.js +14 -11
  66. package/dist/commands-bulk.js +1640 -884
  67. package/dist/index.js +28 -24
  68. package/dist/version.mjs +1 -1
  69. package/package.json +17 -17
@@ -9,16 +9,18 @@ import {
9
9
  } from "./chunk-XPKWKPWA.js";
10
10
  import {
11
11
  typesSubcommand
12
- } from "./chunk-2IAZZEVQ.js";
12
+ } from "./chunk-UWKTUK3W.js";
13
13
  import {
14
14
  table
15
- } from "./chunk-4YZKA4FN.js";
15
+ } from "./chunk-GE6G37P4.js";
16
16
  import {
17
17
  getFlagsSpecification,
18
- isAPIError,
19
18
  parseArguments,
20
19
  printError
21
- } from "./chunk-A4NVECX5.js";
20
+ } from "./chunk-RFMC2QXQ.js";
21
+ import {
22
+ isAPIError
23
+ } from "./chunk-ECRBC4HL.js";
22
24
  import {
23
25
  output_manager_default
24
26
  } from "./chunk-ZQKJVHXY.js";
@@ -0,0 +1,196 @@
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
+ emitRulesArgParseError,
9
+ handleRulesApiError,
10
+ parseRulesFlagsAndScope,
11
+ rulesItemPath
12
+ } from "./chunk-HQXVCOH6.js";
13
+ import "./chunk-7ZDERWUW.js";
14
+ import "./chunk-HTOH3MSD.js";
15
+ import "./chunk-L2JUC7NX.js";
16
+ import {
17
+ validateJsonOutput
18
+ } from "./chunk-XPKWKPWA.js";
19
+ import {
20
+ rulesUpdateSubcommand
21
+ } from "./chunk-DVQ4SIWF.js";
22
+ import {
23
+ AGENT_REASON
24
+ } from "./chunk-E3NE4SKN.js";
25
+ import "./chunk-537JTK2U.js";
26
+ import "./chunk-U3WLEFHU.js";
27
+ import {
28
+ buildCommandWithGlobalFlags,
29
+ outputAgentError
30
+ } from "./chunk-CGTXAXZ4.js";
31
+ import "./chunk-CO5D46AG.js";
32
+ import {
33
+ getFlagsSpecification,
34
+ parseArguments,
35
+ printError
36
+ } from "./chunk-RFMC2QXQ.js";
37
+ import {
38
+ isAPIError,
39
+ packageName
40
+ } from "./chunk-ECRBC4HL.js";
41
+ import {
42
+ output_manager_default
43
+ } from "./chunk-ZQKJVHXY.js";
44
+ import "./chunk-S7KYDPEM.js";
45
+ import "./chunk-TZ2YI2VH.js";
46
+
47
+ // src/commands/alerts/rules/update.ts
48
+ import { readFileSync } from "fs";
49
+ import { resolve } from "path";
50
+ async function update(client, argv) {
51
+ let parsedArgs;
52
+ try {
53
+ parsedArgs = parseArguments(
54
+ argv,
55
+ getFlagsSpecification(rulesUpdateSubcommand.options)
56
+ );
57
+ } catch (e) {
58
+ emitRulesArgParseError(
59
+ client,
60
+ e,
61
+ "alerts rules update <ruleId> --project <name-or-id> --body <path>"
62
+ );
63
+ printError(e);
64
+ return 1;
65
+ }
66
+ const ruleId = parsedArgs.args[0];
67
+ const fr = validateJsonOutput(parsedArgs.flags);
68
+ if (!fr.valid) {
69
+ outputAgentError(
70
+ client,
71
+ {
72
+ status: "error",
73
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
74
+ message: fr.error
75
+ },
76
+ 1
77
+ );
78
+ output_manager_default.error(fr.error);
79
+ return 1;
80
+ }
81
+ if (!ruleId) {
82
+ outputAgentError(
83
+ client,
84
+ {
85
+ status: "error",
86
+ reason: AGENT_REASON.MISSING_ARGUMENTS,
87
+ message: `Missing rule id. Example: ${packageName} alerts rules update <ruleId> --body <file>`,
88
+ next: [
89
+ {
90
+ command: buildCommandWithGlobalFlags(
91
+ client.argv,
92
+ "alerts rules update <ruleId> --body <file>"
93
+ ),
94
+ when: "Replace <ruleId> and <file> with id and JSON patch path"
95
+ }
96
+ ]
97
+ },
98
+ 1
99
+ );
100
+ output_manager_default.error("Usage: `vercel alerts rules update <ruleId> --body <PATH>`");
101
+ return 1;
102
+ }
103
+ const bodyPath = parsedArgs.flags["--body"];
104
+ if (!bodyPath) {
105
+ outputAgentError(
106
+ client,
107
+ {
108
+ status: "error",
109
+ reason: AGENT_REASON.MISSING_ARGUMENTS,
110
+ message: `Missing required flag --body. Example: ${packageName} alerts rules update ${ruleId} --body <file>`,
111
+ next: [
112
+ {
113
+ command: buildCommandWithGlobalFlags(
114
+ client.argv,
115
+ `alerts rules update ${ruleId} --body <file>`
116
+ ),
117
+ when: "Replace <file> with a path to JSON patch payload"
118
+ }
119
+ ]
120
+ },
121
+ 1
122
+ );
123
+ output_manager_default.error("Missing required flag: --body <PATH> (JSON patch payload).");
124
+ return 1;
125
+ }
126
+ const scope = await parseRulesFlagsAndScope(
127
+ client,
128
+ {
129
+ "--project": parsedArgs.flags["--project"],
130
+ "--all": parsedArgs.flags["--all"]
131
+ },
132
+ fr.jsonOutput
133
+ );
134
+ if (typeof scope === "number") {
135
+ return scope;
136
+ }
137
+ let raw;
138
+ try {
139
+ raw = readFileSync(resolve(client.cwd, bodyPath), "utf8");
140
+ } catch {
141
+ outputAgentError(
142
+ client,
143
+ {
144
+ status: "error",
145
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
146
+ message: `Could not read --body file: ${bodyPath}`
147
+ },
148
+ 1
149
+ );
150
+ output_manager_default.error(`Could not read --body file: ${bodyPath}`);
151
+ return 1;
152
+ }
153
+ let body;
154
+ try {
155
+ body = JSON.parse(raw);
156
+ } catch {
157
+ outputAgentError(
158
+ client,
159
+ {
160
+ status: "error",
161
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
162
+ message: "Invalid JSON in --body file."
163
+ },
164
+ 1
165
+ );
166
+ output_manager_default.error("Invalid JSON in --body file.");
167
+ return 1;
168
+ }
169
+ delete body.id;
170
+ delete body.teamId;
171
+ const path = rulesItemPath(scope, ruleId);
172
+ output_manager_default.spinner("Updating alert rule...");
173
+ try {
174
+ const updated = await client.fetch(path, {
175
+ method: "PATCH",
176
+ body
177
+ });
178
+ if (fr.jsonOutput) {
179
+ client.stdout.write(`${JSON.stringify({ rule: updated }, null, 2)}
180
+ `);
181
+ } else {
182
+ output_manager_default.success(`Updated alert rule ${ruleId}`);
183
+ }
184
+ return 0;
185
+ } catch (err) {
186
+ if (isAPIError(err)) {
187
+ return handleRulesApiError(client, err, fr.jsonOutput);
188
+ }
189
+ throw err;
190
+ } finally {
191
+ output_manager_default.stopSpinner();
192
+ }
193
+ }
194
+ export {
195
+ update as default
196
+ };
@@ -10,42 +10,41 @@ import {
10
10
  isLambda,
11
11
  staticFiles,
12
12
  writeBuildResult
13
- } from "../../chunks/chunk-G6MVEB4W.js";
13
+ } from "../../chunks/chunk-DKFFXOHJ.js";
14
14
  import {
15
15
  require_semver
16
16
  } from "../../chunks/chunk-IB5L4LKZ.js";
17
17
  import {
18
18
  pullCommandLogic
19
- } from "../../chunks/chunk-5YQCJTZI.js";
19
+ } from "../../chunks/chunk-5VKKTHMP.js";
20
+ import {
21
+ pickOverrides,
22
+ readProjectSettings
23
+ } from "../../chunks/chunk-BRQBLRFB.js";
20
24
  import {
21
25
  AGENT_REASON,
22
26
  AGENT_STATUS
23
27
  } from "../../chunks/chunk-E3NE4SKN.js";
24
- import {
25
- pickOverrides,
26
- readProjectSettings
27
- } from "../../chunks/chunk-57RLFBKC.js";
28
28
  import {
29
29
  ua_default
30
- } from "../../chunks/chunk-Q6BEDVOU.js";
31
- import "../../chunks/chunk-5WHDQH2U.js";
32
- import "../../chunks/chunk-RK4TKB3D.js";
33
- import "../../chunks/chunk-VTQNSCUG.js";
34
- import "../../chunks/chunk-5DLMAFQU.js";
30
+ } from "../../chunks/chunk-4PQA6H63.js";
31
+ import "../../chunks/chunk-7MF47FW3.js";
32
+ import "../../chunks/chunk-AUSDBXUD.js";
33
+ import "../../chunks/chunk-D2D4FJ6S.js";
34
+ import "../../chunks/chunk-NKJC5SI4.js";
35
35
  import {
36
36
  buildCommand
37
- } from "../../chunks/chunk-W5K4YCTI.js";
37
+ } from "../../chunks/chunk-RJD5NYGF.js";
38
38
  import {
39
39
  help
40
- } from "../../chunks/chunk-Y5YCSB6X.js";
41
- import "../../chunks/chunk-4YZKA4FN.js";
40
+ } from "../../chunks/chunk-LDXYSGPZ.js";
41
+ import "../../chunks/chunk-GE6G37P4.js";
42
42
  import {
43
43
  DEFAULT_VERCEL_CONFIG_FILENAME,
44
44
  VERCEL_DIR,
45
45
  compileVercelConfig,
46
46
  findSourceVercelConfigFile,
47
47
  getProjectLink,
48
- outputAgentError,
49
48
  parseTarget,
50
49
  pullEnvRecords,
51
50
  readJSONFile,
@@ -59,28 +58,33 @@ import {
59
58
  require_minimatch,
60
59
  resolveProjectCwd,
61
60
  validateConfig
62
- } from "../../chunks/chunk-7S7GE4BN.js";
61
+ } from "../../chunks/chunk-537JTK2U.js";
63
62
  import {
64
63
  TelemetryClient
65
64
  } from "../../chunks/chunk-U3WLEFHU.js";
65
+ import {
66
+ outputAgentError
67
+ } from "../../chunks/chunk-CGTXAXZ4.js";
66
68
  import {
67
69
  stamp_default
68
70
  } from "../../chunks/chunk-CO5D46AG.js";
71
+ import {
72
+ getFlagsSpecification,
73
+ getGlobalFlagsOnlyFromArgs,
74
+ parseArguments,
75
+ printError,
76
+ toEnumerableError
77
+ } from "../../chunks/chunk-RFMC2QXQ.js";
69
78
  import {
70
79
  CantParseJSONFile,
71
80
  cmd,
72
81
  getCommandName,
73
82
  getCommandNamePlain,
74
- getFlagsSpecification,
75
- getGlobalFlagsOnlyFromArgs,
76
83
  init_pkg,
77
84
  packageName,
78
- parseArguments,
79
85
  pkg_default,
80
- printError,
81
- require_lib as require_lib2,
82
- toEnumerableError
83
- } from "../../chunks/chunk-A4NVECX5.js";
86
+ require_lib as require_lib2
87
+ } from "../../chunks/chunk-ECRBC4HL.js";
84
88
  import {
85
89
  emoji,
86
90
  output_manager_default,
@@ -1050,7 +1054,8 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
1050
1054
  name: service.name,
1051
1055
  type: service.type,
1052
1056
  routePrefix: typeof serviceRoutePrefix === "string" ? serviceRoutePrefix : void 0,
1053
- workspace: typeof serviceWorkspace === "string" ? serviceWorkspace : void 0
1057
+ workspace: typeof serviceWorkspace === "string" ? serviceWorkspace : void 0,
1058
+ schedule: service.schedule
1054
1059
  }
1055
1060
  } : void 0
1056
1061
  };
@@ -1190,6 +1195,12 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
1190
1195
  if (service?.type === "worker" && "output" in buildResult) {
1191
1196
  attachWorkerServiceTrigger(buildResult.output, service);
1192
1197
  }
1198
+ if (service?.type === "cron" && !("crons" in buildResult && buildResult.crons?.length)) {
1199
+ throw new NowBuildError2({
1200
+ code: "CRON_SERVICE_NO_CRONS",
1201
+ message: `Cron service "${service.name}" did not produce any cron entries. The builder "${builderPkg.name}" may not support cron services.`
1202
+ });
1203
+ }
1193
1204
  let mergedBuildResult = buildResult;
1194
1205
  if ("buildOutputPath" in buildResult) {
1195
1206
  const buildOutputConfigPath = join2(
@@ -1384,9 +1395,8 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
1384
1395
  builds: builderRoutes
1385
1396
  });
1386
1397
  const mergedImages = mergeImages(localConfig.images, buildResults.values());
1387
- const serviceCrons = getServiceCrons(detectedServices);
1388
1398
  const mergedCrons = mergeCrons(
1389
- [...localConfig.crons || [], ...serviceCrons],
1399
+ localConfig.crons || [],
1390
1400
  buildResults.values()
1391
1401
  );
1392
1402
  const mergedWildcard = mergeWildcard(buildResults.values());
@@ -1660,23 +1670,6 @@ function mergeImages(images, buildResults) {
1660
1670
  }
1661
1671
  return images;
1662
1672
  }
1663
- function getServiceCrons(services) {
1664
- if (!services || services.length === 0) {
1665
- return [];
1666
- }
1667
- const crons = [];
1668
- for (const service of services) {
1669
- if (service.type !== "cron" || typeof service.schedule !== "string") {
1670
- continue;
1671
- }
1672
- const cronEntrypoint = service.entrypoint || service.builder.src || "index";
1673
- crons.push({
1674
- path: (0, import_fs_detectors2.getInternalServiceCronPath)(service.name, cronEntrypoint),
1675
- schedule: service.schedule
1676
- });
1677
- }
1678
- return crons;
1679
- }
1680
1673
  function mergeCrons(crons = [], buildResults) {
1681
1674
  for (const result of buildResults) {
1682
1675
  if ("crons" in result && result.crons) {