Skip to content
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

Multiple imports are suggested, just one is the recommended #411

Closed
1 task done
davidlj95 opened this issue Mar 8, 2024 · 2 comments · Fixed by #412 or #414
Closed
1 task done

Multiple imports are suggested, just one is the recommended #411

davidlj95 opened this issue Mar 8, 2024 · 2 comments · Fixed by #412 or #414
Assignees
Labels

Comments

@davidlj95
Copy link
Owner

Project

ngx-meta

What happened?

After using latest version of library in a real life app, found out the IDE lets you import same thing from several places.

For instance, if importing something from core entry point, it suggests you can import it from:

  1. @davidlj95/ngx-meta/core: the right one. Things are actually there for both flattened & unflattened exports.
  2. @davidlj95/ngx-meta/core/public-api: shouldn't be used, as that public-api file could change
  3. @davidlj95/ngx-meta/core/src/some-file: shouldn't be used, as that some-file filename / path could change.

In order to avoid using non-recommended imports 2/3, we should rollup our Typescript definitions, as Angular Package Format recommends.

API Extractor is recommended for that purpose. Which we already use for the API Report and docs.

However, it is not possible right now to use Typescript definitions rollup when there are secondary entry points

So seems we'll need to go another way

Version

1.0.0-alpha.45

Minimal reproduction

import { GlobalMetadata } from '@davidlj95/ngx-meta/core'

Code of Conduct

  • I agree to follow this project's Code of Conduct
@davidlj95 davidlj95 added the bug Something isn't working label Mar 8, 2024
@davidlj95 davidlj95 added dx and removed bug Something isn't working labels Mar 8, 2024
@davidlj95 davidlj95 linked a pull request Mar 8, 2024 that will close this issue
@davidlj95 davidlj95 self-assigned this Mar 8, 2024
@davidlj95
Copy link
Owner Author

After #412 , only 1 / 2 options are shown to import:

image

@davidlj95
Copy link
Owner Author

davidlj95 commented Mar 10, 2024

Aaaaaaand it's gone (#414)

image

🎉

Had to clear cache of WebStorm. Restarting Typescript service wasn't enough :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant