Giter VIP home page Giter VIP logo

Comments (15)

ColCh avatar ColCh commented on June 23, 2024

You can use your shell feature named alias

I wrote small example for you:

alias yorw="yo react-webpack"

You can make this permanent with adding that line to your ~/.bashrc.

from generator-react-webpack.

newtriks avatar newtriks commented on June 23, 2024

That's the exact route I was thinking after realising this was out of scope for yeoman Β πŸ‘ thanks Max

On Saturday, 11 Apr 2015 at 16:45, Max Sysoev [email protected], wrote:

You can use your shell feature named alias

I wrote small example for you:

export yorw="yo react-webpack"

You can make this permanent with adding that line to your ~/.bashrc.

β€”
Reply to this email directly or view it on GitHub.

from generator-react-webpack.

yonatanmn avatar yonatanmn commented on June 23, 2024

I disagree with this solution.
First, bash is a unix thing, not everyone uses it.
Second, this is a hack, not a normal way. the all point of yeoman is make life shorter, and this long name might prevent potential users from using this generator.
lastly - webpack is one feature of this generator, but not its main core. I believe this will be the ultimate generator for react, similar to generator-angular, so the name should represent that.

from generator-react-webpack.

semigroupoid avatar semigroupoid commented on June 23, 2024

Sorry, I disagree with that. Using aliases for abbreviations is not a hack, its one of their main use cases. I don't know if you use Windows (because of your "unix thing" comment) but I bet that the Windows command line tools have some way of defining aliases, too. Abbreviations and such are a very subjective thing, similar to keyboard shortcuts and as such should be handled in your terminal configuration and not by renaming the project. (There is also a zsh plugin that gives you auto-completion of generator names.)
Regarding your last point, I think webpack is an essential part of this project and one that seperates this generator from others. Also, the name generator-react is not much shorter than generator-react-webpack, is it?

from generator-react-webpack.

yonatanmn avatar yonatanmn commented on June 23, 2024

Iv'e tried with windows, so instead of react-webpack i'll do
rw but then you cannot do rw:component. any way - this is a hack, in the manner that the point of yeoman generators is to make your life easy and short, without adding anything around . like we have react-webpack:c instead of react-webpack:component.
Webpack is not an essential part, because the user who uses this generator wants React mainly, and will be glad to have webpack (or browerify or whatever) too, but that's not why he came.
Currently this generator is the most popular one for react, and should have a sterile name - so it can remain in the top. similar to generator-angular.
and it's not generator-react in the console - only react, which is less than a half of react-webpack.

from generator-react-webpack.

ColCh avatar ColCh commented on June 23, 2024

@yonatanmn sorry I've forgot about subgenerators. Hm.. this is a hard issue...
I'm sure that renaming the project is not a solution.

Ha! What about npm scopes? With 'em it's possible to place this generator like @newtricks/generator-react

from generator-react-webpack.

yonatanmn avatar yonatanmn commented on June 23, 2024

The problem is with how Yeoman will read this, stating it is only looking for generator-XXX, any way if this is the only issue, we can use generator-react, since https://github.com/nemophrost/generator-react is not alive, and we can ask the owner to drop it, or alternatively think of a cool and short name

from generator-react-webpack.

semigroupoid avatar semigroupoid commented on June 23, 2024

Honestly, I still don't see the point. If subgenerators don't work, use alias rwc="yo react-webpack:c" etc. Again, shell aliases are not a hack. They are primarily used for abbreviations!
In my opinion, the usage of webpack makes this generator to opinionated for a generic name such as generator-react.

from generator-react-webpack.

yonatanmn avatar yonatanmn commented on June 23, 2024

In windows, tried : doskey r:c=yo react-webpack:c, and then r:c test.
result:
Error: Did not provide required argument ←[1mname←[22m!
I think doskey can't get more code after the alias.

from generator-react-webpack.

semigroupoid avatar semigroupoid commented on June 23, 2024

I don't have a Windows machine, but did you try doskey r:c="yo react-webpack:c"? You probably have to wrap the actual command in quotes (you also have to do that in bash).

from generator-react-webpack.

yonatanmn avatar yonatanmn commented on June 23, 2024

the correct way is what i quoted before (that's why it gave 'no name' error). Tried yours just to make sure - not working at all.
(can you verify r:c test works in mac?)

from generator-react-webpack.

semigroupoid avatar semigroupoid commented on June 23, 2024

Yes r:c test works. First:

alias r:c="yo react-webpack:c"

Then you can do:

r:c test
   create src/components/Test.js
   create test/spec/components/Test.js
   create src/styles/Test.css

from generator-react-webpack.

yonatanmn avatar yonatanmn commented on June 23, 2024

Ok, but still no windows solution...

from generator-react-webpack.

semigroupoid avatar semigroupoid commented on June 23, 2024

What about cygwin or PowerShell?

from generator-react-webpack.

yonatanmn avatar yonatanmn commented on June 23, 2024

I'll check them out.
any way I still in my opinion that the project should be renamed :)

from generator-react-webpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.