yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.43k stars 2.72k forks source link

Documentation: For which programming languages is yarn? #1291

Closed hediet closed 7 years ago

hediet commented 7 years ago

The documentation at https://yarnpkg.com/en/docs/getting-started reads:

Yarn is a package manager for your code. It allows you to use and share code with other developers from around the world. Yarn does this quickly, securely, and reliably so you don’t ever have to worry.

Yarn allows you to use other developers’ solutions to different problems, making it easier for you to develop your software. If you have problems, you can report issues or contribute back, and when the problem is fixed, you can use Yarn to keep it all up to date.

Code is shared through something called a package (sometimes referred to as a module). A package contains all the code being shared as well as a package.json file which describes the package.

But I didn't find any single hint in the whole documentation which programming languages are supported by yarn - this is very, very sad, especially for an project of this size. Am I right that yarn only supports js and uses the existing npm package infrastructure? (Ok, I just found the blog now that finally clarifies that it is an javascript package manager - but such crucial information should not be hidden solely in a blog!)

For non-js people who stumbled upon this repository on github and read all the advantages of this package manager, such missing details are a complete waste of their time. Such things make me raging - it's like advertising an awesome product but not mentioning that it only runs on e.g. FreeNOS (never heard of this OS? Me too!). Or like selling tickets to a indoor swimming pool without mentioning that there is no water at all.

Please fix that!

simonbuchan commented 7 years ago

As a replacement for npm, yarn is very focused on javascript, but it also inherits people's (ab)use of the npm repository for non-javascript content, though it's mostly used for HTML and CSS and node bindings to C++

In theory you could use it for anything you don't mind being put into a node_modules directory.

gsklee commented 7 years ago

@bestander close

I'd say Yarn is an "npm-package" manager; it manages whatever the npm registry would accept as valid packages.

hediet commented 7 years ago

The front page still does not say that. And just saying 'Yarn is an "npm-package"' is not really helpful if you didn't use npm before.

gsklee commented 7 years ago

@hediet That probably means most people are adequately okay with the current wording. In that case I'd suggest you submit a PR directly to further specify the wordings you're looking to change in order to facilitate further improvement, otherwise it'll be difficult to anticipate real impact with only discussions here.

bestander commented 7 years ago

npm registry is more than just JavaScript and Yarn works primarily with npm but it also can work with Github hosted packages. I think the current broad definition is not confusing but rather removing the limits for what it can be used.

hediet commented 7 years ago

So yarn is intended to be an php package manager?

bestander commented 7 years ago

Any reasons for not to be?

hediet commented 7 years ago

Yeah, php's namespace structure is completely incompatible with how yarn manages dependencies. In php, you need a proper constraint solver, since packages can be installed at most once (even if they have different versions). I am sure that other languages have similar restrictions.

wolf99 commented 4 years ago

So this is still a problem 3 years later. Just stumbled on the Yarn website and spent a while looking through the pages to see what languages it supports or what language even is expected and used for the code snippets (e.g. when mentioning require... require what, who, when, from where? 🙄 )

While I can now see from the above discussion that, theoretically, it can be used for other languages, the fact that it is not mentioned up front that a user would at least have to know JS to be able to use it for those other languages, is pretty boneheaded.

bitdancer commented 1 year ago

Count me as another interested party sad to discover that yarn was focused on javascript but that fact wasn't mentioned in any of the docs I spent a half hour perusing. It doesn't really matter that it can theoretically be used for other languages if in practice no one is doing that. And if the core is indeed npm, then it should say that fairly prominently too, because that might actually be useful to me at some point :)