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

riverpod_graph generates no output when run with -f=d2 #2765

Closed
freemansoft opened this issue Jul 23, 2023 · 4 comments
Closed

riverpod_graph generates no output when run with -f=d2 #2765

freemansoft opened this issue Jul 23, 2023 · 4 comments
Assignees
Labels
bug Something isn't working needs triage

Comments

@freemansoft
Copy link
Contributor

Describe the bug
riverpod_graph generates mermaid output but not d2 output

To Reproduce
The only example I could find for running riverpod_graph was here. It publishes locally from git. I can't figure out how to do this from the local tree.

cd examples\todo
dart pub global activate -sgit https://github.com/rrousselGit/riverpod.git --git-path packages/riverpod_graph

generate mermaid output - the mermaid markup shows up on stdout.

dart pub global run riverpod_graph:riverpod_graph 

or

dart pub global run riverpod_graph:riverpod_graph -f=mermaid

No output at all

dart pub global run riverpod_graph:riverpod_graph -f=d2

Expected behavior
I expect there should be d2 output that is an analog to the mermaid js output

@freemansoft
Copy link
Contributor Author

freemansoft commented Jul 23, 2023

VSCode built the run command for me that runs a graph analysis on a directory.

mermaid generates reasonable outlet

C:\Users\...\riverpod\packages\riverpod_graph> dart run .\bin\riverpod_graph.dart ..\..\examples\todo\lib

d2 still generates no output

C:\Users\...\riverpod\packages\riverpod_graph> dart run .\bin\riverpod_graph.dart ..\..\examples\todo\lib

launch.json configuration looks like

        {
            "name": "riverpod_graph examples/todo d2",
            "cwd": "packages/riverpod_graph",
            "request": "launch",
            "type": "dart",
            "program": "bin/riverpod_graph.dart",
            "args": [
                "../../examples/todo/lib",
                "-f",
                "d2"
            ]
        },
        {
            "name": "riverpod_graph examples/todo mermaid",
            "cwd": "packages/riverpod_graph",
            "request": "launch",
            "type": "dart",
            "program": "bin/riverpod_graph.dart",
            "args": [
                "../../examples/todo/lib",
                "-f",
                "mermaid"
            ]
        },

Will probably do a documentation PR for this.

@utamori
Copy link
Contributor

utamori commented Jul 23, 2023

you must specify the PATH you wish to analyze
riverpod_graph . -f d2

@freemansoft
Copy link
Contributor Author

freemansoft commented Jul 24, 2023

Figured it out. On my Windows machine, the analysis package does not throw an error if the analysis target directory does not exist.


For future notes

This worked for me when operating with just code from the repo and not activate

../riverpod/packages/riverpod_graph$ dart run riverpod_graph:riverpod_graph ../../examples/odos/lib -f d2

This works for me in the VSCode launch.json. I had the directory as examples/todo when it actually was examples/todos.

        {
            "name": "riverpod_graph examples/todos d2",
            "cwd": "packages/riverpod_graph",
            "request": "launch",
            "type": "dart",
            "program": "bin/riverpod_graph.dart",
            "args": [
                "../../examples/todos/lib",
                "-f",
                "d2"
            ]
        },
        {
            "name": "riverpod_graph examples/todos mermaid",
            "cwd": "packages/riverpod_graph",
            "request": "launch",
            "type": "dart",
            "program": "bin/riverpod_graph.dart",
            "args": [
                "../../examples/todos/lib",
                "-f",
                "mermaid"
            ]
        },

@freemansoft
Copy link
Contributor Author

https://joe.blog.freemansoft.com/2023/07/get-better-understanding-of-your.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

3 participants