Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

Closes #16549

Addresses feedback from PR #16547 review: update the 21.0.0 migration to use existing namedImportFilter util and adjust it to handle subpaths.

Changes

tsUtils.ts:

  • Add IG_LICENSED_PACKAGE_NAME constant for @infragistics/igniteui-angular
  • Add isIgniteuiImport(path) helper that handles base packages and subpaths (e.g., igniteui-angular/core, @infragistics/igniteui-angular/grids)
  • Update namedImportFilter to use isIgniteuiImport instead of endsWith(IG_PACKAGE_NAME)

update-21_0_0_import-migration/index.ts:

  • Use namedImportFilter from tsUtils for import validation instead of duplicating logic
  • Use .includes() checks with imported constants for quick file content checks (faster than regex)
  • Replace hardcoded package names with imported constants throughout

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
Original prompt

This section details on the original issue you should resolve

<issue_title>Update 21 migration to use existing util for import check</issue_title>
<issue_description>@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.

Originally posted by @damyanpetev in #16547 (comment)
</issue_description>

<agent_instructions>Make sure to reference the PR comments on #16547 (comment) for context</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 28, 2025 10:21
- Add IG_LICENSED_PACKAGE_NAME constant for @infragistics/igniteui-angular
- Add isIgniteuiImport helper function to handle base and subpath imports
- Update namedImportFilter to use isIgniteuiImport for subpath support
- Update update-21_0_0_import-migration to use constants from tsUtils
- Replace hardcoded package names with constants for maintainability

Co-authored-by: damyanpetev <3198469+damyanpetev@users.noreply.github.com>
Address code review feedback by pre-compiling the BASE_IMPORT_PATTERN
regex at module level instead of recompiling on each function call.

Co-authored-by: damyanpetev <3198469+damyanpetev@users.noreply.github.com>
Copilot AI changed the title [WIP] Update 21 migration to use existing util for import check refactor(migrations): use tsUtils for import checks in 21.0.0 migration Nov 28, 2025
Copilot AI requested a review from damyanpetev November 28, 2025 10:30
Copilot finished work on behalf of damyanpetev November 28, 2025 10:30
Copilot AI and others added 2 commits November 28, 2025 12:08
Address review feedback:
- Use namedImportFilter from tsUtils instead of duplicating logic
- Restore .includes() checks with constants (faster than regex)
- Remove unnecessary regex-based hasBaseIgniteuiImports function

Co-authored-by: damyanpetev <3198469+damyanpetev@users.noreply.github.com>
- Add comment explaining non-null assertions are safe due to namedImportFilter validation
- Clarify the quick check is for base imports (not subpaths)

Co-authored-by: damyanpetev <3198469+damyanpetev@users.noreply.github.com>
Copilot AI requested a review from damyanpetev November 28, 2025 12:13
Copilot finished work on behalf of damyanpetev November 28, 2025 12:13
@damyanpetev damyanpetev requested review from Lipata and kdinev November 28, 2025 14:03
@damyanpetev damyanpetev marked this pull request as ready for review November 28, 2025 14:08
@damyanpetev damyanpetev merged commit c3d6ce2 into master Nov 28, 2025
7 checks passed
@damyanpetev damyanpetev deleted the copilot/update-21-migration-util branch November 28, 2025 14:21
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.

Update 21 migration to use existing util for import check

3 participants