entropic-dev / entropic

🦝 :package: a package registry for anything, but mostly javascript 🦝 🦝 🦝
https://discourse.entropic.dev/
Apache License 2.0
5.29k stars 151 forks source link

Package.toml versus package.toml (casing) #147

Open ravinggenius opened 5 years ago

ravinggenius commented 5 years ago

Is it possible to use the all-lowercase package.toml, or does the "p" need to be capitalized? The README spells it Package.toml in two places, even though it isn't at the beginning of the sentence. Was that intentional? Personally I'd prefer to keep it lowercase.

varjmes commented 5 years ago

I tried with package.toml and was successful. Although here https://github.com/entropic-dev/entropic/blob/f6e1ccf304a7b2d535b092ad86374ffccc243e5f/cli/lib/load-package-toml.js#L12 it asks for Package.toml in the code, I am using OSX which is case insensitive for files, like Windows.

If you'd like to try yourself, install ds and create and cd into a new folder.

ds login --registry "https://registry.entropic.dev"

package.toml

name = "yourusername@registry.entropic.dev/ent"
version = "1.0.0"

index.js

module.exports = () => {
  console.log('look at my awesome package :)')
}
ds publish
viktor-ku commented 5 years ago

I don't get capitalized P as well

zacanger commented 5 years ago

For consistency with the legacy node package manager, and not appearing higher up in ls results than things like README and CHANGES, I would also love it if we went with package.toml, lowercase.

toddself commented 5 years ago

P[tab] = Package.toml p[tab] = package.json

tab completion for the win!

zacanger commented 5 years ago

Except on Windows which doesn't know what case is, Macs which know what case is but just don't care about it, and anyone who's got set completion-ignore-case on in their inputrc.

toddself commented 5 years ago

yeah sorry that wasn't super helpful as a comment :)

zacanger commented 5 years ago

No worries, it's totally valid if you're on Linux or BSD (we should all just be on BSD, we'd be so much more hipster)

ceejbot commented 5 years ago

I believe Chris picked capital-P Package.toml because Rust uses capital-C Cargo.toml, and of course we're iterating on package.json.

If I let myself bikeshed this, my thoughts are:

But I think it's not the end of the world if it stays Package.toml.

chrisdickinson commented 5 years ago

P[tab] = Package.toml p[tab] = package.json

tab completion for the win!

I believe Chris picked capital-P Package.toml because Rust uses capital-C Cargo.toml, and of course we're iterating on package.json.

Both of these factored in. The potential for bugs when folks collaborate on entropic packages between case-sensitive and case-insensitive filesystems makes me wince a bit, though.

The tough bit, as you know, is that this decision simultaneously carries a lot of importance (it'll be the first introduction to Entropic for a lot of folks!) and not much importance at all (as soon as you know what it is, the name is pretty inconsequential, modulo <cringe>case sensitive filesystem bugs</cringe>.)

The decision kind of boils down to: should the file convey who the file is relevant to, or what the file does? I'm torn on this. Xargo.toml in Rust confused me when I first saw it, but it's Google-able. Entropic.toml would be similar – why is this repo configuring entropy? Package.toml is a bit overreaching, but we did say we want to be "the package manager for anything".

Anyway. I note, apropos of nothing, that hart.toml, for the unit of entropy, only has 298,000 results on Google.

zacanger commented 5 years ago

case sensitive filesystem bugs

I see this as case in-sensitive filesystem bugs 🤣

Anyway. I note, apropos of nothing, that hart.toml, for the unit of entropy, only has 298,000 results on Google.

7, if you use quotes, which maybe says more about Google than it does about possible package file names.

I don't have strong feelings either way, but I tend to like using lowercase everything just because it seems to lead to less issues, especially if folks are working on multiple platforms and building and deploying on mostly Linux.

olingern commented 5 years ago

There's also precedent with Ruby's Gemfile. I think capitalization is negligible. Naming it something entirely different actually sounds better. I think a lot of people are going to share the sentiment of this thread and think, this is not the Javascript package manager that I know. I saw / see a lot of that when working on Yarn.

The tough bit, as you know, is that this decision simultaneously carries a lot of importance (it'll be the first introduction to Entropic for a lot of folks!) and not much importance at all (as soon as you know what it is, the name is pretty inconsequential, modulo case sensitive filesystem bugs.)

The name is subtle, but I think using Entropic.toml or hart.toml says "Hey, we're not trying to be npm" pretty strongly. So, I would actually +1 an entirely different ( and searchable! ) name.

ravinggenius commented 5 years ago

I'm from the Ruby community, and I've never been particularly fond of Gemfile. (I believe it was a nod to Rakefile, which was itself a nod to Makefile.) At least Package.toml has a file extension....

Anyway my vote is for whatever-you-want-just-lowercase-please-thank-you.toml.

joshyrobot commented 5 years ago

I don't think hart.toml is a very good idea. It just adds more foreign terms to the mix, which would only hinder adoption.

viktor-ku commented 5 years ago

hart.toml is way off. Config files should be called after whats using them.

enykeev commented 5 years ago

:heart:.toml

I'm sorry, I'll let myself out.

aslilac commented 5 years ago

I really like the clarity that "Entropic.toml" conveys. "Package.toml" feels vaguely like it might just be a new package file format the npm added support for. Changing the name completely makes it feel much more intentional.

As another note, Cargo (the package manager for Rust) uses "Cargo.toml" as its package file name, and I think the consistency between Cargo and Entropic would be pretty cool as someone who often uses Rust and Node together.

zacanger commented 5 years ago

@partheseas there's been a lot of work on https://github.com/entropic-dev/entropic/pull/189 and discussion over on Discourse about what the file should be called, and I think the general mood is that yeah, calling it something more specific than Package would be a good idea. I think folks are still split on the casing, though.

schtauffen commented 5 years ago

Entropic.toml seems to be the most clear representation. I have always felt it was weird that npm uses package.json

Upper case characters should never be required for names because depending on your filesystem there is no difference (for this reason any project with more than a couple developers should also use only lower case filenames, IMHO). It is fine if capital E is the convention as long as lowercase works fine.