inflight-cli 2.9.0 → 2.11.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/commands/share.d.ts +1 -1
- package/dist/commands/share.js +19 -13
- package/dist/index.js +1 -1
- package/dist/lib/resolve-workspace.js +1 -1
- package/package.json +1 -1
package/dist/commands/share.d.ts
CHANGED
package/dist/commands/share.js
CHANGED
|
@@ -37,7 +37,7 @@ function isValidHostedUrl(url) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* Builds a next_command string carrying forward relevant opts from the current run.
|
|
40
|
+
* Builds a next_command string carrying forward relevant opts from the current run. test
|
|
41
41
|
*/
|
|
42
42
|
function buildNextCommand(base, opts) {
|
|
43
43
|
const parts = [base];
|
|
@@ -49,8 +49,8 @@ function buildNextCommand(base, opts) {
|
|
|
49
49
|
parts.push(`--deployment ${opts.deployment}`);
|
|
50
50
|
if (opts.project)
|
|
51
51
|
parts.push(`--project ${opts.project}`);
|
|
52
|
-
if (opts.
|
|
53
|
-
parts.push(
|
|
52
|
+
if (opts.versionMode)
|
|
53
|
+
parts.push(`--version-mode ${opts.versionMode}`);
|
|
54
54
|
return parts.join(" ");
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
@@ -98,7 +98,7 @@ async function checkAndSyncGit(cwd, opts = {}) {
|
|
|
98
98
|
if (isAgent) {
|
|
99
99
|
agentActionRequired({
|
|
100
100
|
type: "git_uncommitted",
|
|
101
|
-
message: "
|
|
101
|
+
message: "There are uncommitted changes that won't be in the deployment. Ask the user what to do.",
|
|
102
102
|
choices: [
|
|
103
103
|
{ id: "commit_push", label: "Commit and push these changes" },
|
|
104
104
|
{ id: "continue", label: "Continue without committing" },
|
|
@@ -167,7 +167,7 @@ async function checkAndSyncGit(cwd, opts = {}) {
|
|
|
167
167
|
if (isAgent) {
|
|
168
168
|
agentActionRequired({
|
|
169
169
|
type: "git_unpushed",
|
|
170
|
-
message: "
|
|
170
|
+
message: "There are unpushed commits that won't be in the deployment. Ask the user what to do.",
|
|
171
171
|
choices: [
|
|
172
172
|
{ id: "push", label: "Push these commits" },
|
|
173
173
|
{ id: "continue", label: "Continue without pushing" },
|
|
@@ -224,7 +224,7 @@ async function checkAndSyncGit(cwd, opts = {}) {
|
|
|
224
224
|
if (isAgent) {
|
|
225
225
|
agentActionRequired({
|
|
226
226
|
type: "git_no_remote",
|
|
227
|
-
message: `Branch "${branch}" hasn't been pushed yet — no deployment exists.`,
|
|
227
|
+
message: `Branch "${branch}" hasn't been pushed yet — no deployment exists. Ask the user what to do.`,
|
|
228
228
|
choices: [
|
|
229
229
|
{ id: "push", label: "Push to create a deployment" },
|
|
230
230
|
{ id: "continue", label: "Continue without pushing" },
|
|
@@ -304,7 +304,7 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
|
|
|
304
304
|
else {
|
|
305
305
|
agentActionRequired({
|
|
306
306
|
type: "choose_provider",
|
|
307
|
-
message: "Could not auto-detect deployment provider.",
|
|
307
|
+
message: "Could not auto-detect deployment provider. Ask the user which one they use.",
|
|
308
308
|
choices: [
|
|
309
309
|
{ id: "vercel", label: "Vercel" },
|
|
310
310
|
{ id: "netlify", label: "Netlify" },
|
|
@@ -350,14 +350,16 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
|
|
|
350
350
|
const currentBranch = gitInfo.branch;
|
|
351
351
|
agentActionRequired({
|
|
352
352
|
type: "choose_project",
|
|
353
|
-
message: "
|
|
353
|
+
message: "Ask the user which project to share into. Present all choices below as a numbered list.",
|
|
354
354
|
choices: [
|
|
355
355
|
{ id: "new", label: "Start a new project" },
|
|
356
356
|
...projects.map((proj) => ({
|
|
357
357
|
id: proj.projectId,
|
|
358
358
|
label: proj.latestVersion.title,
|
|
359
359
|
hint: [
|
|
360
|
-
proj.latestVersion.branch === currentBranch
|
|
360
|
+
proj.latestVersion.branch === currentBranch
|
|
361
|
+
? "current branch"
|
|
362
|
+
: proj.latestVersion.branch,
|
|
361
363
|
proj.latestVersion.branch === currentBranch ? "(recommended)" : undefined,
|
|
362
364
|
]
|
|
363
365
|
.filter(Boolean)
|
|
@@ -369,7 +371,7 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
|
|
|
369
371
|
}
|
|
370
372
|
}
|
|
371
373
|
// ── Resolve override vs new version ──
|
|
372
|
-
if (selectedProjectId && !opts.
|
|
374
|
+
if (selectedProjectId && !opts.versionMode) {
|
|
373
375
|
const { projects } = await apiGetRecentProjects(apiKey, workspaceId, 20).catch(() => ({
|
|
374
376
|
projects: [],
|
|
375
377
|
}));
|
|
@@ -377,7 +379,7 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
|
|
|
377
379
|
if (selectedProject && selectedProject.latestVersion.commentCount === 0) {
|
|
378
380
|
agentActionRequired({
|
|
379
381
|
type: "choose_override",
|
|
380
|
-
message: `"${selectedProject.latestVersion.title}" has no feedback yet.`,
|
|
382
|
+
message: `"${selectedProject.latestVersion.title}" has no feedback yet. Ask the user whether to update it or create a new version.`,
|
|
381
383
|
choices: [
|
|
382
384
|
{
|
|
383
385
|
id: "override",
|
|
@@ -390,11 +392,15 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
|
|
|
390
392
|
hint: "keep both in version history",
|
|
391
393
|
},
|
|
392
394
|
],
|
|
393
|
-
|
|
395
|
+
instructions: {
|
|
396
|
+
override: `Re-run with: inflight share --skip-git-check --deployment ${resolvedUrl} --project ${selectedProjectId} --version-mode override`,
|
|
397
|
+
new_version: `Re-run with: inflight share --skip-git-check --deployment ${resolvedUrl} --project ${selectedProjectId} --version-mode new`,
|
|
398
|
+
},
|
|
399
|
+
nextCommand: `inflight share --skip-git-check --deployment ${resolvedUrl} --project ${selectedProjectId} --version-mode <override|new>`,
|
|
394
400
|
});
|
|
395
401
|
}
|
|
396
402
|
}
|
|
397
|
-
if (opts.override && selectedProjectId) {
|
|
403
|
+
if (opts.versionMode === "override" && selectedProjectId) {
|
|
398
404
|
const { projects } = await apiGetRecentProjects(apiKey, workspaceId, 20).catch(() => ({
|
|
399
405
|
projects: [],
|
|
400
406
|
}));
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ program
|
|
|
34
34
|
.option("--project <id>", "Project ID, or 'new' to create")
|
|
35
35
|
.option("--provider <id>", "Deployment provider: vercel, netlify")
|
|
36
36
|
.option("--deployment <url>", "Specific deployment URL")
|
|
37
|
-
.option("--
|
|
37
|
+
.option("--version-mode <mode>", "Version handling: 'override' or 'new'")
|
|
38
38
|
.option("--skip-git-check", "Skip git state check (use after agent handled git)")
|
|
39
39
|
.action((opts) => shareCommand(opts));
|
|
40
40
|
program
|
|
@@ -58,7 +58,7 @@ export async function resolveWorkspace(workspaces, opts = {}) {
|
|
|
58
58
|
if (isAgent) {
|
|
59
59
|
agentActionRequired({
|
|
60
60
|
type: "choose_workspace",
|
|
61
|
-
message: "Multiple workspaces found.
|
|
61
|
+
message: "Multiple workspaces found. Ask the user which one to use.",
|
|
62
62
|
choices: workspaces.map((w) => ({ id: w.id, label: w.name })),
|
|
63
63
|
nextCommand: `${commandForNext} --workspace <ID>`,
|
|
64
64
|
});
|