Note
ამ გვერდზე წვდომა ავტორიზაციას მოითხოვს. შეგიძლიათ სცადოთ შესვლა ან დირექტორიების შეცვლა.
ამ გვერდზე წვდომა ავტორიზაციას მოითხოვს. შეგიძლიათ სცადოთ დირექტორიების შეცვლა.
This quickstart shows you how to use GitHub Copilot modernization to upgrade npm packages in a JavaScript or TypeScript project. GitHub Copilot modernization for JavaScript/TypeScript analyzes your project, suggests an upgrade plan, automatically upgrades packages, and helps you apply any necessary code changes.
Prerequisites
- Node.js and npm.
- Visual Studio Code.
- GitHub Copilot. Sign in to your GitHub account in Visual Studio Code.
- GitHub Copilot modernization extension.
Open the project
Open your JavaScript or TypeScript project folder in Visual Studio Code. The project must contain a package.json file for the tool to detect it.
Start the upgrade
To start the npm package upgrade process, use the following steps:
In Visual Studio Code, open the GitHub Copilot modernization panel from the Activity Bar on the left side of the window.
In the panel, select the Upgrade npm Packages button. This button only appears if the tool detects a
package.jsonfile in your project.The Copilot Chat window opens automatically. Copilot analyzes your project and proposes an upgrade plan. Review the plan in the chat window.
Follow the prompts in Copilot Chat. Copilot asks questions and requests confirmations as it walks you through each stage of the upgrade. The tool is interactive, so answer questions in the chat as they appear.
Copilot upgrades your
package.jsonfile, runs the appropriate package-manager commands for your project (such asnpm install,npm update,pnpm install, oryarn install), and suggests code changes if any breaking changes or API updates require modifications.
Behind the scenes, the tool operates in an iterative loop: it analyzes the project, makes changes, verifies the build or checks for issues, and repeats as necessary. This process runs in Copilot's agent mode to provide intelligent, context-aware assistance. The tool creates a dedicated branch for the upgrade session and commits changes to that branch automatically as it works.
Review changes and create a pull request
When the upgrade session completes, review what the tool did and decide whether to merge the work:
Open
summary.mdunder<project>/.github/modernize/code-migration/<timestamp>/for an overview of what the upgrade session changed.Use the Visual Studio Code source control panel to review the commits the tool made on the upgrade branch.
Run your project's build and test scripts to verify the upgraded project behaves as expected.
When you're satisfied with the changes, create a pull request from the upgrade branch into your main branch using your preferred Git workflow.