import ClientStateManager from 'spike/client/state_manager';
import ServerStateManager from 'spike/server/state_manager';
import ClientRouter from 'spike/client/router';
import ServerRouter from 'spike/server/state_manager';
import ApplicationComponent from 'spike/shared/application_component';
import BaseComponent from 'spike/shared/base_component'; // This will set context with i18n.
import Route from 'spike/shared/route.js';
import RouteLink from 'spike/shared/components/route/route.component.js';
Should generate components within shared/components
as such:
spike generate component Example --name --where utils -t -s -rt
This would generate:
shared/components/utils/example
example.component.js
example.scss
example.test
example.rt.html
Similarly:
spike generate route --name Route1
This would generate:
shared/components/routes/route1
route.component.js
route.scss
route.test.js
route.rt.html
t
ortest
[false]: include example.test.jsrt
orreact-template
[false]: include example.rt.htmls
orstyle
[false]: include example.scss
spike generate reducer --name User
This would generate:
shared/reducers/user
user.reducers.js
user.actions.js
user.reducer.test.js
I have examples of each of these files we can use for templates.
spike generate app
This would generate the following structure.
client
config
design
webpack.js
develop
webpack.js
production
webpack.js
shared
style.js
app.js
server
assets
css
js
transalations
en.json
config
design
server.js
develop
server.js
production
server.js
server.base.js
views
index.ejs
shared
base_classes
components
mixins
reducers
routes.js
I will need to think through options to configure:
- Whether to include translations in app generation.
We will want to provide easy build commands:
NODE_ENV=production spike build
This should build client assets (app.js, style.css, as well as a server build in build/production/server). See this article.
NODE_ENV=development spike run
I need to go through this more thoroughly.
- We'll want to make sure that
<img src=""/>
and anyurl()
within css is compiled through webpack both when components are compiled on client and server.