Giter VIP home page Giter VIP logo

Comments (4)

mrjoelkemp avatar mrjoelkemp commented on May 20, 2024

Hi! Thanks for the question. I don't know anything about how vue works or how it differs from any of the supported filetypes. Do you have links to more information on what you'd need that's vue specific? A sample vue repo with the output of a current run of dependency tree would help highlight the files that aren't parsed properly.

Once I better understand what's not working on vue codebases, we can scope what would need to change to support it properly.

Thanks!

from node-dependency-tree.

sz-p avatar sz-p commented on May 20, 2024

Thanks for your reply!
Background information: I use node-dependency-tree in vscode-framegraph, a vscode-extension to show dependency tree.

About vue: vue is a font-end frame like react

Simple Project : demo is a simple vue project its dependency is like:
image

ps: get-dependency-tree is work on vue-project, but is not work very well. maybe this can help you

Thanks Again

from node-dependency-tree.

mrjoelkemp avatar mrjoelkemp commented on May 20, 2024

Thanks for the extra detail! I appreciate it.

I think the hard part here is handling .vue components that have embedded html and css. To get that to work, you need a custom parser to be used on .vue files.

If you know of a well-supported library that can take in a vue file and return a JS AST, then it could be used to extract the imports from a .vue file. You could then possible use the commonjs module resolver to convert those extracted imports into concrete filepaths for recursive traversal.

https://github.com/dependents/node-dependency-tree#how-does-this-work is an attempt at explaining the flow and the main modules at play for finding dependencies and mapping those dependencies to files for traversal. I'd look at the way the typescript support works and see how vue support can map to that.

I don't use TS at all these days and haven't used Vue at all ever, so I can't really provide support myself (it would be naive and buggy, i'm sure). If you have the time and really want it in, I'm happy to answer questions or clarify the design of dependency-tree and its lower level modules. I welcome PRs and appreciate the help.

from node-dependency-tree.

sz-p avatar sz-p commented on May 20, 2024

I have fixed this problem. thank you for your explanation about node-dependency-tree, it helps me a lot.

vue-template-es2015-compiler is a loader to get vue string code and parse it's html template,javascript code,css module. if you got the javascript string code of vue file, you can do what you want, maybe JS AST or anything else.

how to parse vue file showed how to parse vue file. maybe this can help you.

Finally, I have fixed this problem. if you have time you can support vue file in node-dependency-tree. maybe this issue can be closed.

Thanks Again

from node-dependency-tree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.