ionic-team / stencil-ds-output-targets

These are output targets that can be added to Stencil for React and Angular.
https://stenciljs.com
MIT License
249 stars 115 forks source link

bug: angular-output-target does not preserve symlinks automatically #332

Open mehrabix opened 1 year ago

mehrabix commented 1 year ago

Prerequisites

Stencil Version

3.0.0

Stencil Framework Output Target

Angular

Stencil Framework Output Target Version

0.6.0

Current Behavior

When i add components made with stencil output target to a angular 15.x.x project it shows console error: G0203: inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with EnvironmentInjector#runInContext.

But if i add "preserveSymlinks": true, in my angular.json builder option project it will work fine. Am i doing wrong in my stencil.config.ts? I don't want to set preserveSymlinks to true

Expected Behavior

Don't want to add preserveSymlinks to true in my Angular 15.0.0 project to work with my stencil components.

Steps to Reproduce

provide a way to adding stencil web component to Angular project without user manually define custom element.

Code Reproduction URL

https://github.com/prismaui/prismaui

Additional Information

sdss

sean-perkins commented 1 year ago

Hello @mehrabix thanks for opening this issue.

Can you help me understand why you do not want to use preserveSymlinks? This is a configuration of Angular workspaces, when sharing a library with an application.

Stencil/the output targets do not have an opinionation on this configuration. If you did not want this configuration, you would need to publish the packages or look into additional tooling that avoids preserveSymlinks (possibly pnpm workspaces or a script to copy the built packages).

mehrabix commented 1 year ago

Thanks @sean-perkins for replay. But i don't want user to involved in boilerplate configuration in Angular in order to use my Ui library. any idea ??

ionitron-bot[bot] commented 1 week ago

This issue has been labeled as help wanted. This label is added to issues that we believe would be good for contributors.

If you'd like to work on this issue, please comment here letting us know that you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort. Thank you!

christian-bromann commented 1 week ago

If anyone has an idea on how to resolve this, any contributions would be much appreciated.