Skip to content

refactor: use relative imports within npm packages #30588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2025

Conversation

andrewseguin
Copy link
Contributor

@andrewseguin andrewseguin commented Mar 5, 2025

Switch to using relative imports within directories under the broad npm packages like @angular/material and @angular/cdk.

@andrewseguin andrewseguin requested a review from a team as a code owner March 5, 2025 20:07
@andrewseguin andrewseguin requested review from crisbeto and wagnermaciel and removed request for a team March 5, 2025 20:07
@andrewseguin andrewseguin changed the title Pkg refactor: use relative imports within npm packages Mar 5, 2025
@andrewseguin andrewseguin requested a review from devversion March 5, 2025 20:07
@andrewseguin andrewseguin added the target: patch This PR is targeted for the next patch release label Mar 5, 2025
@@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {ObserversModule} from '@angular/cdk/observers';
// @ng_package: ignore-cross-repo-import
import {ObserversModule} from '../observers';
Copy link
Member

Choose a reason for hiding this comment

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

I was under the impression that cross-package imports should still be absolute?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked with @devversion to confirm that everything within src/material should be relative to each other since they are all shared under the @angular/material npm package. Likewise with cdk

@andrewseguin andrewseguin force-pushed the pkg branch 7 times, most recently from 1412665 to 72655a7 Compare March 7, 2025 14:00
@andrewseguin andrewseguin added action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Mar 11, 2025
@andrewseguin andrewseguin merged commit 626a465 into angular:main Mar 11, 2025
21 of 24 checks passed
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants