chancejs / chancejs

Chance - Random generator helper for JavaScript
http://chancejs.com
MIT License
6.45k stars 455 forks source link

[ecosystem] Mixin repo #240

Open leesei opened 8 years ago

leesei commented 8 years ago

Mixin is a great feature for extending Chance, the community sometimes recommend mixins upon a feature request.

https://github.com/victorquinn/chancejs/issues/82#issuecomment-76716159 https://github.com/victorquinn/chancejs/issues/133 https://github.com/victorquinn/chancejs/issues/154 https://github.com/victorquinn/chancejs/issues/219 https://github.com/victorquinn/chancejs/issues/223

I think if a repository for mixin exists, users can browse and learn how to use Chance. It can also be a testground to see what should be incorporated in the mainstream Chance library.


As a side note, I think some of the Chance API can be modularized as external modules and added as mixins. This can keep the Chance core compact and let the users require only what they need. Lodash is heading towards this path, see npm lodash-modularized and source. I think the dist library is built from these modules but haven't verified that.

I recommend creating Chance.js organization and maintain a bunch of official mixins there. I'll try to create some mixins as npm module to demostrate see how it looks.

leesei commented 8 years ago

Here's my chancejs-iso3166 repo. Please comment on the format of README and package.json. Browserified dist library for running in browser can also be created.

Not pushed to npm yet, install from the repo url ATM.

leesei commented 8 years ago

Found an old issue that is more or less suggesting the same thing.

Consider splitting across multiple packages / modules? · Issue #52 · victorquinn/chancejs

franciscop commented 8 years ago

I agree, maybe @victorquinn doesn't have much time anymore? It seems like this repo is unmaintained or in low maintenance mode. I wanted and could do it but received no response at all ( https://github.com/victorquinn/chancejs/issues/52#issuecomment-162206833 ).

Maybe setting up as an org and setting few volunteers would be a good idea, but that's completely up to @victorquinn. I saw a similar problem in brain some time ago (for probably completely different reasons).

victorquinn commented 8 years ago

Apologies, it's not that I don't have time, but I have been very busy to work so it tends to be in bursts (mostly on the weekends) unless I'm able to find down time during my workday.

Just 9 days ago I merged a bunch of PRs, updated docs, added some new tests and generators, and released 1.0.0.

I really hope no one thinks Chance is languishing...

That comment aside, I have no problem with transitioning over to an organization. Having more of an ecosystem and help maintaining some of these plugins and side bits would be totally rad. I've already kind of started with the Chance CLI which would be awesome to move to the Chance org.

I actually control https://github.com/chancejs (unfortunately chance is someone's username so that wasn't available)

However, I'd want to make sure I'm clear of the implications there and we don't break things out in the wild (aka things like bower which expect the repo at github.com/victorquinn/chancejs will deal with the redirect to github.com/chancejs/chancejs appropriately and so on). I suspect all would be fine but I just want to ensure that's the case before pulling the trigger.

Let me investigate over the next day or so and if all would be well (which it probably is) I'll make that change.

leesei commented 8 years ago

Thanks @victorquinn, looking forward to the launch of new org.

Question on naming: chancejs-<mixin> or chance-<mixin> This also applies to the keywords in package.json

victorquinn commented 8 years ago

Good question @leesei !

Unfortunately there's a bit of a disparity between then name for the repo (chancejs) and the name on npm (chance). I wanted to just get chance but that was taken.

I lean toward chancejs/chance-<mixin> for the repos and then as the library is chance-<mixin> since that's unlikely to have a namespace collision. This way the repo and the npm package can have the same name so things are less confusing (like the main library unfortunately).

There's also precedent here as that's how the express organization handles it.

I'm open to suggestions though if anyone thinks that's a bad idea!

leesei commented 8 years ago

I see the unfortunate confusion of the main Chance library. It's good to hear your view on that. I definitely lean towards prefixing the library and repos with chance-. Otherwise the names are too generic.

NPM does have scoped-packages but it confuses users and don't provide a consistent interface wrt bower/spm.

franciscop commented 8 years ago

@victorquinn I mean at the time I did that question on the thread since it went unanswered and a few more issues were also unanswered, I haven't checked recently. I apologize for the confussion

I think there are many packages that have a simple name on bower/npm then add the suffix -js or -css for github, since they are taken otherwise. For instance, in Ubuntu there's "node" and "nodejs" (which actually was confusing). But I think if it's clear in the docs there's no problem.

victorquinn commented 8 years ago

FYI the switch to the chancejs organization is done. If you have repos you'd like added to it (like your iso3166 one above), transfer it to the chancejs organization and I'll make you an admin for that repo.

leesei commented 8 years ago

Thanks, I'm glad to.

On Sat, Feb 27, 2016 at 12:21 AM, Victor Quinn notifications@github.com wrote:

FYI the switch to the chancejs organization is done. If you have repos you'd like added to it (like your iso3166 one above), transfer it to the chancejs organization and I'll make you an admin for that repo.

— Reply to this email directly or view it on GitHub https://github.com/chancejs/chancejs/issues/240#issuecomment-189352531.

leesei commented 8 years ago

@victorquinn "Transfer this repository to another user or to an organization where you have admin rights." Cannot transfer without admin right. I would love to be a member of the chancejs org. However if you've yet to decide on org member recruitment, you can push the repo to the org first.

victorquinn commented 8 years ago

Oh oops, can you tell I'm an organization noob? Heh should be fixed

leesei commented 8 years ago

Nvm, this is my first repo transfer too.

leesei commented 8 years ago

A gist for discussion: https://gist.github.com/leesei/c55463a2b4bf314bafc7 Maybe there's a better way?