elm-lang / elm-package Goto Github PK
View Code? Open in Web Editor NEWCommand line tool to share Elm libraries
License: BSD 3-Clause "New" or "Revised" License
Command line tool to share Elm libraries
License: BSD 3-Clause "New" or "Revised" License
elm/compiler
When trying to install a new package from Github, elm-get does not check for HTTP_PROXY and HTTPS_PROXY env vars, meaning that it won't hit the proxy but will try and fail to fetch url directly.
I just accidentally pushed the wrong version of deadfoxygrandpa/Elm-Test
which didn't even have an elm-package.json file in it. I think elm-package
should have prevented this.
A new version of optparse-applicative has been released so we should update to use the new version for the next release probably: http://hackage.haskell.org/package/optparse-applicative-0.10.0 .
The changelog indicates that it will break our code: https://github.com/pcapriotti/optparse-applicative/blob/master/CHANGELOG.md .
I'll probably sort this out tonight.
If you ask elm-package to install a package for you that doesn't exist, it gives you the following error:
Error: No versions of package 'wronguser/core' were found!
Is it spelled correctly? If so, try running the following command to download
the latest package listing to your computer:
elm-package update
After that, try installing again.
If I then run elm-package update
, we get this error:
Invalid argument `update`
I'm guessing this is a leftover bug from elm-get.
Right now, 'elm-package install' gives no output after listing the packages that will be installed. It would be nice to see some progress indicator - maybe a "Package X installed" after each page.
I just had this fail to install properly for me so I'm working on upper/lower bounds now. I just have a couple questions:
Hi all
I built Elm 0.14.1 from sources on my Mac (with OSX 10.9.5). I hadn't issues. Then I tried to install elm-core and I see:
mac:src user$ elm-package install elm-lang/core 1.1.0
Some new packages are needed. Here is the upgrade plan.
Install:
elm-lang/core 1.1.0
Do you approve of this plan? (y/n) y
Downloading elm-lang/core
Error: <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'unsafe-inline'; img-src data:; connect-src 'self'">
<title>Page not found · GitHub</title>
...
I removed elm-stuff and elm-package.json, I tried to rebuild Elm 0.14.1, I tried to install elm-lang/core 1.0.0, but I still has this error. As I remember, a month ago I used Elm 0.14 without problems (I also built it from sources).
Your documentation says you should use git to tag your versions for installs and publishes to work.
Having an elm-get version
command will make manually keeping your git tags in sync with the information in the dependencies.json a lot easier.
Basically the command should create a commit with the version name and a tag for you.
You can also implement elm-get version patch/minor/major
to update the dependencies.json with a new version, create a commit & a tag.
See npm version
Steps to reproduce
markdown
markdown
linkWhat should happen
a) Markdown does not show up, there are no results
b) Markdown shows up and there is documentation on the function/syntax
What may be happening
@evancz tells me that it is searching through private functions as well as public ones. So any function that matches the query will show up even if it is private.
Why this is bad
Resolving dependencies...
Configuring elm-package-0.2.1...
Building elm-package-0.2.1...
Preprocessing library elm-package-0.2.1...
In-place registering elm-package-0.2.1...
Preprocessing executable 'elm-package' for elm-package-0.2.1...
Preprocessing test suite 'unit-test' for elm-package-0.2.1...
tests/SolverTests.hs:10:18:
Could not find module ‘Utils.ResolveDeps’
Use -v to see a list of the files searched for.
tests/SolverTests.hs:13:18:
Could not find module ‘Elm.Internal.Constraint’
Use -v to see a list of the files searched for.
tests/SolverTests.hs:14:18:
Could not find module ‘Elm.Internal.Version’
Use -v to see a list of the files searched for.
tests/SolverTests.hs:15:18:
Could not find module ‘Elm.Internal.Name’
Use -v to see a list of the files searched for.
tests/Tests.hs:6:8:
Could not find module ‘ComparisonTests’
Use -v to see a list of the files searched for.
The public release of elm-get-0.1.1
can't be built as http-client
moved to 0.3.*
about two weeks ago.
I just renamed a function in my signal-extra
package version 2.3.1
. Then I used elm-package bump
and went to version 3.0.0
. Then I committed my changes, tagged the commit, pushed both the commit and the tag. Business as usual.
But now I get this:
$ elm-package publish
Verifying Apanatshka/elm-signal-extra 3.0.0 ...
Error: The version listed in elm-package.json is neither a previously
published version, nor a valid version bump.
Set the version number in elm-package.json to the released version
that you are improving upon. If you are working on the latest API, that means
you are modifying version 1.0.0.
From there, we can compute which version comes next based on the API changes
when you run the following command.
elm-package bump
I tried elm-package bump
, which gives an "error: unpublished" as expected:
Error: To bump you must start with an already published version number in
elm-package.json, giving us a starting point to bump from.
The version numbers that can be bumped include the following subset of
published versions:
1.0.0, 1.0.0, 2.3.1, 1.0.0, 2.0.1, 2.1.2, 2.2.0, 2.3.1
Switch back to one of these versions before running 'elm-package bump'
again.
When I change the elm-package.json
version number back to 2.3.1
and try elm-package bump
again, it tells me there's a MAJOR change and proposes 3.0.0
again.
If given an HTTPS GitHub address, as opposed to an HTTP address the error message given acts as if the address is not related to GH at all. The relevant code is Model/Dependencies.hs
, function repoToName
.
Writing out elm_dependencies.json files yourself is a pain and it's tedious to find all of the fields you're supposed to use.
It would be nice to have a feature like cabal init
with which you interactively create an elm_dependencies.json file.
Getting help information currently says that elm-get install
and elm-get update
are valid commands, but running elm-get install
you get the error Requires at least 1 arguments, got 0
and running elm-get update
gets you Not Implemented Yet!
.
What are these supposed to do? It would be VERY nice if the first command compiled everything in exposed-modules
. I guess the 2nd should just update everything from dependencies
?
Is there a way to unpublish repositories after you've published them? For instance I published Lazy as Elm-Lazy since that's what the name was on my github, but it's a bit redundant for an Elm library. Is there/should there be a way to unpublish a library or is this better left to manual intervention?
This is only my best guess at diagnosing the issue I'm running into, but given the circumstances I think it's quite likely to be the case!
My username is rehno-lindeque
and I'm trying to publish a package that is hosted by my organization circuithub
. I have carefully followed all of the steps in the README, including pushing my 1.0.0
tag to github.
$ elm-package publish
Verifying circuithub/elm-package 1.0.0 ...
This package has never been published before. Here's how things work:
* Versions all have exactly three parts: MAJOR.MINOR.PATCH
* All packages start with initial version 1.0.0
* Versions are incremented based on how the API changes:
PATCH - the API is the same, no risk of breaking code
MINOR - values have been added, existing values are unchanged
MAJOR - existing values have been changed or removed
* I will bump versions for you, automatically enforcing these rules
The version number in elm-package.json is correct so you are all set!
Error: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
I'm messing around to see if I can break elm-get
.
Here's a way:
elm_dependencies.json
file.elm-get publish
The result is: elm-get: docs: getDirectoryContents: does not exist (No such file or directory)
. I would prefer a more graceful error message, but it's not a big deal.
I found that you wrote the following to the mailing list. You should put it on the website as well:
Installing libraries:
You talk to it with elm-get, which you install like this. To install something from the catalog, you run something like this:
elm-get install jcollard/generator
elm-get install jcollard/generator 0.1
That will install the library in elm_dependencies/jcollard/generator/0.1/ but doesn't build anything yet. To use it now you'd do something like this:
elm --make --src-dir=elm_dependencies/jcollard/generator/0.1/ MyFile.elm
Next on my list is to start integrating this with the compiler so that it will know to look in elm_dependencies/ automatically, probably based on your elm_dependencies.json file.
Publishing libraries:
You can also publish to the Public Library. First you need to make an elm_dependencies.json file. Then you can run:
elm-get publish
Which will do some checks to make sure everything is okay and then push it to the public library. If you get any weird or confusing error messages in this process, please let me know by opening an issue that describes the error message and why it was confusing to you.
Right now I can make a local clone of your repository rainbow-palette, make changes, bump the version number and publish the changes. Allowing this can lead to pranks like renaming Forest.accent0 to lol, or worse.
Have you thought of doing some kind of check?
The README is a little scarce compared to the website.
Maybe add links to the website and various pages on the website in the README. Maybe a further reading section.
on the Documentation page, several links point to /catalog/evancz-Elm/0.10.1/
, which gives a 404. Links to the Maybe and Either library implementations point to https://github.com/evancz/Elm/blob/master/libraries/
rather than the repo in the elm-lang org.
Hi,
I'm new to elm. I wanted to know why elm & elm-package were designed in a way, where all packages are installed locally (which is good) but in a flat structure, and of course - are there any plans on evolving it?.
For example,
johnpmayer/elm-webgl 1.0.1
depends on johnpmayer/elm-linear-algebra 2.x
elm-lang.org stable
depends on johnpmayer/elm-webgl 1.x
, johnpmayer/elm-linear-algebra 1.x
Try to elm-package install
elm-lang.org stable
and you'll get:
Error: Unable to find a set of packages that will work with your constraints.
I guess that from the compiler point-of-view it's much easier to implement this mechanism, but when the 'eco-system' will grow it will happen much frequently, and it will be unpleasant. I have to say it worries me, as someone who is considering using elm-lang. I'm coming from node, where npm really does a good job in managing dependencies.
As I said, I'm new to elm, so there's a chance I misunderstood how packages work 😄
FileReader
module, in short, makes it possible to read in a file passed by user.
The module introduces:
File
s and Blob
sElement
with a capability to open file selection dialog on clickFileReader
If you have any questions about implementation details you can ask them here or mail the creator directly
Sorry if this is a silly question -- new here. Not sure I understand the distinction between the two sites, except that library.elm-lang.org appears to have out-of-date package information.
On Windows 7, running elm-get install [some library]
will occasionally (rarely) fail with an MoveFileEx error (permission is denied). The error will appear something like this:
>elm-get install timthelion/elm-inputgroups
Cloning repo timthelion/elm-inputgroups
elm-get: elm-inputgroups: MoveFileEx "elm-inputgroups" "timthelion-elm-inputgroups": permission denied (Access is denied.)
You must manually delete the newly created directory then run the command again and it will usually work.
I'm pretty sure it's related to this issue: http://social.msdn.microsoft.com/Forums/vstudio/en-US/efe2b58b-fe2f-470b-9e46-c5bf73d35a65/movefileex-fails-with-access-denied-on-windows-7?forum=vcgeneral which would mean there's probably nothing we can do to fix it, but it would probably be possible to improve the user experience a bit if it does happen to fail. Maybe automatically retrying or something, but at least deleting the directory automatically so immediately trying to run the command again doesn't lead to this:
>elm-get install timthelion/elm-inputgroups
Cloning repo timthelion/elm-inputgroups
Error: failure when running: git clone --progress https://github.com/timthelion/elm-inputgroups.git
fatal: destination path 'elm-inputgroups' already exists and is not an empty directory.
As described in http://semver.org
Of course, part of the responsibility is given to the authors, but the current instructions are quite similar to the standard (but not the standard - for example, packages start from 1.0.0)
http://packdeps.haskellers.com/feed?needle=exact%3Aelm-get
says there are newer versions of the following packages
http-client 0.4.0.1
optparse-applicative 0.11.0.1
npm has an issue where "large companies" cant use modules because they forgot to include a licence.
This could be solved by either making it required for publishing or by defaulting the licence if one doesnt exist.
When you elm-get install
a library, you will always be prompted with a question for whether or not you want to add the file to your elm_dependencies.json
, even if you already have it there!
An example of the interaction:
$ elm-get install automaton
Cloning repo evancz/automaton
Checking out version 0.1.0.1
Should I add this library to your elm_dependencies.json file? (y/n): y
evancz/automaton 0.1.0.1 is already in elm_dependencies.json.
Do you want to replace it with version 0.1.0.1? (y/n): y
Success!
Ideally this should not ask to add if you already have it listed with the dependency you've requested, but it should ask to update if you have an earlier version.
Right now it's only possible to depend on packages via package.elm-lang.org
without manual copying into the elm-stuff
folder. This means there's no way to test against unreleased versions of dependencies, one of the most common use cases for library writers. For instance I'm trying to write a new version of IO
but it relies on a change in a new version of elm-lang/core
that is currently unreleased so I need to manually cp the packages to do it.
A nice feature would be to have (in elm-stuff
) a file local-dependencies.json
that would include paths to directories that have elm-package
packages in them and when installing a package they would be checked before trying to install from the central repository.
Furthermore, I think having the central repo be the only way to depend on a library is a bad idea. If we could depend on arbitrary git:// repos that had elm packages in them it would be much easier to install packages and we wouldn't have to depend on a central repository that may go down or be outdated.
As you can see here: http://library.elm-lang.org/catalog a lot of libraries are getting names that have Elm
in them because people often put that in the name of their GitHub repos. This is pretty redundant but the only way to fix it is to change the name of your GitHub repo.
Instead of forcing people to change the names of their repos in order to get nice library names, how about just adding a name
field to elm_dependencies that will serve as the public name of the library?
elm-get doesn't seem to be able to find tags that are not in the catalog even if they exist on github.
In an empty directory on Ubuntu 14.04 x86_64:
elm-get install jcollard/Playground 0.2.3.2
Produces:
Your project does not have a elm_dependencies.json file, which the Elm
compiler needs to detect dependencies. Should I create it? (y/n): y
Cloning repo jcollard/Playground
Error: could not find version 0.2.3.2 on github.
I tried depending on elm-lang/core 1.1.0
without realizing it hadn't been uploaded yet.
Run these commands in any directory with depdency "elm-lang/core": "1.1.0 <= v < 2.0.0"
:
Running elm-make
I get the error
Packages configured successfully!
your elm-package.json file says you depend on package elm-lang/core,
but it looks like it is not properly installed. Try running 'elm-package install'.
Running elm-package install
or elm-package install elm-lang/core 1.1.0
I get
Packages configured successfully!
but nothing has changed, running elm-make
gives the same message.
Seems like it should say version does not exist.
The server and remover call ghc directly so they aren't compatible with cabal sandboxes. I was working on adding elm-get docs
when I realized I had broken the server code and I have to go through a lot to compile/test the server.
Making these scripts executables in elm-get.cabal would greatly improve this. I don't want to make the change myself since I assume this is how you deploy the website so I'm sure you want to manage this yourself.
node regrets not breaking out their core modules into npm itself. Mainly so that they can be versioned independently of node and can be iterated on more quickly.
One good candidate might be WebSocket. This should also force you to show how to have an elm module that contains both js & elm as that will be needed at some point.
I don't know much about Cabal but I don't see any dependencies to a version of the Elm project in which elm-doc is created... Shouldn't there be a dependency if elm-get
is going to call elm-doc
?
I have a package currently in 1.3.0 which I wanted to update. Most of the changes were purely additive except one function which was moved to another module (considered Major). So, elm-package bump set the package version to 2.0.0. I then tried to publish my package but elm-package claimed that my package only had "Minor" changes compared to 1.0.0. elm-package should've compared my code to the latest version (1.3.0) not to 1.0.0.
Here is what happened when I tried publishing at first (I tried first to go from 1.3.0 to 1.4.0):
Hassans-MBP:CoreExtensions hassanhayat$ elm-package publish
Verifying TheSeamau5/CoreExtensions 1.4.0 ...
Error: It looks like you are trying to bump from version 1.3.0 to 1.4.0.
This implies you are making a MINOR change, but when we compare
the 1.3.0 API to the API you have now it seems that it should
really be a MAJOR change (2.0.0).
Run the following command to see the API diff we are working from:
elm-package diff 1.3.0
The easiest way to bump versions is to let us do it automatically. If you set
the version number in elm-package.json to the released version
that you are improving upon, we will compute which version should come next
when you run:
elm-package bump
Hassans-MBP:CoreExtensions hassanhayat$ elm-package diff 1.3.0
Comparing TheSeamau5/CoreExtensions 1.3.0 to local changes...
This is a MAJOR change.
------ Added modules - MINOR ------
CoreExtensions.Basics
------ Changes to module CoreExtensions.Array - MAJOR ------
Removed:
sneakyCompose : (a -> b) -> (b -> b -> Order) -> a -> a -> Order
elm-package recognizes the "Major" change and tries to bump to 2.0.0. So, this what happens if I actually bump to 2.0.0
Hassans-MBP:CoreExtensions hassanhayat$ elm-package publish
Verifying TheSeamau5/CoreExtensions 2.0.0 ...
Error: It looks like you are trying to bump from version 1.0.0 to 2.0.0.
This implies you are making a MAJOR change, but when we compare
the 1.0.0 API to the API you have now it seems that it should
really be a MINOR change (1.1.0).
Run the following command to see the API diff we are working from:
elm-package diff 1.0.0
The easiest way to bump versions is to let us do it automatically. If you set
the version number in elm-package.json to the released version
that you are improving upon, we will compute which version should come next
when you run:
elm-package bump
Hassans-MBP:CoreExtensions hassanhayat$ elm-package diff 1.0.0
Comparing TheSeamau5/CoreExtensions 1.0.0 to local changes...
This is a MINOR change.
------ Added modules - MINOR ------
CoreExtensions.Basics
------ Changes to module CoreExtensions.Array - MINOR ------
Added:
foldlSafe : (a -> a -> a) -> Array a -> Maybe a
foldrSafe : (a -> a -> a) -> Array a -> Maybe a
head : Array a -> Maybe a
isEmpty : Array a -> Bool
maximum : Array comparable -> Maybe comparable
minimum : Array comparable -> Maybe comparable
product : Array number -> number
sort : Array comparable -> Array comparable
sortBy : (a -> comparable) -> Array a -> Array a
sortWith : (a -> a -> Order) -> Array a -> Array a
sum : Array number -> number
tail : Array a -> Array a
unzip : Array (a, b) -> (Array a, Array b)
unzip3 : Array (a, b, c) -> (Array a, Array b, Array c)
unzip4 : Array (a, b, c, d) -> (Array a, Array b, Array c, Array d)
unzip5 : Array (a, b, c, d, e) -> (Array a, Array b, Array c, Array d, Array e)
zip : Array a -> Array b -> Array (a, b)
zip3 : Array a -> Array b -> Array c -> Array (a, b, c)
zip4 : Array a -> Array b -> Array c -> Array d -> Array (a, b, c, d)
zip5 : Array a -> Array b -> Array c -> Array d -> Array e -> Array (a, b, c, d, e)
It sees this as a "Minor" change compared to 1.0.0 (which it is, but the latest version is 1.3.0 not 1.0.0).
I'm rewriting the Install code to have a better interaction and less duplicate code, but I've run into a problem using the Deps
type here: http://hackage.haskell.org/package/Elm-0.12/docs/Elm-Internal-Dependencies.html
It has a mandatory name
field, but that field is NOT mandatory in an elm_dependencies.json file. This means you can't use Aeson's encode/decode to deal with elm_dependencies.json files because it will parse error on valid files. This is also really annoying because it means we have to reimplement any functions to manipulate JSON that are implemented on the Deps
type.
@evancz What is the name
field used for? Can it be removed? Should it be made a Maybe
field?
http://library.elm-lang.org/catalog/elm-lang-Elm/0.12.3/Color#linear, the 'this example' link 404s.
I created a small elm project named elm-get-hacker and uploaded it to github. I then published it with elm get. This project is intended to test elm-gets ability to sanitize it's input. The elm-get followed to sanitize the following things:
https://github.com/timthelion/elm-get-hacker/blob/master/elm_dependencies.json#L4
The description field is cut off visually after the <script> tag. However, the <script> tag is present in the resulting html see line 64 of this page: http://library.elm-lang.org/catalog/timthelion-elm-get-hacker/0.1/
Something in this file is causing the runtime to crash: https://github.com/timthelion/elm-get-hacker/blob/master/Hacker.elm
Resulting in this output: http://library.elm-lang.org/catalog/timthelion-elm-get-hacker/0.1/Hacker
Furthermore, I tried the following at GHCI:
*Get.Registry Utils.Model.Name Utils.Model.Version> runErrorT $ register (Name {Utils.Model.Name.user="evancz",project="Elm"}) (V [0,10] "") "docs.json"
with blank "docs.json" and "elm_dependencies.json" files. The first time I tried it, I got the responce:
Left "Policy disallowed upload of file "Paths_elm_get.hs" with content-type "text/plain"Files docs.json and elm_dependencies.json were not uploaded."
The second time I tried it I got the response:
Left "Version 0.10 has already been registered."
This indicates that something was registered, and thus this might be an avenue for a DOS attack, or simply cruft building up in your database. When I look at http://library.elm-lang.org/catalog there is no Elm library listed, so the risk of cruft build up is quite real.
I'm not sure if this is a new feature or not. Is there a way to build all of the docs to see what the site will look like when it gets published to library.elm-lang.org? I've messed up docs a few times but I didn't know how to see what they would look like until I publish, at which point I can fix and repush.
I'm imagining a feature where I could run elm-get docs
in my project and get a directory called docs
or something that has the pages generated for the website.
https://github.com/youpy/elm-midi
This library provides function for working with MIDI using Web MIDI API.
It currently supports receiving MIDI messages from MIDI inputs.
We're trying to figure out how to use a fork of elm-core
. One idea I had was to do something like this
$ mv elm-stuff/packages/elm-lang/core/1.1.0/ elm-stuff/packages/elm-lang/core/1.1.99/
$ subl elm-stuff/exact-dependencies.json # bump core to 1.1.99
$ elm-make ... # works ok
Compiled 83 files
$ elm-package install # doesn't work ok
Some new packages are needed. Here is the upgrade plan.
Remove:
circuithub/elm-function-extra
circuithub/elm-json-extra
elm-lang/core
evancz/elm-html
evancz/local-channel
evancz/virtual-dom
Do you approve of this plan? (y/n)
The only problematic thing is having elm-package install
insist on deleting packages... I wonder if it would be ok to ignore packages with a version number greater than what is published? This seems like the tiniest (perhaps temporary) fix I can think of for doing this.
If your project uses functions List.map and List.foldl, the maximal dependency range would be all versions of List where the types of map and foldl are unchanged. Unfortunately, the meaning of a function may change even if its type does not, so this is an estimate at best. Pairing this strategy with the test suite for a library could further trim things down.
Just because the tests and the signatures still match doesn't mean that it won't introduce subtle bugs.
Being too aggressive in sharing can cause bugs that are very hard to identify. Especially if the dependencies tree becomes a deep balanced tree.
Currently I can't give someone the url for any of my libraries, only a particular version. This means that if someone shares a link to my library and I release a new version, the link will still point to the old version.
For example, going to http://library.elm-lang.org/catalog/maxsnew-Generic/ takes you to a list of versions for that package. I can then select http://library.elm-lang.org/catalog/maxsnew-Generic/0.2.1/ but clicking on the other versions there's no indication that you're looking at an old version.
Some ideas:
This problem does not occur in 0.12.3, only in the master branch. It complains "Error: key "aliases" not present". Seems related to this line
The NPM and node community used to have a field called
{
"engines": { "node": "0.6.x" }
}
A lot of modules on npm said they only worked on 0.6 but also worked on 0.8 and 0.10. However npm used to not allow you to install modules whose engines field did not match your current node version.
This caused great friction, since module authors didn't maintain their modules actively enough and people using odd versions of node (0.7, 0.9, the beta versions) couldn't install them either.
The engines field in npm now warns if you install a module that doesnt match your node version. npm does have an engineStrict
flag that allows module authors to enforce the node version match strictly
Reference:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.