nxext / nx-extensions

Nx Extension for StencilJs, SvelteJS, SolidJS, Ionic and VueJs
MIT License
451 stars 100 forks source link

Svelte: nx graph doesn't work. #991

Closed kryptus36 closed 11 months ago

kryptus36 commented 11 months ago

Describe the bug Note, this may be because nx itself doesn't scan .svelte files for deps. I am going to pray I can get them to help if that's the case.

If you run nx graph and select your svelte app & libs, no dependencies are shown.

Probably affects SvelteKit as well.

To Reproduce Steps to reproduce the behavior:

I've created a demo repo. It has a nestjs app for reference and a svelte app. https://github.com/kryptus36/graph-test

If you run nx graph and turn on all projects you can see the deps between nestjs and its lib, but not the svelte one.

Expected behavior A correct dep graph is displayed.

Additional context If the dep graph is broken it can affect other NX functions. The one case in point for my usage is the official nx plugins for react, angular have a script called createGlobPatternsForDependencies which is used as a helper for tailwind css to correctly scan your source tree.

I think it probably also affects nx caching functionality, though I haven't verified that.

kryptus36 commented 11 months ago

Here's the response from NX:

Nx's plugin API allows community plugins to add dependencies to the graph, and it looks like that plugin doesn't implement it. Implementing that capability is up to the plugin authors, and is why you do not see edges. Feel free to open an issue on the nx-extensions repo requesting support, but its not something that we would add here since we don't officially support svelte files.

DominikPieper commented 11 months ago

For the support of .svelte files we need to implement the graph extension. Like for the Vue plugin