arch-js / arch-cli

Command line tool for the Arch framework
1 stars 2 forks source link

Features draft #1

Open asavin opened 9 years ago

asavin commented 9 years ago

What it should be able to do

Ideas

Principles

charypar commented 9 years ago

:+1: on everything you said.

asavin commented 9 years ago

So I guess it's going to be an npm module, and the full journey for the first time user will be like this:

  1. Go to http://nodejs.org and install Node.
  2. npm install -g reflex - or whatever the name will be
  3. reflex init helloworld && reflex s
charypar commented 9 years ago

npm install -g reflex?

asavin commented 9 years ago

Thanks, yes, -g

charypar commented 9 years ago

Just thought of an idea. Should reflex s also start a gulp watch and recompile with changes...?

asavin commented 9 years ago

Yeah I think it's a great idea to combine server with hot code reload.

asavin commented 9 years ago

One fun thing for the example app would be having responsive layout in place and different looking components that are replacing each other for each breakpoint while sharing the same data.

asavin commented 9 years ago

Also generate tests for UI components: props go in -> expected html comes out

dpiatek commented 9 years ago

What would be the difference between scaffold and generate?

tabazevedo commented 9 years ago

Yeah that's kind of confusing. generate should just take a parameter which defines what to generate. ie. reflex g route [path] [(optional) component]

asavin commented 9 years ago

@dpiatek in Rails you can generate skeleton of the app, then generate some extra models / controllers, and then scaffold views for CRUD actions on those models. What sort of things are we possibly interested in generating, apart from routes?

asavin commented 9 years ago

@tabazevedo assuming that componentName will always match routeName ?

tabazevedo commented 9 years ago

@asavin no, i meant that you can specify the component name but it defaults to matching the path. I guess path and routeName will be different though so I suppose it would be reflex g route [path] [routeName] [(optional) componentName] and by default componentName = routeName

dpiatek commented 9 years ago

@asavin isn't scaffold just a generator in Rails, as in rails generate scaffold? http://guides.rubyonrails.org/v3.2.13/getting_started.html#getting-up-and-running-quickly-with-scaffolding . Would nice to have one command to generate them codes.

tabazevedo commented 9 years ago

Yeah in Rails it just generates a model with a controller with a view (and some other misc stuff), so its a bit of shorthand.

asavin commented 9 years ago

Is there anything else besides routes we want to generate? I was hoping to stick with something like reflex g tweets friends profile - which would generate pages and routes for the given array of things.

(just thinking out loud)

that would generate following URL:s, root components and tests: .../tweets .../friends .../profile

...aaaaaand a navbar component with links to all those pages.

asavin commented 9 years ago

More potential batteries to the box:

charypar commented 9 years ago

@asavin I think eventually, we'd like to generate "state observers" too. I'm not sure what to call them, but the things that listen on the app-state and respond to changes.

tabazevedo commented 9 years ago

@asavin I feel like things like auth and locales are really application-specific and shouldn't be part of the cli...

charypar commented 9 years ago

@asavin Agree with @tabazevedo on auth and localisation. It shouldn't even be a part of the core framework. We should strive to make the plugins capable enough that these things are simple to build as one.

An auth plugin, for example, would be 1) a module with the logic needed, 2) a CLI plugin with a generator for the app integration. Makes sense?

asavin commented 9 years ago

@charypar yep, makes total sense