@depup/vercel 50.32.5-depup.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 (96) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +38 -0
  3. package/changes.json +38 -0
  4. package/dist/chunks/chunk-2DLBVZWU.js +197 -0
  5. package/dist/chunks/chunk-2HSQ7YUK.js +93 -0
  6. package/dist/chunks/chunk-2IQTNMUG.js +86 -0
  7. package/dist/chunks/chunk-3FRG2XGZ.js +466 -0
  8. package/dist/chunks/chunk-3KMKI2FP.js +34 -0
  9. package/dist/chunks/chunk-3XFFP2BA.js +110 -0
  10. package/dist/chunks/chunk-4S3Y3ATR.js +5383 -0
  11. package/dist/chunks/chunk-7EHTK7LP.js +359 -0
  12. package/dist/chunks/chunk-7YHZDJ4G.js +116 -0
  13. package/dist/chunks/chunk-A3NYPUKZ.js +17 -0
  14. package/dist/chunks/chunk-AA7QEJFB.js +5204 -0
  15. package/dist/chunks/chunk-AHU7WNL2.js +24 -0
  16. package/dist/chunks/chunk-AKQZ7KG3.js +4172 -0
  17. package/dist/chunks/chunk-AQLVWVEN.js +39155 -0
  18. package/dist/chunks/chunk-BQ3DXZNT.js +968 -0
  19. package/dist/chunks/chunk-E65JE2CC.js +102 -0
  20. package/dist/chunks/chunk-EKPSCRJZ.js +26 -0
  21. package/dist/chunks/chunk-EOZFDJSY.js +18 -0
  22. package/dist/chunks/chunk-FDJURQMQ.js +4676 -0
  23. package/dist/chunks/chunk-FLKHKWZV.js +1854 -0
  24. package/dist/chunks/chunk-G6BUEBF5.js +192 -0
  25. package/dist/chunks/chunk-GBNIO3KP.js +771 -0
  26. package/dist/chunks/chunk-GGP5R3FU.js +129 -0
  27. package/dist/chunks/chunk-H5XJSH37.js +91 -0
  28. package/dist/chunks/chunk-IB5L4LKZ.js +1082 -0
  29. package/dist/chunks/chunk-IE7MNZ56.js +149 -0
  30. package/dist/chunks/chunk-IK7DLK2T.js +16112 -0
  31. package/dist/chunks/chunk-IUGPWINM.js +104 -0
  32. package/dist/chunks/chunk-J7HDA5GH.js +54 -0
  33. package/dist/chunks/chunk-JLYZNGYY.js +293 -0
  34. package/dist/chunks/chunk-JQ4NA5MX.js +250 -0
  35. package/dist/chunks/chunk-LL26LVRR.js +81 -0
  36. package/dist/chunks/chunk-LW5ZNGW7.js +127 -0
  37. package/dist/chunks/chunk-LWBSOTJP.js +1772 -0
  38. package/dist/chunks/chunk-MBGJBHYD.js +388 -0
  39. package/dist/chunks/chunk-NUKAG3YM.js +168 -0
  40. package/dist/chunks/chunk-O7I4ZOCC.js +58 -0
  41. package/dist/chunks/chunk-OWR3XNE3.js +48 -0
  42. package/dist/chunks/chunk-P3SKP5WM.js +27 -0
  43. package/dist/chunks/chunk-P4I4DMEU.js +342 -0
  44. package/dist/chunks/chunk-P5Q6F5IA.js +107 -0
  45. package/dist/chunks/chunk-PMSMUMUO.js +30 -0
  46. package/dist/chunks/chunk-QXRJ52T4.js +2977 -0
  47. package/dist/chunks/chunk-RQXPRFRM.js +90 -0
  48. package/dist/chunks/chunk-S7KYDPEM.js +1564 -0
  49. package/dist/chunks/chunk-SGGLJFUZ.js +68 -0
  50. package/dist/chunks/chunk-SOTR4CXR.js +34 -0
  51. package/dist/chunks/chunk-TEVP63TU.js +1717 -0
  52. package/dist/chunks/chunk-TNBMKNET.js +323 -0
  53. package/dist/chunks/chunk-TZ2YI2VH.js +87 -0
  54. package/dist/chunks/chunk-U6XOC6E4.js +903 -0
  55. package/dist/chunks/chunk-V5P25P7F.js +22 -0
  56. package/dist/chunks/chunk-WQ5CUZWR.js +333 -0
  57. package/dist/chunks/chunk-WU2BPWRP.js +12237 -0
  58. package/dist/chunks/chunk-XPKWKPWA.js +44 -0
  59. package/dist/chunks/chunk-XR53KVJD.js +33 -0
  60. package/dist/chunks/chunk-Y4JJYHUG.js +16 -0
  61. package/dist/chunks/chunk-YPQSDAEW.js +29 -0
  62. package/dist/chunks/chunk-ZB2UO4V2.js +135 -0
  63. package/dist/chunks/chunk-ZLCMHY2G.js +1528 -0
  64. package/dist/chunks/compile-vercel-config-XU3YY2CZ.js +32 -0
  65. package/dist/chunks/delete-EJ2V7KQO.js +144 -0
  66. package/dist/chunks/disable-BKRFMX4U.js +122 -0
  67. package/dist/chunks/discard-4WF34DXK.js +118 -0
  68. package/dist/chunks/edit-FQE7JGU3.js +509 -0
  69. package/dist/chunks/emit-flags-datafiles-QYKPNWPX.js +17 -0
  70. package/dist/chunks/enable-VCNMX63U.js +122 -0
  71. package/dist/chunks/export-3KNVJCQR.js +133 -0
  72. package/dist/chunks/list-43XQCGKH.js +382 -0
  73. package/dist/chunks/list-DUL6PHUR.js +394 -0
  74. package/dist/chunks/publish-CF7GVZK3.js +128 -0
  75. package/dist/chunks/query-KWKO7VWO.js +954 -0
  76. package/dist/chunks/reorder-GU65YMIN.js +259 -0
  77. package/dist/chunks/restore-Q7ENGWVJ.js +158 -0
  78. package/dist/chunks/routes-Q5CWG44T.js +20 -0
  79. package/dist/chunks/schema-PJKLO2K2.js +176 -0
  80. package/dist/chunks/stamp-RTPE2EBB.js +15 -0
  81. package/dist/chunks/types-563KUQRV.js +108 -0
  82. package/dist/chunks/update-route-version-E3V47KNI.js +13 -0
  83. package/dist/commands/build/index.js +1597 -0
  84. package/dist/commands/deploy/index.js +1711 -0
  85. package/dist/commands/dev/builder-worker.cjs +95 -0
  86. package/dist/commands/dev/index.js +20810 -0
  87. package/dist/commands/env/index.js +2154 -0
  88. package/dist/commands/link/index.js +225 -0
  89. package/dist/commands/list/index.js +528 -0
  90. package/dist/commands-bulk.js +29627 -0
  91. package/dist/get-latest-worker.cjs +272 -0
  92. package/dist/help.js +14 -0
  93. package/dist/index.js +24274 -0
  94. package/dist/vc.js +36 -0
  95. package/dist/version.mjs +1 -0
  96. package/package.json +254 -0
