Comments (15)
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.
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.
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.
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.
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.
@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.
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.
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.
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.
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.
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.
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.
Ok, but still no windows solution...
from generator-react-webpack.
What about cygwin or PowerShell?
from generator-react-webpack.
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)
- Running the generator throws error on expected promise object at the beginning of execution
- NPM Run Dist won't copy over all image assets
- SyntaxError: Unexpected token: name (path) [./cfg/base.js:2,0] when running dist
- Optionally use HtmlWebpackPlugin
- Static files
- how to add postCss plugin,please tell me details of it
- Redux link in README.md seems incorrect
- Hot reloader not working. HOT 1
- Setup Issue
- Generate A Container?
- Cannot read property 'apply' of undefined
- Missing node modules when deploying to Heroku HOT 1
- impossible to use any node package added
- How can I set webpack proxy in cfg/base.js
- When you choose Scss in the installation - all generated files are .css
- install warn HOT 1
- "Uncaught SyntaxError: Unexpected token <" on Production Server
- React Version is Old
- Error trying to run npm run dist
- How can auto open the browser?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator-react-webpack.