-
Notifications
You must be signed in to change notification settings - Fork 39
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
Using a dependancy is not working correctly #205
Comments
With regards to the first issue, there is something wrong with the path globbing. If I do some debugging to print
If I change the glob to
Also if I hardcode the path as the glob |
Ok so I have found the reason for the first issue
The fact that ignore is ignoring the node modules and is the last thing which is mixed into the merged glob array is blocking my glob. Perhaps we need to disable that glob being added if we have the I am still observing the same issue from when I was copying the file out manually anyway though - I am only getting this extra empty section in my output manifest
|
With my second issue, I think I have tracked it down to an error being thrown on this line
It seems we are using |
So after seeing that it is expecting source files rather than the json manifest I changed my glob to look at source files in the appropriate node modules directory. It does parse them but it falls over constantly on errors like this I think that this point with my investigation into the glob pattern done but a bit stuck on this current issue, it makes sense for me to wait for a maintainer to get back to me with thoughts on my findings, and whether there is some user error on my end |
Thanks for the reply. Before I try to do that, can I clarify what
|
Ok to be honest then I don't think that is actually exactly what I want to do. I want to have both manifest files combined so I can just use the data for all of it. For reference I am trying to build an LSP plugin for custom elements which is using data from the manifest to completion and diagnostics. In this case would it be syntaxtically correct for me to just merge the modules arrays from the two files? Regardless, I still think I do want the dependencies linked because if in the base repo we extend something from the library, we want relevent info about attributes on the elements we extend too. But I think for that if I am understanding you correctly, I don't pass it the glob for the node modules at all - the script should be working out what files we want from the node modules via the imports and exports of the local source files? |
I think so, but you may have to adjust/correct paths
Yeah, this should be based on the source code and what the source code uses
Cool, have you seen https://github.com/Matsuuu/custom-elements-language-server ? |
Ok I think this thread is probably user error on my part so apologies from the confusion. I need to investigate those two seperate points myself.
Yes, but I only recently became aware of that after I had already started my investigation - I need to look at that properly. We have taken different approaches though. Mine is a typescript plugin so you'd install it via node and then into the tsconfig.json rather than it being an IDE plugin. For our specific use case that is better I think, but it still needs some thought |
Alright, I'll close this issue then if that's okay with you :)
It happens :) Different approaches are healthy 👍 Maybe there's an opportunity for collaboration, or to learn from eachother. Would love to see the result of your project when its finished! |
Yes I am happy for you to close this issue, thanks for spending the time investigating and explaining. Also yes, I am going to carry on my proof of concept investigation for now and will hopefully be able to share my findings once I have. Then I can take the decision from there about whether it is worth continuing/using Matsuu's instead/or even collaborating on one together |
@matteematt the CELS has a detached core that uses typesript and CEM and doesn't fixate on implementation details. As for tsconfig setup vs LSP, I prefer the LSP approach but understand that it might not fit your cases but would be open to discuss in github issues or discord |
@Matsuuu sounds good. Github issues might be better for being public. Would I raise an issue on your repo? |
@matteematt Sure! Go ahead |
Checklist
--dev
flag to get more information?Completing the items above will greatly improve triaging time of your issue.
Expected behavior
A clear and concise description of what you expected to happen.
I have a project which some directories like the following
The
web/src
directory contains ts files with custom elements. I want to create a manifest out of them, and also include the one that is in my node modules package.I run
$ cem analyze --globs {node_modules/@pkg,web/src}/**/*.{js,ts,json} --fast --dependencies
. I get the output of theweb/src
into a manifest which is great, but it does not include the manifest from the node modules that I want.If I manually copy the
custom-elements.json
out of the node modules into theweb/src/
directory then it does pick it up, but it doesn't actually add any of it to the json file. In this instance I just get this extra empty block added to the manifest it generatesAm I misunderstanding how this works? Should I be manually just merging the module arrays from both of the json files myself?
The text was updated successfully, but these errors were encountered: