Comments (10)
Ok, I will think how to implement this
from generator-derby.
Hoping to help, I'll post here what I did to implement multiple apps by hand.
For example, wanting a boom
app aside the app
app I did the following:
- add
boom
dir withindex.js
insrc/
, copied fromsrc/app/index.js
- add
boom
dir withindex.css
instyles/
, copied fromstyles/app/index.css
- add
boom
dir withindex.html
andhome.html
inviews/
, copied fromviews/app/*.html
- replace the "app" word of
src/boom/index.js
with the "boom" word - change the path in the
.get()
route insrc/boom/index.js
- add
require('./src/boom')
in theapps
array in server.js
And that was enough, at least for me.
Some considerations:
- My guess is that the yeoman command might be
yo derby:app
- I think all the files to generate the app are already there, maybe they just need to be extrapolated in their own template directory
- I'd be more than happy to help build this feature, but I never built a yeoman module (shouldn't be that hard starting from the existing one...), and I'm in a kind of super busy period, so don't expect that too soon... :(
from generator-derby.
I think about the issue too. And I'm going to split the generator internally into project-level generating and app-level generating. The two stuff will be still in yo derby
.
If you start it inside an empty folder it generates a project with app. But if you start it inside an existing project it will create only a new app
.
from generator-derby.
@zag2art I didn't know you may split a single yeoman command into multiple commands which may be called one after another. That makes sense, and I really like you're ideas of splitting things up!
From what I understood there will be one commad which does multiple things in a smart way. But what if you actually put the app generation code in another command and then call it from the project generation command?
In this way when you call 'yo derby' it calls the project and the app generation code, when you call 'yo derby:app' it just can just generate the app.
In this way:
- generator features are pretty straight forward to learn and there are no hidden things or side-effects like behaviours
- we don't have to check for files in directories, or checking in which dir we are, or whatsoever...
- each "module" does one thing, and you call the app module inside the project module
- my guess is that the code would be simpler and easier to maintain
What do you think?
from generator-derby.
Unfortunately yo derby
= yo derby:app
in yeoman because app
is a default generator. Look here. I tried to find the way to change the behavior (here the code) but at the moment didn't find the answer.
from generator-derby.
Ok, I didn't know the alias story.
So, from my point of view, there might be two possibilities:
- Following your idea of generating different things based on where we are. Maybe searching for the
.yo-rc.json
file might help, because it should be in the root of the project as stated here at the end. Howeever there might be a case corner: the first time we generate the project, which is in an empty dir; - accept an
app
name parameter for theyo derby
command. In this wayyo derby
bootstrap the project in the current empty dir, andyo derby boom
creates theboom
app in theapps
dir.
I'm not trying to avoid your original idea, I'm just trying to understand if there's a simpler way to do it :)
from generator-derby.
Another possibile solution: accept a parameter name for bot the project or the app generation, but add a --app
parameter to generate an app.
from generator-derby.
Hmm, I like the second suggestion. Think yo derby boom
is quite expressive. Anyway we need to start somewhere.
from generator-derby.
I agree
from generator-derby.
Add this feature.
from generator-derby.
Related Issues (20)
- Bundle error silently ignored. HOT 1
- Bootstrap: Cannot find view dropdown HOT 3
- Derby-login + Racer-schema = No schema for collection: auths HOT 6
- derby-login HOT 2
- Dependencies empty in package.json - missing a step? HOT 3
- 404 Sorry, we can't find anything at /login. HOT 4
- derby.util.isProduction is undefined on client side HOT 3
- Error: Cannot find module 'derby-markdown'
- Are the peerDependencies correct? HOT 1
- misspelled: generator-derby/app/templates/apps/app/views/_register.bootsrap.html HOT 1
- /apps/error/styles/reset.styl not needed
- error on generate derby with one feature bootstrap
- v0.8.5 Error: Cannot find module '../util.js' HOT 4
- Is there a way to skip bundling for a faster restart? HOT 5
- Generator Fails HOT 3
- Fix windows support right from the start on generated code HOT 1
- [Feature Request] Webpack support
- derby-login needs some update HOT 1
- Sessions don't work HOT 3
- Error with derby-login HOT 5
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-derby.