( serverType: "node" | "python" | "binary", )
| 584 | } |
| 585 | |
| 586 | export async function promptCompatibility( |
| 587 | serverType: "node" | "python" | "binary", |
| 588 | ) { |
| 589 | const addCompatibility = await confirm({ |
| 590 | message: "Add compatibility constraints?", |
| 591 | default: false, |
| 592 | }); |
| 593 | |
| 594 | if (!addCompatibility) { |
| 595 | return undefined; |
| 596 | } |
| 597 | |
| 598 | const addPlatforms = await confirm({ |
| 599 | message: "Specify supported platforms?", |
| 600 | default: false, |
| 601 | }); |
| 602 | |
| 603 | let platforms: ("darwin" | "win32" | "linux")[] | undefined; |
| 604 | if (addPlatforms) { |
| 605 | const selectedPlatforms: ("darwin" | "win32" | "linux")[] = []; |
| 606 | |
| 607 | const supportsDarwin = await confirm({ |
| 608 | message: "Support macOS (darwin)?", |
| 609 | default: true, |
| 610 | }); |
| 611 | if (supportsDarwin) selectedPlatforms.push("darwin"); |
| 612 | |
| 613 | const supportsWin32 = await confirm({ |
| 614 | message: "Support Windows (win32)?", |
| 615 | default: true, |
| 616 | }); |
| 617 | if (supportsWin32) selectedPlatforms.push("win32"); |
| 618 | |
| 619 | const supportsLinux = await confirm({ |
| 620 | message: "Support Linux?", |
| 621 | default: true, |
| 622 | }); |
| 623 | if (supportsLinux) selectedPlatforms.push("linux"); |
| 624 | |
| 625 | platforms = selectedPlatforms.length > 0 ? selectedPlatforms : undefined; |
| 626 | } |
| 627 | |
| 628 | let runtimes: { python?: string; node?: string } | undefined; |
| 629 | if (serverType !== "binary") { |
| 630 | const addRuntimes = await confirm({ |
| 631 | message: "Specify runtime version constraints?", |
| 632 | default: false, |
| 633 | }); |
| 634 | |
| 635 | if (addRuntimes) { |
| 636 | if (serverType === "python") { |
| 637 | const pythonVersion = await input({ |
| 638 | message: "Python version constraint (e.g., >=3.8,<4.0):", |
| 639 | validate: (value) => |
| 640 | value.trim().length > 0 || "Python version constraint is required", |
| 641 | }); |
| 642 | runtimes = { python: pythonVersion }; |
| 643 | } else if (serverType === "node") { |
no outgoing calls
no test coverage detected
searching dependent graphs…