vercel 51.5.0 → 51.5.1

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 (53) hide show
  1. package/dist/chunks/{add-RNQLGEYS.js → add-CSYGALLC.js} +4 -4
  2. package/dist/chunks/chunk-3VIDEX7A.js +692 -0
  3. package/dist/chunks/{chunk-6CWW4JIG.js → chunk-4T7RWBT7.js} +3 -3
  4. package/dist/chunks/{chunk-BRQBLRFB.js → chunk-5I2ESU2C.js} +1 -1
  5. package/dist/chunks/{chunk-5NTBJ33M.js → chunk-7IM2OOGY.js} +1 -1
  6. package/dist/chunks/{chunk-FBY3IEDZ.js → chunk-7V43C2HB.js} +7 -7
  7. package/dist/chunks/{chunk-4DR2FV6O.js → chunk-CXTJ4RY4.js} +1 -1
  8. package/dist/chunks/{chunk-L2JUC7NX.js → chunk-EQIXUYBY.js} +1 -1
  9. package/dist/chunks/{chunk-5VKKTHMP.js → chunk-GZF6VMKA.js} +8 -4
  10. package/dist/chunks/{chunk-D2D4FJ6S.js → chunk-JHVQUIP6.js} +2 -2
  11. package/dist/chunks/{chunk-NKJC5SI4.js → chunk-K3HUUZM5.js} +1 -1
  12. package/dist/chunks/{chunk-6C33Y3DC.js → chunk-KAKD6QXJ.js} +6 -6
  13. package/dist/chunks/{chunk-7ZDERWUW.js → chunk-KNZNWP2U.js} +2 -2
  14. package/dist/chunks/{chunk-7MF47FW3.js → chunk-LR5Y63NG.js} +1 -1
  15. package/dist/chunks/{chunk-SG4QOQTF.js → chunk-NJ7GOUCE.js} +2 -2
  16. package/dist/chunks/{chunk-537JTK2U.js → chunk-P445TBWL.js} +1 -1
  17. package/dist/chunks/{chunk-DKFFXOHJ.js → chunk-QO2ED7OU.js} +2 -2
  18. package/dist/chunks/{chunk-HNU5CXW4.js → chunk-SVYO7LZ5.js} +1 -1
  19. package/dist/chunks/{chunk-HQXVCOH6.js → chunk-T7LHO6SF.js} +1 -1
  20. package/dist/chunks/{chunk-P56KWLXY.js → chunk-TX6K3Z5E.js} +1 -1
  21. package/dist/chunks/{chunk-AUSDBXUD.js → chunk-TY6AGA4P.js} +2 -2
  22. package/dist/chunks/{compile-vercel-config-ZVY7LBE3.js → compile-vercel-config-OLTGIW27.js} +1 -1
  23. package/dist/chunks/{delete-SKTJMJNP.js → delete-XAYXXDEB.js} +2 -2
  24. package/dist/chunks/{disable-AG7I6DPV.js → disable-PNN5ZWF4.js} +2 -2
  25. package/dist/chunks/{discard-LUK6LBLT.js → discard-QUK6T2AQ.js} +2 -2
  26. package/dist/chunks/{edit-3BR5HP3U.js → edit-D2OHUFQ6.js} +3 -3
  27. package/dist/chunks/{enable-4JNLOKSM.js → enable-SJV7HD2Y.js} +2 -2
  28. package/dist/chunks/{export-YLZ6QSHG.js → export-SN3F75NH.js} +2 -2
  29. package/dist/chunks/{inspect-HUJLUQAV.js → inspect-C2ZW7BZA.js} +3 -3
  30. package/dist/chunks/{list-EPU4SB3E.js → list-2DKITLDE.js} +2 -2
  31. package/dist/chunks/{list-RMA56KYZ.js → list-EUXU6BVD.js} +3 -3
  32. package/dist/chunks/{ls-7HHDYE6F.js → ls-7R3DRCUY.js} +4 -4
  33. package/dist/chunks/{publish-6YE4OUDI.js → publish-HNGKZNDH.js} +2 -2
  34. package/dist/chunks/{query-X6Q4ZSZO.js → query-G4SY7VMM.js} +2 -2
  35. package/dist/chunks/{reorder-VFM23ESC.js → reorder-Q2LYGVZK.js} +2 -2
  36. package/dist/chunks/{restore-VX34SXVF.js → restore-YJUUQLZG.js} +2 -2
  37. package/dist/chunks/{rm-5KXF2PY3.js → rm-XEV4FF6H.js} +4 -4
  38. package/dist/chunks/{rule-inspect-JG7AE5TI.js → rule-inspect-JNZMBVJF.js} +4 -4
  39. package/dist/chunks/{rules-XRJBT22L.js → rules-5PJVEET5.js} +6 -6
  40. package/dist/chunks/{schema-IMD4VV73.js → schema-OU7FKPQZ.js} +2 -2
  41. package/dist/chunks/{update-4FMWTIJK.js → update-6LXBPVBH.js} +4 -4
  42. package/dist/commands/build/index.js +13 -13
  43. package/dist/commands/deploy/index.js +13 -14
  44. package/dist/commands/dev/index.js +8 -8
  45. package/dist/commands/env/index.js +25 -11
  46. package/dist/commands/link/index.js +11 -11
  47. package/dist/commands/list/index.js +3 -3
  48. package/dist/commands-bulk.js +70 -51
  49. package/dist/index.js +10 -10
  50. package/dist/version.mjs +1 -1
  51. package/package.json +16 -16
  52. package/dist/chunks/chunk-O7SQKNIT.js +0 -247
  53. package/dist/chunks/chunk-RJD5NYGF.js +0 -149
