elm-lang / elm-package

Command line tool to share Elm libraries
BSD 3-Clause "New" or "Revised" License
214 stars 66 forks source link

elm-package always fails to get a specific 0.16 package #209

Closed doppioslash closed 8 years ago

doppioslash commented 8 years ago

I have 0.16 installed on my machine, after cleaning ~/.elm and elm-stuff in my project I still have this message when trying to get the package mdgriffith/elm-style-animation-zero-sixteen (also same for mdgriffith/elm-style-animation-0.16):

$ elm-package install

Error: There are no versions of package 'mdgriffith/elm-style-animation-zero-sixteen' on your computer.

If I remove it from the elm-package and try to install again:

$ elm-package install mdgriffith/elm-style-animation-zero-sixteen 1.0.1
To install mdgriffith/elm-style-animation-zero-sixteen I would like to add the following
dependency to elm-package.json:

    "mdgriffith/elm-style-animation-zero-sixteen": "1.0.1 <= v < 2.0.0"

May I add that to elm-package.json for you? (y/n) y

Error: There are no versions of package 'mdgriffith/elm-style-animation-zero-sixteen' on your computer.

My elm-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": {
        "elm-lang/core": "3.0.0 <= v < 4.0.0",
        "evancz/elm-effects": "2.0.1 <= v < 3.0.0",
        "evancz/elm-html": "4.0.2 <= v < 5.0.0",
        "evancz/start-app": "2.0.2 <= v < 3.0.0",
        "mdgriffith/elm-style-animation-zero-sixteen": "1.0.1 <= v < 2.0.0"
    },
    "elm-version": "0.16.0 <= v < 0.17.0"
}

Attached a small project you can use this description to reproduce the bug on. testhtmlanim.zip

The package is visible on package.elm-lang.org but it's not in the all 0.16 packages list.

If I install it forcibly by cloning it to elm-stuff and changing the directory structure to match elm-stuff's I can use it to compile, but it still shows the Error: There are no versions of package 'mdgriffith/elm-style-animation-zero-sixteen' on your computer. error when running elm-package install.

eeue56 commented 8 years ago

@evancz this is important, means that any new package for 0.16 isn't being added to the right list and is not installable. Not too sure on the work involved to fix it

Janiczek commented 8 years ago

EDIT: what I have written below has no relevance to this issue. But still would be great to get this merged :)


I am having similar problems with janiczek/elm-markov (0.17). Was thinking it's because of me butchering up the publishing process a few versions back, but @eeue56 said he has a similar problem with elm-string-extra.

What I've seen is that it downloads the package alright but into a wrong folder:

$ ls elm-stuff/packages/elm-community/elm-list-extra/
1.0.0/

$ ls elm-stuff/packages/janiczek/elm-markov/
Janiczek-elm-markov-23a5cde/

Hope this helps.

EDIT: To be precise, my error is:

$ mkdir test-project
$ cd test-project
$ elm-package install janiczek/elm-markov --yes
Downloading elm-community/elm-list-extra
Downloading elm-lang/core
Downloading janiczek/elm-markov

Error: Could not download source code successfully.
evancz commented 8 years ago

@Janiczek, open a new issue. I'd like to delete these two comments to keep this issue focused.

evancz commented 8 years ago

I believe @eeue56 and I found a workable solution for this. It involves using exact constraints like mdgriffith/elm-style-animation-zero-sixteen": "1.0.1 <= v < 1.0.1" which I think all products should be doing anyway.

@eeue56, can say more about this. If I have misunderstood, can we open an issue that explains it more clearly.

JoeyEremondi commented 8 years ago

which I think all products should be doing anyway

Doesn't this defeat the whole purpose of enforced SemVer? Or am I misunderstanding?

Janiczek commented 8 years ago

@evancz done, #214

eeue56 commented 8 years ago

I gave @doppioslash the patched 0.16 which enabled these old packages to work, so this is closed as far as I'm concerned. Waiting for @rtfeldman so we can make npm binaries if needed, but so far nobody else has had this problem yet.

@JoeyEremondi (about semver) if in production the logic of something changes, then it's a patch release, but may break your site because your site relies on that logic. (this discussion probably should be elsewhere?)