stil4m/elm-analyse

Bug: Dependencies not recognized

Closed this issue · 3 comments

Im my project, dependencies do not seem to be recognized, because Package Dependencies is empty and Module Graph tells me I have 0 Imports, which is not true because I my Main.elm is full of imports. The project is not public, but maybe you can help me with the following info:

package.json:

{
    "version": "1.0.0",
    "summary": "helpful summary of your project, less than 80 characters",
    "repository": "https://github.com/user/project.git",
    "license": "BSD3",
    "source-directories": [
        "."
    ],
    "exposed-modules": [],
    "dependencies": {
        "NoRedInk/elm-decode-pipeline": "3.0.0 <= v < 4.0.0",
        "elm-lang/core": "5.1.1 <= v < 6.0.0",
        "elm-lang/html": "2.0.0 <= v < 3.0.0",
        "elm-lang/http": "1.0.0 <= v < 2.0.0",
        "elm-tools/parser": "2.0.1 <= v < 3.0.0",
        "krisajenkins/remotedata": "4.3.0 <= v < 5.0.0",
        "ohanhi/remotedata-http": "2.0.2 <= v < 3.0.0"
    },
    "elm-version": "0.18.0 <= v < 0.19.0"
}
$ elm analyse -s
Elm Analyser server starting with config:
{ port: 3000, elmFormatPath: 'elm-format' }
Listening on http://localhost:3000
INFO: No configuration provided. Using default configuration.
INFO: Load dependency NoRedInk/elm-decode-pipeline3.0.0
INFO: Load dependency elm-lang/core5.1.1
INFO: Load dependency elm-lang/html2.0.0
INFO: Load dependency elm-lang/http1.0.0
INFO: Load dependency elm-tools/parser2.0.1
INFO: Load dependency krisajenkins/remotedata4.3.0
INFO: Load dependency ohanhi/remotedata-http2.0.2
INFO: Load file Main.elm...
Found 22 message(s)
 $ tree -L 3   
.
├── Caddyfile
├── elm.js
├── elm-package.json
├── elm-stuff
│   ├── exact-dependencies.json
│   └── packages
│       ├── elm-lang
│       ├── elm-tools
│       ├── krisajenkins
│       ├── NoRedInk
│       └── ohanhi
├── index.html
└── Main.elm

7 directories, 6 files

Both the Package Dependencies and Module Graph currently only include the current projects source files. This excludes all Elm modules that are not defined in a path that matches source-directories or exist in elm-stuff.

The term Package resist on the folder structure you can use to define Elm files. Maybe this is confusing. What do you think? (All in all, I am currently not sure if the 'Package Dependencies' tab should remain in future versions of elm-analyse)

Currently I only see one Elm file in your project (Main.elm), if you create more files and have dependencies between them, these will show up in both sections of the UI.

Does this clear things up?

Closed this as not a bug, but as an unclarity. If someone else encounters the same thing, this will be picked up.

jsoo1 commented

This causes any dependency only used in Main to be reported as unused.