@@ -1,247 +0,0 @@
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
- global_path_default
9
- } from "./chunk-537JTK2U.js";
10
- import {
11
- output_manager_default
12
- } from "./chunk-ZQKJVHXY.js";
13
- import {
14
- require_source
15
- } from "./chunk-S7KYDPEM.js";
16
- import {
17
- __toESM
18
- } from "./chunk-TZ2YI2VH.js";
19
-
20
- // src/util/agent/auto-install-agentic.ts
21
- var import_chalk = __toESM(require_source(), 1);
22
- import { readFile, writeFile, readdir } from "fs/promises";
23
- import { access } from "fs/promises";
24
- import { join } from "path";
25
- import { homedir } from "os";
26
- import { spawn } from "child_process";
27
- import { KNOWN_AGENTS } from "@vercel/detect-agent";
28
- var PREFS_FILE = "agent-preferences.json";
29
- var AGENT_TO_TARGET = {
30
- [KNOWN_AGENTS.CLAUDE]: "claude-code",
31
- [KNOWN_AGENTS.COWORK]: "claude-code",
32
- [KNOWN_AGENTS.CURSOR]: "cursor",
33
- [KNOWN_AGENTS.CURSOR_CLI]: "cursor"
34
- };
35
- async function fileExists(filePath) {
36
- try {
37
- await access(filePath);
38
- return true;
39
- } catch {
40
- return false;
41
- }
42
- }
43
- async function readPrefs() {
44
- try {
45
- const raw = await readFile(
46
- join(global_path_default(), PREFS_FILE),
47
- "utf-8"
48
- );
49
- return JSON.parse(raw);
50
- } catch {
51
- return {};
52
- }
53
- }
54
- async function writePrefs(prefs) {
55
- try {
56
- await writeFile(
57
- join(global_path_default(), PREFS_FILE),
58
- JSON.stringify(prefs, null, 2),
59
- "utf-8"
60
- );
61
- } catch {
62
- }
63
- }
64
- async function getPluginTargets(agentName) {
65
- if (agentName && AGENT_TO_TARGET[agentName]) {
66
- return [AGENT_TO_TARGET[agentName]];
67
- }
68
- const home = homedir();
69
- const targets = [];
70
- if (await fileExists(join(home, ".claude"))) {
71
- targets.push("claude-code");
72
- }
73
- if (await fileExists(join(home, ".cursor"))) {
74
- targets.push("cursor");
75
- }
76
- return targets;
77
- }
78
- async function isPluginInClaudeRegistry() {
79
- try {
80
- const raw = await readFile(
81
- join(homedir(), ".claude", "plugins", "installed_plugins.json"),
82
- "utf-8"
83
- );
84
- const data = JSON.parse(raw);
85
- const plugins = data?.plugins ?? {};
86
- return Object.keys(plugins).some(
87
- (key) => key.toLowerCase().includes("vercel-plugin")
88
- );
89
- } catch {
90
- return false;
91
- }
92
- }
93
- async function isPluginInCursorPlugins() {
94
- const pluginsDir = join(homedir(), ".cursor", "plugins");
95
- try {
96
- const entries = await readdir(pluginsDir, { withFileTypes: true });
97
- for (const entry of entries) {
98
- if (!entry.isDirectory())
99
- continue;
100
- if (entry.name.includes("vercel-plugin")) {
101
- return true;
102
- }
103
- }
104
- } catch {
105
- return false;
106
- }
107
- return false;
108
- }
109
- async function isPluginInstalledForTarget(target) {
110
- if (target === "claude-code") {
111
- return isPluginInClaudeRegistry();
112
- }
113
- if (target === "cursor") {
114
- return await isPluginInClaudeRegistry() || await isPluginInCursorPlugins();
115
- }
116
- return false;
117
- }
118
- async function confirm(client, message, autoConfirm) {
119
- if (autoConfirm && !client.isAgent) {
120
- return true;
121
- }
122
- if (!client.stdin.isTTY) {
123
- return false;
124
- }
125
- return client.input.confirm(message, true);
126
- }
127
- async function autoInstallAgentTooling(client, options) {
128
- try {
129
- const prefs = await readPrefs();
130
- if (!prefs.pluginDismissed) {
131
- const targets = await getPluginTargets(client.agentName);
132
- const uninstalledTargets = [];
133
- for (const target of targets) {
134
- if (!await isPluginInstalledForTarget(target)) {
135
- uninstalledTargets.push(target);
136
- }
137
- }
138
- if (uninstalledTargets.length > 0) {
139
- if (client.isAgent && !client.stdin.isTTY) {
140
- const next = uninstalledTargets.map((target) => ({
141
- command: `npx plugins add vercel/vercel-plugin --target ${target} -y`,
142
- when: `Install Vercel plugin for ${target}`
143
- }));
144
- client.stdout.write(
145
- `${JSON.stringify(
146
- {
147
- status: "action_required",
148
- reason: "plugin_install",
149
- message: "The Vercel plugin enhances your agent experience. Would you like to install it?",
150
- next
151
- },
152
- null,
153
- 2
154
- )}
155
- `
156
- );
157
- prefs.pluginDismissed = true;
158
- await writePrefs(prefs);
159
- return;
160
- }
161
- const targetList = uninstalledTargets.join(", ");
162
- output_manager_default.log(
163
- `The Vercel plugin installs on your agent harness (${targetList}) to give your AI agent the ability to manage deployments, environments, and more.`
164
- );
165
- const accepted = await confirm(
166
- client,
167
- "Install the Vercel plugin?",
168
- options?.autoConfirm
169
- );
170
- if (accepted) {
171
- let interrupted = false;
172
- for (const target of uninstalledTargets) {
173
- if (interrupted)
174
- break;
175
- output_manager_default.spinner(`Installing Vercel plugin for ${target}...`);
176
- const exitCode = await new Promise((resolve) => {
177
- const child = spawn(
178
- "npx",
179
- [
180
- "plugins",
181
- "add",
182
- "vercel/vercel-plugin",
183
- "--target",
184
- target,
185
- "-y"
186
- ],
187
- { stdio: "pipe" }
188
- );
189
- const onSigint = () => {
190
- interrupted = true;
191
- child.kill();
192
- };
193
- process.once("SIGINT", onSigint);
194
- child.on("close", (c) => {
195
- process.removeListener("SIGINT", onSigint);
196
- resolve(c ?? 1);
197
- });
198
- child.on("error", () => {
199
- process.removeListener("SIGINT", onSigint);
200
- resolve(1);
201
- });
202
- });
203
- output_manager_default.stopSpinner();
204
- if (interrupted) {
205
- output_manager_default.log("Plugin installation cancelled.");
206
- break;
207
- }
208
- if (exitCode === 0) {
209
- output_manager_default.success(`Installed Vercel plugin for ${target}`);
210
- } else {
211
- output_manager_default.debug(`Failed to install Vercel plugin for ${target}`);
212
- }
213
- }
214
- } else {
215
- prefs.pluginDismissed = true;
216
- await writePrefs(prefs);
217
- }
218
- }
219
- }
220
- } catch (err) {
221
- output_manager_default.debug(`Auto-install agent tooling failed: ${err}`);
222
- }
223
- }
224
- async function showPluginTipIfNeeded() {
225
- try {
226
- const prefs = await readPrefs();
227
- if (prefs.pluginDismissed)
228
- return;
229
- const targets = await getPluginTargets();
230
- for (const target of targets) {
231
- if (!await isPluginInstalledForTarget(target)) {
232
- output_manager_default.log(
233
- import_chalk.default.dim(
234
- "Tip: Run `npx plugins add vercel/vercel-plugin` to enhance your agent experience"
235
- )
236
- );
237
- return;
238
- }
239
- }
240
- } catch {
241
- }
242
- }
243
-
244
- export {
245
- autoInstallAgentTooling,
246
- showPluginTipIfNeeded
247
- };
@@ -1,149 +0,0 @@
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
- getEnvTargetPlaceholder
9
- } from "./chunk-537JTK2U.js";
10
- import {
11
- yesOption
12
- } from "./chunk-RFMC2QXQ.js";
13
- import {
14
- packageName
15
- } from "./chunk-ECRBC4HL.js";
16
-
17
- // src/commands/build/command.ts
18
- var buildCommand = {
19
- name: "build",
20
- aliases: [],
21
- description: "Build the project.",
22
- arguments: [],
23
- options: [
24
- {
25
- name: "prod",
26
- description: "Build a production deployment",
27
- shorthand: null,
28
- type: Boolean,
29
- deprecated: false
30
- },
31
- {
32
- name: "target",
33
- shorthand: null,
34
- type: String,
35
- argument: "TARGET",
36
- deprecated: false,
37
- description: "Specify the target environment"
38
- },
39
- {
40
- name: "output",
41
- description: "Directory where built assets will be written to",
42
- shorthand: null,
43
- argument: "DIR",
44
- type: String,
45
- deprecated: false
46
- },
47
- {
48
- ...yesOption,
49
- description: "Skip the confirmation prompt about pulling environment variables and project settings when not found locally"
50
- },
51
- {
52
- name: "standalone",
53
- description: "Create a standalone build with all dependencies inlined into function output folders",
54
- shorthand: null,
55
- type: Boolean,
56
- deprecated: false
57
- },
58
- {
59
- name: "id",
60
- description: "Deployment ID to pull environment variables from (e.g. dpl_xxx)",
61
- shorthand: null,
62
- type: String,
63
- argument: "ID",
64
- deprecated: false
65
- }
66
- ],
67
- examples: [
68
- {
69
- name: "Build the project",
70
- value: `${packageName} build`
71
- },
72
- {
73
- name: "Build the project in a specific directory",
74
- value: `${packageName} build --cwd ./path-to-project`
75
- },
76
- {
77
- name: "Build with deployment-scoped environment variables",
78
- value: `${packageName} build --id dpl_xxx`
79
- }
80
- ]
81
- };
82
-
83
- // src/commands/pull/command.ts
84
- var pullCommand = {
85
- name: "pull",
86
- aliases: [],
87
- description: "Pull latest environment variables and project settings from Vercel. ",
88
- arguments: [
89
- {
90
- name: "project-path",
91
- required: false
92
- }
93
- ],
94
- options: [
95
- {
96
- name: "environment",
97
- description: "Deployment environment [development]",
98
- argument: "TARGET",
99
- shorthand: null,
100
- type: String,
101
- deprecated: false
102
- },
103
- {
104
- name: "git-branch",
105
- description: "Specify the Git branch to pull specific Environment Variables for",
106
- argument: "NAME",
107
- shorthand: null,
108
- type: String,
109
- deprecated: false
110
- },
111
- {
112
- name: "prod",
113
- shorthand: null,
114
- type: Boolean,
115
- deprecated: false
116
- },
117
- {
118
- ...yesOption,
119
- description: "Skip questions when setting up new project using default scope and settings"
120
- }
121
- ],
122
- examples: [
123
- {
124
- name: "Pull the latest Environment Variables and Project Settings from the cloud",
125
- value: `${packageName} pull`
126
- },
127
- {
128
- name: "Pull the latest Environment Variables and Project Settings from the cloud targeting a directory",
129
- value: `${packageName} pull ./path-to-project`
130
- },
131
- {
132
- name: "Pull for a specific environment",
133
- value: `${packageName} pull --environment=${getEnvTargetPlaceholder()}`
134
- },
135
- {
136
- name: "Pull for a preview feature branch",
137
- value: `${packageName} pull --environment=preview --git-branch=feature-branch`
138
- },
139
- {
140
- name: "If you want to download environment variables to a specific file, use `vercel env pull` instead",
141
- value: `${packageName} env pull`
142
- }
143
- ]
144
- };
145
-
146
- export {
147
- buildCommand,
148
- pullCommand
149
- };