Skip to content

Conversation

@damyanpetev
Copy link
Member

Closes #

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the import migration logic to handle both the open-source package name (igniteui-angular) and the licensed package name (@infragistics/igniteui-angular). The changes ensure that migrations work correctly for users of either package version.

Key changes:

  • Extended import path checks to include the licensed package name
  • Modified import generation to preserve the original package name in migrated imports

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Track old type names that were imported
const moduleSpecifier = node.moduleSpecifier;
if (ts.isStringLiteral(moduleSpecifier) && moduleSpecifier.text === 'igniteui-angular') {
if (ts.isStringLiteral(moduleSpecifier) && (moduleSpecifier.text === 'igniteui-angular' || moduleSpecifier.text === '@infragistics/igniteui-angular')) {
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package name check is duplicated across multiple locations (lines 721, 802, and 880-881). Consider extracting this into a helper function like isIgniteUIPackage(packageName: string): boolean to improve maintainability and reduce duplication.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Yes, that'd be an improvement and even better there's already an namedImportFilter in projects\igniteui-angular\migrations\common\tsUtils.ts that does a similar check for other migrations that should've been used to begin with.
Since this one is merged, create a new PR against master to update this migration to use the tsUtil and while at it adjust the namedImportFilter function to also handle subpaths because the current endWith check handles @infragistics/igniteui-angular as well, but limits the subpaths for entry points after the main package name.

Comment on lines +880 to +881
if (!originalContent.includes("from 'igniteui-angular'") && !originalContent.includes('from "igniteui-angular"') &&
!originalContent.includes("from '@infragistics/igniteui-angular'") && !originalContent.includes('from "@infragistics/igniteui-angular"')) {
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition is checking four string variations for two package names. Consider using a regular expression pattern like /from ['"](@infragistics\/)?igniteui-angular['"]/ to simplify the check and improve readability.

Suggested change
if (!originalContent.includes("from 'igniteui-angular'") && !originalContent.includes('from "igniteui-angular"') &&
!originalContent.includes("from '@infragistics/igniteui-angular'") && !originalContent.includes('from "@infragistics/igniteui-angular"')) {
if (!/from\s+['"](@infragistics\/)?igniteui-angular['"]/.test(originalContent)) {

Copilot uses AI. Check for mistakes.
@damyanpetev damyanpetev merged commit ace116f into master Nov 28, 2025
7 checks passed
@damyanpetev damyanpetev deleted the dpetev/migration-update branch November 28, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants