gleam-lang/gleam
View on GitHubCompiler should refuse to publish a package that uses a dev-dependency in its source
Open
#3,143 opened on May 16, 2024
good first issuehelp wanted
Description
I mistakenly published a package including modules that import dev-dependencies, as I didn't know I had to put them under the /test directory.
During publishing I got these warnings
warning: Transitive dependency imported
┌─ /Users/jonas/Projects/chrobot/src/chrobot/internal/download_protocol.gleam:9:1
│
9 │ import gleam/http/request
│ ^^^^^^^^^^^^^^^^^^^^^^^^^
The module `gleam/http/request` is being imported, but `gleam_http`, the
package it belongs to, is not a direct dependency of your package.
In a future version of Gleam this may become a compile error.
Run this command to add it to your dependencies:
gleam add gleam_http
warning: Transitive dependency imported
┌─ /Users/jonas/Projects/chrobot/src/chrobot/internal/download_protocol.gleam:10:1
│
10 │ import gleam/httpc
│ ^^^^^^^^^^^^^^^^^^
The module `gleam/httpc` is being imported, but `gleam_httpc`, the package
it belongs to, is not a direct dependency of your package.
In a future version of Gleam this may become a compile error.
Run this command to add it to your dependencies:
gleam add gleam_httpc
But the package was published regardless.
According to @hayleigh-dot-dev on discord:
can you open an issue on the compiler repo. i think the compiler should refuse to publish a package that uses a dev-dependency in its source!