spencercdixon / redux-cli Goto Github PK
View Code? Open in Web Editor NEWAn opinionated CLI for building redux/react apps quicker
An opinionated CLI for building redux/react apps quicker
I love this tool, but I was wondering how do you group things together using redux-cli
For example, if a component is page specific ( in my case, index.jsx is the container )
So wonder if I can generate structure like
components/home/
components/school/
components/school/list/
components/school/detail
If not, do you think something like the following would help ?
redux g dump SubmitSchoolButton --f school/list
Is there a way to make the blueprint's files IDE friendly? Currently I'm using Webstrom, and see error warning everywhere.
Hi,
Not sure if this is just an issue with me but i cant seem to run any redux commands other than redux
which obviously just shows what is available. I get the following:
deepc@DESKTOP-M6C5NC2 MINGW64 /d/Projects/vagrant_local/docker/node/app2
$ redux help generate
module.js:339
throw err;
^
Error: Cannot find module 'C:\Users\deepc\AppData\Roaming\npm\node_modules\redux-cli\bin\index-generate'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
deepc@DESKTOP-M6C5NC2 MINGW64 /d/Projects/vagrant_local/docker/node/app2
$ redux g smart Button
module.js:339
throw err;
^
Error: Cannot find module 'C:\Users\deepc\AppData\Roaming\npm\node_modules\redux-cli\bin\index-g'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
Im running node v 4.2.2 on windows 10. I installed it globally and am trying to use it with React Redux Starter Kit.
Thanks
I'm trying to play around this cli tool, and I create a smart component
roy :: ~/development/poc/redux-cli/test (master) $ redux g smart CommentContainer
info: installing blueprint...
create: /Users/roy/development/poc/redux-cli/test/src/containers/CommentContainer.js
create: /Users/roy/development/poc/redux-cli/test/src/containers/index.js
create: /Users/roy/development/poc/redux-cli/test/tests/containers/CommentContainer.spec.js
And I create another one, and it is failed, is that expected?
roy :: ~/development/poc/redux-cli/test (master) $ redux g smart CommentContainer2
info: installing blueprint...
create: /Users/roy/development/poc/redux-cli/test/src/containers/CommentContainer2.js
error: Not writing file. File already exists at: /Users/roy/development/poc/redux-cli/test/src/containers/index.js
create: /Users/roy/development/poc/redux-cli/test/tests/containers/CommentContainer2.spec.js
I.E. redux dumb FilterButton button
would generate a FilterButton component with a <button></button>
pre-populated in the render statement.
Happy Friday!
I've created a blueprint and am trying to add some template variables, but unfortunately any cli arguments I pass aren't being processed, even --debug
. Here's a gist with the files. I'm console.log
ing the entity so you can see the results.
Allow users of the CLI to save a URL to a gist that can be used for the templates of any of the components. Make sure to cache the template response so it's not making api requests on every generation.
Write docs on how to properly build a template gist.
Pull generator descriptions from the description()
function in blueprint's index.js. Provide a fall back if the description is not there
On a new project creation, I'm getting an error 128 within the setup when it tries to pull from the starter-kit repo.
I believe it fails within function 'pullDownKit()' of /src/cli/redux-new.js.
const pull = exec('git pull https://github.com/davezuko/react-redux-starter-kit.git', {silent: true});
clearInterval(interval);
If I run a git pull of the repo, outside of the cli, its pulls properly.
Here is my terminal output.
redux new testRedux
create: project directory created
create: setting up tracking with git...
error: Something went wrong... please try again. Make sure you have internet access
error: Error code: 128
I'm running El Capitan
git version 2.5.4 (Apple Git-61)
Node v5.3.0
When call redux new foo
its hang on:
loading: Fetching [email protected]:davezuko/react-redux-starter-kit.git from github.
Looks like it try establish first ssh session instead https.
program
.command('*')
.action(function(env){
console.log('Enter a Valid command');
terminate(true);
});
Something like this
I installed redux-cli
as per instruction like below
npm i -g redux-cli
and using node installed with nvm
. When I run redux g dumb HelloWorld
, redux-cli is throwing error
/usr/bin/env: node --harmony: No such file or directory
How to use it with node
installed by NVM
? I can symlink node
to path where cli is looking for but looks like dirty hack to me.
**This is indirectly related to the CLI but equally important since it is using react-redux-starter-kit. I'll take this up there but wanted to get input here as well.
Why?
Because everyone should be testing across multiple devices and browsers while building their apps.
What?
Make BrowserSync a core dependency and integrate it into the server.
Opinionated things I'd love to get feedback on:
I'm a big fan of the test helpers (written in ruby not JS) found here
Awesome work on this. Looking forward to putting it to some good use!
It would be great if there was an option to have the automatic tests created in the same folder as the component/container/form/duck rather than in a test directory.
I am unsure if this can be done with blueprints? Or if it will need to be written in as part of the commands?
First off, this is ✨ awesome ✨ , amazing work. Unfortunately I don't have the time right this second to type out as detailed of an issue as I'd like, but I wanted to put it out there in case you had any initial thoughts or ideas. Basically, what can be done in the base starter kit repo to make it easier to maintain feature consistency/parity?
For example, at work we have a fork of the starter kit and have built an updater utility that automatically migrates changes from the base template to the target project. Unfortunately it's not yet open sourced, so I'd have to talk to the team about what would have to be done to get something like that out the door and in good enough condition for public consumption.
I've been (very slowly) working toward a more "stable" v2.0.0 release, but would be willing to tag a new version earlier if that makes sense for you, since, despite my best efforts, pulling latest master isn't always perfect. Basically, tell me what you need from me and I'll do my best to accommodate.
$ redux g dumb Todo
info: installing blueprint...
create: ~/example/src/component/Todo.js
create: ~/example/tests/component/Todo.spec.js
info: finished installing blueprint.
$ redux d dumb Todo
Are you sure? [y/n]:
removing: ~/example/src/component/Todo.js
removing: ~/example/tests/component/Todo.spec.js
info: finished destroying Todo
As big of a fan of redux as I am, this project got more general with the introduction of blueprints. I think blueprints got a lot of things right that something like YO got wrong, specifically committing the blueprints into the project. So I could see this project taking off.
I intend to use this on several projects which are not redux based. (I work in marketing and have to deal with dozens of projects with all kinds of setups).
This is still a really young project, it might be a good idea to change the name while you still can? It's going to be confusing if this is still going in 5 years and no one is using redux.
I ran the following commands.
$ redux new practice-redux-container
$ cd practice-redux-container
$ redux g smart hello
$ redux g dumb hi
Did I forget to configure something?
/usr/local/lib/node_modules/redux-cli/node_modules/jsonfile/index.js:38
throw err
^
SyntaxError: practice-redux-container/.reduxrc: Unexpected token u
at Object.parse (native)
at Object.readFileSync (/usr/local/lib/node_modules/redux-cli/node_modules/jsonfile/index.js:34:17)
at ProjectSettings.loadSettings (/usr/local/lib/node_modules/redux-cli/lib/models/project-settings.js:45:44)
at new ProjectSettings (/usr/local/lib/node_modules/redux-cli/lib/models/project-settings.js:38:10)
at Generate.SubCommand (/usr/local/lib/node_modules/redux-cli/lib/models/sub-command.js:28:41)
at new Generate (/usr/local/lib/node_modules/redux-cli/lib/sub-commands/generate.js:45:82)
at Object.<anonymous> (/usr/local/lib/node_modules/redux-cli/lib/cli/redux-generate.js:19:18)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
$ redux g dumb hi
/usr/local/lib/node_modules/redux-cli/node_modules/jsonfile/index.js:38
throw err
^
SyntaxError: practice-redux-container/.reduxrc: Unexpected token u
at Object.parse (native)
at Object.readFileSync (/usr/local/lib/node_modules/redux-cli/node_modules/jsonfile/index.js:34:17)
at ProjectSettings.loadSettings (/usr/local/lib/node_modules/redux-cli/lib/models/project-settings.js:45:44)
at new ProjectSettings (/usr/local/lib/node_modules/redux-cli/lib/models/project-settings.js:38:10)
at Generate.SubCommand (/usr/local/lib/node_modules/redux-cli/lib/models/sub-command.js:28:41)
at new Generate (/usr/local/lib/node_modules/redux-cli/lib/sub-commands/generate.js:45:82)
at Object.<anonymous> (/usr/local/lib/node_modules/redux-cli/lib/cli/redux-generate.js:19:18)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
I love the idea of redux-cli. I use snippets to create boilerplates but having a generator on the command line - priceless. My folder structure is like:
root
├── components
│ ├──Foo.js
│ ├──__tests__
│ ├──Foo.test.js
├── containers
│ ├──__tests__
├── reducers
│ ├──__tests__
└── index.js
Is there a way to configure the paths so that __tests__
point to the subfolder of the parent folder?
look into using Yam: https://www.npmjs.com/package/yam potentially
https://github.com/mochajs/mocha/wiki/Shared-Behaviours for inspiration on how to do shared tests in Node
Hi,
I am running redux 1.3.2 and trying to do the "redux new [project-name]". It shows these messages:
info: Creating new directory...
create: Created directory: test-proj
info: Setting up tracking with git...
loading: Fetching [email protected]:davezuko/react-redux-starter-kit.git from git loading:
Fetching [email protected]:davezuko/react-redux-starter-kit.git from git loading:
Fetching [email protected]:davezuko/react-redux-starter-kit.git from github. ⠸
The authenticity of host 'github.com (192.30.252.129)' can't be established.
loading: Fetching [email protected]:davezuko/react-redux-starter-kit.git from git
and the window buffer just keeps showing Fetching [email protected]:davezuko/react-redux-starter-kit.git from git
. I even waited 10 minutes and I just see those same lines scrolling by. Finally, I did a ctrl-c to see if there's anything actually getting saved into my "test-proj" directory. The only thing I see is the .git directory. In the directory where test-proj is, I see that redux-cli created a .reduxrc file, i.e.
/projects
+--> .reduxrc
+--> test-proj/
+--> .git/
What am I doing wrong here?
Not every module I make is going to need a unit test file (sometimes you have a deadline and need to push something out, or whatever).
It would be great to have a shortcut to skip the test generation. EG:
redux g -nt dumb SimpleButton # shorthand
redux g --no-toest dumb SimpleButton #full
I agree with the ideal of 100% unit test coverage, but it's not always practical.
Disregard this..my mistake
Hi! Our team is actively using namespaces in projects and when I'm trying to define the name of generated file like this:
redux g dumb Foo/Bar
the CLI generates this:
create: /home/vagrant/Code/todo/src/components/Foo/Bar/Foo/Bar.js
create: /home/vagrant/Code/todo/tests/components/Foo/Bar.spec.js
Foo/Bar
is doubled in the file name, but not in the test.
You can reproduce it on the fresh installation of this boilerplate:
https://github.com/davezuko/react-redux-starter-kit
My version of redux-cli
is 1.4.2.
Am I doing something wrong or it's just not supported yet?
Set defaults for project settings to work with the redux starter kit. Make 'init' an optional command that users can use to integrate with existing redux apps that might use different file structure
I've been operating under the assumption this is some dumb local environment issue, and it probably still is, but it's got me baffled.
Using [email protected], on node 5.7.0 on Mac OS. I re-installed redux-cli multiple times and have no trouble with that. But if I try to scaffold a project with it, the install runs forever, with no errors and no timeout. At the moment, it has been a half hour, with no progress. I was playing with it before a three-day business trip, and when I came back from that trip and opened the terminal window again, the same fetch was still going, even though it had been on-line and off-line dozens of times since then.
It eternally sticks on:
loading: Fetching [email protected]:davezuko/react-redux-starter-kit.git from github.
I can download that repo by itself with no trouble: either a zip download or a clone completes successfully, and almost immediately.
Here's a full capture of the current terminal:
Curious as to how I could inject a route into a pre-built routes.js file.
Maybe there could be a routes manifest and the routes.js gets built dynamically from the routes manifest. That way it's easy to add lines to the generated routes manifest and have the app always reflect the right routes. Kind of like how Rails has a routes config.
Route generator should also probably create the appropriate View container file for that route by appending RouteName + View.
Hey guys,
First of all, congrats for this awesome tool, it's been very helpful to bootstrap a new project.
I was using the duck generator and I realized that the file name is being generated in camel case, isn't it the case of these files to be generated in sneak case? If you agree with that I can submit a pull request ;)
Cheers!
There's a branch of the starter-kit without the example app:
https://github.com/davezuko/react-redux-starter-kit/tree/new-project
It would be nice if redux init
uses that instead.
I develop with a team on a Mac and deploy on a Linux machine. Mac is not case sensitive, so having case sensitive file names leads to undiscovered import errors until it is deployed.
I had an issue when I tried using the client from a new machine where I had not added my ssh key to git. The client just stuck at fetching and it took me a while to notice what was wrong. Why don't you just use https. I also know for sure I can't use it at work were they have blocked ssh.
When use this project to generate new redux environment after npm run start I get:
Module build failed: Error: Cannot find module 'eslint-config-standard-jsx' from '.... /node_modules'
Hi,
I've installed redux-cli with:
sudo npm -g install redux-cli
And I get the following error:
`/usr/bin/env: node --harmony: No such file or directory
Env:
:~/sandbox$ node -v
v5.7.0
:~/sandbox$ npm -v
3.6.0
Looks like there is a problem with bang sign, here is a link with similar error:
azproduction/node-mc#3
Thanks Alex
`
Hola! @joyvuu-dave has created a ZenHub account for the SpencerCDixon organization. ZenHub is the leading team collaboration and project management solution built for GitHub.
To get set up with ZenHub, all you have to do is download the browser extension and log in with your GitHub account. Once you do, you’ll get access to ZenHub’s complete feature-set immediately.
ZenHub adds a series of enhancements directly inside the GitHub UI:
Still curious? See more ZenHub features or read user reviews. This issue was written by your friendly ZenHub bot, posted by request from @joyvuu-dave.
I'm trying to create duck "posts", but it returns error below:
$ redux g duck posts [18:31:41]
info: installing blueprint...
create: /Users/XXX/Projects/shop-public-service/src/redux/modules/posts.js
error: error was: ejs:1
>> 1| import reducer, { defaultState } from 'redux/modules/<%= name %>';
2| import deepFreeze from 'deep-freeze';
3|
4| describe('(Redux) <%= name %>', () => {
name is not defined (Error in blueprint template: /usr/local/lib/node_modules/redux-cli/blueprints/duck/files/__test__/redux/modules/__name__.test.js)
Is there any way to get this to work properly?
BTW great job doing this. I've always dreamt about react/redux cli, just like ember one.
Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.