Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
finish-migration.ts1.71 kB
import { getNxWorkspacePath } from '@nx-console/vscode-configuration'; import { window, commands } from 'vscode'; import { importMigrateUIApi, readMigrationsJsonMetadata } from './utils'; import { logAndShowError } from '@nx-console/vscode-output-channels'; export async function finishMigration(squashCommits: boolean) { window .showWarningMessage( 'Are you sure you want to finish the migration?', { modal: true, detail: 'This will remove the migrations.json file and commit the changes.', }, 'Finish Migration', ) .then(async (result) => { if (result === 'Finish Migration') { const workspacePath = getNxWorkspacePath(); const migrationsJsonMetadata = readMigrationsJsonMetadata(); const commitMessage = squashCommits ? await window.showInputBox({ prompt: 'Enter a commit message', value: `chore: migrate nx to ${migrationsJsonMetadata?.targetVersion ?? 'new version'}`, }) : `chore: migrate nx to ${migrationsJsonMetadata?.targetVersion ?? 'new version'}`; if (!commitMessage) { return; } try { const migrateUiApi = await importMigrateUIApi(workspacePath); migrateUiApi.finishMigrationProcess( workspacePath, squashCommits, commitMessage, ); } catch (e) { logAndShowError( 'Failed to finish migration process', `Failed to finish migration process: ${e}`, ); } commands.executeCommand('nxMigrate.close'); commands.executeCommand('nxMigrate.refresh'); } }); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nrwl/nx-console'

If you have feedback or need assistance with the MCP directory API, please join our Discord server