#Why does gleam_packages's codegen live in test/ dir?
1 messages · Page 1 of 1 (latest)
Probably so it won't ship with the package if it's used as a dep or downloaded from hex, etc.
Where else would it go?
Not sure, just was expecting test to be only test related.
But this makes sense
So are dev tools/scripts usually placed in test/. In fact are most gleam scripts that get run with gleam run -m <file> placed in test/ usually? Is that the convention?
Anything that isn't needed as part of a public api or shouldn't be distributed with the package. It's the only place to put it where Gleam will run it.
So yeah, dev-related gleam run -m-ables would tend to go there if you're not sharing them.
handbook.gleam goes there for my upcoming task runner too.
Which is a collection of tasks for your project.
I feel like a separate dev directory would be nice
test is a bit of a misnomer when used in this way, but the dir also exists by convention, I suspect.
yeah, well we're stuck with test now 
I guess you could also always do a subdirectory in test too to make things clear
Except for ffi, yeah (for now).
Hmmm I like the test/dev/ dir idea!
Thanks for clearing this up guys!
I wonder if dev is a better name than test
More generalized.
yeah
Without further knowledge, it actually feels "wrong" to put anything other than tests in the test dir, like you're breaking the rules and may at some point face consequences
Would that be considered a breaking change?
test was the last place I looked, after checking deps, devDeps and also reading thru some of the used package hex pages for info
I assumed the test/codegen.gleam which did come up on a grep, was a test for the codegen... I then moved/renamed the file to realize gleam run checks src & test.
We wouldn't do it in a breaking way, nah
So you'd keep add dev and keep test as an alias?
Interesting, thx for the insight!
I love this, but I'm sure it will be tested as time goes forwards.
test/no_breaking_changes.gleam
iirc go has a similar commitment, but gets harder as "bugs" are fixed in the language. E.g. when go fixed something to do with iterators and people got upset
Specifically Go 1.23 Iterators
Which was a "breaking change" but got thru because it was a "bug" that often lead to confusion to newcomers
Our solution: don't add iterators 😎