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

Pretty Print Plugin Tree #64

Closed
StarpTech opened this issue May 31, 2018 · 4 comments
Closed

Pretty Print Plugin Tree #64

StarpTech opened this issue May 31, 2018 · 4 comments

Comments

@StarpTech
Copy link
Member

StarpTech commented May 31, 2018

Hi @mcollina, @smartiniOnGitHub has a neat idea to illustrate the plugin tree for diagnostic purposes as in find-my-way WDYT?

e.g

console.log(avvio.prettyPrint())
// └── /
//   ├── root (fastify v1.0.0) 44ms
//   │   └── /fastify-auth (v0.0.4) 2ms
//   │   └── /fastify-swagger (v0.4.4) 23ms
//   │   └── /fastify-custom (v1.0.0) 19ms
//   │   	└── /fastify-a (v1.0.0) 9ms
//   │   	└── /fastify-b (v1.0.0) 10ms

The tree would illustrate the loading order and other useful informations like plugin name, version, loading-time. Dependencies across different plugins could be marked in different colors. There are many options 😄.

avvio.prettyPrint([updates=false])

Should be able to call it before everything is bootsrapped. The cli can update itself so it's possible to see which plugin has issues to bootstrap.

@mcollina
Copy link
Member

Note that avvio does not anything about prefixes, those are fastify thing.
Other than that, go for it.

@delvedor
Copy link
Member

I like it!
I suggest to use node-archy, in find-my-way we are using a way to complex method :P

We should think how to handle unnamed plugins.

@StarpTech
Copy link
Member Author

StarpTech commented May 31, 2018

Note that avvio does not anything about prefixes, those are fastify thing.

Good note. This must be enriched in a different way. I leave it open so anybody can start a try.

@climba03003
Copy link
Member

Resolved in #81

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

No branches or pull requests

4 participants