Closed ellispritchard closed 7 years ago
Same here. Works fine from the Github repo so I suspect @josevalim might have uploaded the wrong thing?
Yup, the version on Hex is missing the formatters/
directory (in what follows, deps/
is the dependencies directory of a project I'm testing this on and ../ex_doc
is a clone of the GitHub repo):
$ diff deps/ex_doc/ ../ex_doc/ -qr --strip-trailing-cr
Only in ../ex_doc/: .ebert.yml
Only in ../ex_doc/: .eslintrc
Only in deps/ex_doc/: .fetch
Only in ../ex_doc/: .git
Only in ../ex_doc/: .gitattributes
Only in ../ex_doc/: .gitignore
Only in deps/ex_doc/: .hex
Only in ../ex_doc/: .travis.yml
Only in ../ex_doc/: _build
Only in ../ex_doc/: assets
Only in ../ex_doc/: bin
Only in ../ex_doc/: deps
Only in ../ex_doc/: doc
Only in ../ex_doc/: formatters
Only in ../ex_doc/: gulpfile.js
Only in ../ex_doc/: mix.lock
Only in ../ex_doc/: package.json
Only in ../ex_doc/: test
Only in ../ex_doc/: yarn.lock
I don't know exactly what is the publishing procedure used by the ExDoc team, but I think that the formatter/
directory is automatically generated by a node script. Is it possible that what's been published is a version in which the formatter/
directory hasn't been generated?
Yup, my bad. I will be home in a couple hours and publish a new version. --
José Valimwww.plataformatec.com.br http://www.plataformatec.com.br/Founder and Director of R&D
@josevalim I don't know if you've identified the problem yet, but it's not what I've said above. Between 0.17 and 0.18 you've moved the assets to the formatter/
directory. That directory isn't included in the :files
options of the Hex package, which by default includes the priv/
directory, but not the formatters
directory you've added.
I had no idea this :files
keyword even existed, as everything I've used is included in the default included files and directories and this should definitely serve as a warning for package owners. This is a kind of problem that's only visible when you publish the package to Hex and test the downloaded version. After your own advice of moving :ex_doc_makeup
's assets away from priv/
, my (unreleased) package also has this problem, which of course I've never noticed because I've never downloaded it from Hex xD
Yup! We just need to add formatter to :files and we should be good to go! --
José Valimwww.plataformatec.com.br http://www.plataformatec.com.br/Founder and Director of R&D
@tmbb :files
is documented here btw https://hex.pm/docs/publish It states:
A list of files and directories to include in the package. Has to include mix.exs. Defaults to standard project directories, so you usually don't need to set this property.
It is commonly used for publishing Erlang packages since the rebar.config
file is usually required. You can see the defaults here https://github.com/hexpm/hex/blob/1561609f8a4e7d508ceec0bfcf70074f3c05de09/lib/mix/tasks/hex.publish.ex#L76:L78
Defaults to `["lib", "priv", "mix.exs", "README*", "readme*", "LICENSE*", "license*", "CHANGELOG*", "changelog*", "src"]`.
I know, I've read it now :) Everything has been working quite magically, so I've never worried about it. It's definitely my fault for not having read the manual in full, but I think this is is a pretty serious problem.
These kinds of bugs don't show up in testing, because testing uses the local package, and apparently it happens to the best (I assume José has read the manual). I'll open an issue on Hex to discuss this.
0.18.1 is out!
Works fine in 0.17.1:
Breaks in 0.18.0:
Config, see: https://github.com/Financial-Times/tapper_plug/blob/master/mix.exs
😢