@@ -0,0 +1,323 @@
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
+ getLinkedProject
9
+ } from "./chunk-AQLVWVEN.js";
10
+ import {
11
+ getCommandName,
12
+ getFlagsSpecification,
13
+ parseArguments,
14
+ printError
15
+ } from "./chunk-ZLCMHY2G.js";
16
+ import {
17
+ output_manager_default
18
+ } from "./chunk-FDJURQMQ.js";
19
+ import {
20
+ require_source
21
+ } from "./chunk-S7KYDPEM.js";
22
+ import {
23
+ __toESM
24
+ } from "./chunk-TZ2YI2VH.js";
25
+
26
+ // src/util/routes/types.ts
27
+ var ROUTE_TYPE_LABELS = {
28
+ rewrite: "Rewrite",
29
+ redirect: "Redirect",
30
+ set_status: "Set Status",
31
+ transform: "Transform"
32
+ };
33
+ function getRouteTypeLabel(rule) {
34
+ if (!rule.routeType)
35
+ return "-";
36
+ return ROUTE_TYPE_LABELS[rule.routeType] ?? "-";
37
+ }
38
+ var SRC_SYNTAX_LABELS = {
39
+ equals: "Exact Match",
40
+ "path-to-regexp": "Pattern",
41
+ regex: "Regex"
42
+ };
43
+ function getSrcSyntaxLabel(rule) {
44
+ const syntax = rule.srcSyntax ?? "regex";
45
+ return SRC_SYNTAX_LABELS[syntax];
46
+ }
47
+
48
+ // src/commands/routes/shared.ts
49
+ var import_chalk = __toESM(require_source(), 1);
50
+ async function parseSubcommandArgs(argv, command) {
51
+ let parsedArgs;
52
+ const flagsSpecification = getFlagsSpecification(command.options);
53
+ try {
54
+ parsedArgs = parseArguments(argv, flagsSpecification);
55
+ } catch (err) {
56
+ printError(err);
57
+ return 1;
58
+ }
59
+ return parsedArgs;
60
+ }
61
+ async function ensureProjectLink(client) {
62
+ const link = await getLinkedProject(client);
63
+ if (link.status === "error") {
64
+ return link.exitCode;
65
+ } else if (link.status === "not_linked") {
66
+ output_manager_default.error(
67
+ `Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")} to begin.`
68
+ );
69
+ return 1;
70
+ }
71
+ client.config.currentTeam = link.org.type === "team" ? link.org.id : void 0;
72
+ return link;
73
+ }
74
+ async function confirmAction(client, skipConfirmation, message, details) {
75
+ if (skipConfirmation)
76
+ return true;
77
+ if (details) {
78
+ output_manager_default.print(` ${details}
79
+ `);
80
+ }
81
+ return await client.input.confirm(message, false);
82
+ }
83
+ function validateRequiredArgs(args, required) {
84
+ for (let i = 0; i < required.length; i++) {
85
+ if (!args[i]) {
86
+ return `Missing required argument: ${required[i]}`;
87
+ }
88
+ }
89
+ return null;
90
+ }
91
+ function formatCondition(condition) {
92
+ const parts = [import_chalk.default.gray(`[${condition.type}]`)];
93
+ if (condition.key) {
94
+ parts.push(import_chalk.default.cyan(condition.key));
95
+ }
96
+ if (condition.value !== void 0) {
97
+ const formatted = typeof condition.value === "string" ? condition.value : JSON.stringify(condition.value);
98
+ parts.push(condition.key ? `= ${formatted}` : formatted);
99
+ }
100
+ return parts.join(" ");
101
+ }
102
+ var TRANSFORM_TYPE_LABELS = {
103
+ "request.headers": "Request Header",
104
+ "request.query": "Request Query",
105
+ "response.headers": "Response Header"
106
+ };
107
+ var TRANSFORM_OP_LABELS = {
108
+ set: "set",
109
+ append: "append",
110
+ delete: "delete"
111
+ };
112
+ function formatTransform(transform, includeType = true) {
113
+ const opLabel = TRANSFORM_OP_LABELS[transform.op] ?? transform.op;
114
+ const key = typeof transform.target.key === "string" ? transform.target.key : JSON.stringify(transform.target.key);
115
+ const parts = [];
116
+ if (includeType) {
117
+ const typeLabel = TRANSFORM_TYPE_LABELS[transform.type] ?? transform.type;
118
+ parts.push(import_chalk.default.gray(`[${typeLabel}]`));
119
+ }
120
+ parts.push(import_chalk.default.yellow(opLabel), import_chalk.default.cyan(key));
121
+ if (transform.args !== void 0 && transform.op !== "delete") {
122
+ const argsStr = Array.isArray(transform.args) ? transform.args.join(", ") : transform.args;
123
+ parts.push(`= ${argsStr}`);
124
+ }
125
+ return parts.join(" ");
126
+ }
127
+ function parsePosition(position) {
128
+ if (position === "start") {
129
+ return { placement: "start" };
130
+ }
131
+ if (position === "end") {
132
+ return { placement: "end" };
133
+ }
134
+ if (position.startsWith("after:")) {
135
+ const referenceId = position.slice(6);
136
+ if (!referenceId) {
137
+ throw new Error('Position "after:" requires a route ID');
138
+ }
139
+ return { placement: "after", referenceId };
140
+ }
141
+ if (position.startsWith("before:")) {
142
+ const referenceId = position.slice(7);
143
+ if (!referenceId) {
144
+ throw new Error('Position "before:" requires a route ID');
145
+ }
146
+ return { placement: "before", referenceId };
147
+ }
148
+ throw new Error(
149
+ `Invalid position: "${position}". Use: start, end, after:<id>, or before:<id>`
150
+ );
151
+ }
152
+ async function offerAutoPromote(client, projectId, version, hadExistingStagingVersion, opts) {
153
+ const { default: updateRouteVersion } = await import("./update-route-version-E3V47KNI.js");
154
+ const { default: stamp } = await import("./stamp-RTPE2EBB.js");
155
+ output_manager_default.print(
156
+ `
157
+ ${import_chalk.default.gray(`This change is staged. Run ${import_chalk.default.cyan(getCommandName("routes publish"))} to make it live, or ${import_chalk.default.cyan(getCommandName("routes discard-staging"))} to undo.`)}
158
+ `
159
+ );
160
+ if (!hadExistingStagingVersion && !opts.skipPrompts) {
161
+ output_manager_default.print("\n");
162
+ const shouldPromote = await client.input.confirm(
163
+ "This is the only staged change. Promote to production now?",
164
+ false
165
+ );
166
+ if (shouldPromote) {
167
+ const promoteStamp = stamp();
168
+ output_manager_default.spinner("Promoting to production");
169
+ try {
170
+ await updateRouteVersion(client, projectId, version.id, "promote", {
171
+ teamId: opts.teamId
172
+ });
173
+ output_manager_default.log(
174
+ `${import_chalk.default.cyan("Promoted")} to production ${import_chalk.default.gray(promoteStamp())}`
175
+ );
176
+ } catch (e) {
177
+ const err = e;
178
+ output_manager_default.error(
179
+ `Failed to promote to production: ${err.message || "Unknown error"}`
180
+ );
181
+ }
182
+ }
183
+ } else if (hadExistingStagingVersion) {
184
+ output_manager_default.warn(
185
+ `There are other staged changes. Review with ${import_chalk.default.cyan(getCommandName("routes list --diff"))} before promoting.`
186
+ );
187
+ }
188
+ }
189
+ function printDiffSummary(routes, maxDisplay = 10) {
190
+ const displayRoutes = routes.slice(0, maxDisplay);
191
+ for (const route of displayRoutes) {
192
+ const symbol = getDiffSymbol(route);
193
+ const label = getDiffLabel(route);
194
+ const routeType = getRouteTypeLabel(route);
195
+ output_manager_default.print(
196
+ ` ${symbol} ${route.name}${routeType !== "-" ? ` ${import_chalk.default.gray(`(${routeType})`)}` : ""} ${import_chalk.default.gray(`- ${label}`)}
197
+ `
198
+ );
199
+ }
200
+ if (routes.length > maxDisplay) {
201
+ output_manager_default.print(
202
+ import_chalk.default.gray(`
203
+ ... and ${routes.length - maxDisplay} more changes
204
+ `)
205
+ );
206
+ }
207
+ }
208
+ function getDiffSymbol(route) {
209
+ if (route.action === "+")
210
+ return import_chalk.default.green("+");
211
+ if (route.action === "-")
212
+ return import_chalk.default.red("-");
213
+ return import_chalk.default.yellow("~");
214
+ }
215
+ function getDiffLabel(route) {
216
+ if (route.action === "+")
217
+ return "Added";
218
+ if (route.action === "-")
219
+ return "Deleted";
220
+ const isReordered = route.previousIndex !== void 0 && route.newIndex !== void 0;
221
+ if (isReordered) {
222
+ return `Reordered (${route.previousIndex + 1} \u2192 ${route.newIndex + 1})`;
223
+ }
224
+ if (route.previousEnabled !== void 0) {
225
+ return route.enabled === false ? "Disabled" : "Enabled";
226
+ }
227
+ return "Modified";
228
+ }
229
+ async function resolveRoute(client, routes, identifier) {
230
+ const byId = routes.find((r) => r.id === identifier);
231
+ if (byId)
232
+ return byId;
233
+ const query = identifier.toLowerCase();
234
+ const matches = routes.filter(
235
+ (r) => r.name.toLowerCase() === query || r.name.toLowerCase().includes(query) || r.id.toLowerCase().includes(query)
236
+ );
237
+ if (matches.length === 0) {
238
+ return null;
239
+ }
240
+ if (matches.length === 1) {
241
+ return matches[0];
242
+ }
243
+ const selectedId = await client.input.select({
244
+ message: `Multiple routes match "${identifier}". Select one:`,
245
+ choices: matches.map((route) => ({
246
+ value: route.id,
247
+ name: `${route.name} ${import_chalk.default.gray(`(${route.route.src})`)}`
248
+ }))
249
+ });
250
+ return matches.find((r) => r.id === selectedId) ?? null;
251
+ }
252
+ async function resolveRoutes(client, routes, identifiers) {
253
+ const resolved = /* @__PURE__ */ new Map();
254
+ for (const identifier of identifiers) {
255
+ const route = await resolveRoute(client, routes, identifier);
256
+ if (!route) {
257
+ output_manager_default.error(
258
+ `No route found matching "${identifier}". Run ${import_chalk.default.cyan(
259
+ getCommandName("routes list")
260
+ )} to see all routes.`
261
+ );
262
+ return null;
263
+ }
264
+ resolved.set(route.id, route);
265
+ }
266
+ return Array.from(resolved.values());
267
+ }
268
+ function findVersionById(versions, identifier) {
269
+ const matchingVersions = versions.filter((v) => v.id.startsWith(identifier));
270
+ if (matchingVersions.length === 0) {
271
+ return {
272
+ error: `Version "${identifier}" not found. Run ${import_chalk.default.cyan(
273
+ getCommandName("routes list-versions")
274
+ )} to see available versions.`
275
+ };
276
+ }
277
+ if (matchingVersions.length > 1) {
278
+ return {
279
+ error: `Multiple versions match "${identifier}". Please provide a more specific ID:
280
+ ${matchingVersions.map((v) => ` ${v.id}`).join("\n")}`
281
+ };
282
+ }
283
+ return { version: matchingVersions[0] };
284
+ }
285
+
286
+ // src/util/routes/get-routes.ts
287
+ async function getRoutes(client, projectId, options = {}) {
288
+ const { teamId, search, filter, versionId, diff } = options;
289
+ const query = new URLSearchParams();
290
+ if (teamId)
291
+ query.set("teamId", teamId);
292
+ if (search)
293
+ query.set("q", search);
294
+ if (filter)
295
+ query.set("filter", filter);
296
+ if (versionId)
297
+ query.set("versionId", versionId);
298
+ if (diff)
299
+ query.set("diff", "true");
300
+ const queryString = query.toString();
301
+ const url = `/v1/projects/${projectId}/routes${queryString ? `?${queryString}` : ""}`;
302
+ const response = await client.fetch(url);
303
+ return response;
304
+ }
305
+
306
+ export {
307
+ getRouteTypeLabel,
308
+ getSrcSyntaxLabel,
309
+ parseSubcommandArgs,
310
+ ensureProjectLink,
311
+ confirmAction,
312
+ validateRequiredArgs,
313
+ formatCondition,
314
+ TRANSFORM_TYPE_LABELS,
315
+ formatTransform,
316
+ parsePosition,
317
+ offerAutoPromote,
318
+ printDiffSummary,
319
+ resolveRoute,
320
+ resolveRoutes,
321
+ findVersionById,
322
+ getRoutes
323
+ };
@@ -0,0 +1,87 @@
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
+ var __create = Object.create;
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __getOwnPropNames = Object.getOwnPropertyNames;
11
+ var __getProtoOf = Object.getPrototypeOf;
12
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
13
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
15
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
16
+ }) : x)(function(x) {
17
+ if (typeof require !== "undefined")
18
+ return require.apply(this, arguments);
19
+ throw Error('Dynamic require of "' + x + '" is not supported');
20
+ });
21
+ var __esm = (fn, res) => function __init() {
22
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
23
+ };
24
+ var __commonJS = (cb, mod) => function __require2() {
25
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
26
+ };
27
+ var __export = (target, all) => {
28
+ for (var name in all)
29
+ __defProp(target, name, { get: all[name], enumerable: true });
30
+ };
31
+ var __copyProps = (to, from, except, desc) => {
32
+ if (from && typeof from === "object" || typeof from === "function") {
33
+ for (let key of __getOwnPropNames(from))
34
+ if (!__hasOwnProp.call(to, key) && key !== except)
35
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
36
+ }
37
+ return to;
38
+ };
39
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
40
+ // If the importer is in node compatibility mode or this is not an ESM
41
+ // file that has been converted to a CommonJS file using a Babel-
42
+ // compatible transform (i.e. "__esModule" has not been set), then set
43
+ // "default" to the CommonJS "module.exports" for node compatibility.
44
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
45
+ mod
46
+ ));
47
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48
+ var __publicField = (obj, key, value) => {
49
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
50
+ return value;
51
+ };
52
+ var __accessCheck = (obj, member, msg) => {
53
+ if (!member.has(obj))
54
+ throw TypeError("Cannot " + msg);
55
+ };
56
+ var __privateGet = (obj, member, getter) => {
57
+ __accessCheck(obj, member, "read from private field");
58
+ return getter ? getter.call(obj) : member.get(obj);
59
+ };
60
+ var __privateAdd = (obj, member, value) => {
61
+ if (member.has(obj))
62
+ throw TypeError("Cannot add the same private member more than once");
63
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
64
+ };
65
+ var __privateSet = (obj, member, value, setter) => {
66
+ __accessCheck(obj, member, "write to private field");
67
+ setter ? setter.call(obj, value) : member.set(obj, value);
68
+ return value;
69
+ };
70
+ var __privateMethod = (obj, member, method) => {
71
+ __accessCheck(obj, member, "access private method");
72
+ return method;
73
+ };
74
+
75
+ export {
76
+ __require,
77
+ __esm,
78
+ __commonJS,
79
+ __export,
80
+ __toESM,
81
+ __toCommonJS,
82
+ __publicField,
83
+ __privateGet,
84
+ __privateAdd,
85
+ __privateSet,
86
+ __privateMethod
87
+ };