gleam-lang/gleam

Compiler should refuse to publish a package that uses a dev-dependency in its source

Open

#3.143 geöffnet am 16. Mai 2024

Auf GitHub ansehen
 (10 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (960 Forks)batch import
good first issuehelp wanted

Repository-Metriken

Stars
 (21.417 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 10T 19h) (69 gemergte PRs in 30 T)

Beschreibung

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!

Contributor Guide