kosz / generator-modular Goto Github PK
View Code? Open in Web Editor NEWYeoman Generator for Angular Webapps and Modules
Home Page: https://github.com/kosz/generator-modular
License: Apache License 2.0
Yeoman Generator for Angular Webapps and Modules
Home Page: https://github.com/kosz/generator-modular
License: Apache License 2.0
and yo modular:resource generator
When generating a project with angular-strap I've bumped into these 2 problems:
I fixed these 2 errors and it works smoothly now ;)
workaround is to create a blank file
Workaround is to add the $scope in yourself.
This is an uncomfortable bug and it will be fixed shortly.
The "generate reusable Module" option does not work well.
watchers look for changes, but not for added files.
workaround : when adding a new file restart your gulp test / gulp serve
Errors are related to the Ctrl/Controller naming changes.
Workaround is to manually change to the right controller name in app.js or module.js, for the main controller.
Note: this content of this text has been drastically modified based on the comments provided.
Note: it's expected that this document and it's links to other generator-modular wiki pages, to change and be improved with time.
As I'm coding generator-modular, I am trying to provide a scalable and robust standard for File Structure organization. This approach will obviously be based on the Google Recommendation for Angular project file structure, however, when trying to anticipate potential problems with large & growing generator-modular based projects, I believe I may have found a few issues, which I would like to discuss here openly, and have them validated and approved, or constructively invalidated, by the community.
This list is short and not very descriptive. For a more in depth analysis of these thoughts please have a look at this wiki page : https://github.com/kosz/generator-modular/wiki/Issues-with-the-Google-Best-Practice-Recommendation-for-Angular-App-Structure
Here is a side by side example to illustrate the difference between the Google Recommendation and the Modular Proposal. Make sure to click on the image to zoom in.
Camel case in file names violates the Google Recommendation. This is a mistake I made when creating this image ( due to using this convention in recent projects ), and will be fixed in later revisions
So basically the Modular proposal, indicates that base level API objects such as routes,filters,directives or services should live in a type based directory structure, but encapsulate all their files and other components.
That means that we do not drop ALL the directives in the directives folder, we only drop the base level, reusable directives. If a directive contains other directives which only are used inside it, then the child directives should live inside the folder of the parent directive.
jshint not setup properly
This is becoming a priority, since my team wants to use ui.router instead of ngRoute.
Gulp crashes when trying to process empty scss-file.
โ temp gulp serve
[09:57:49] Using gulpfile ~/code/web/temp/gulpfile.js
[09:57:49] Starting 'styles'...
[09:57:50] Starting 'clean:tmp'...
[09:57:51] Finished 'clean:tmp' after 383 ms
[09:57:51] Starting 'scripts'...
[09:57:52] all files 0 B
[09:57:52] Finished 'scripts' after 1.57 s
gulp(9696,0x7fff74940300) malloc: *** error for object 0x10433f5a9: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
[1] 9696 abort gulp serve
Seen on new freshly generated project.
The module dist folder should not have index.html, and maybe no vendor assets ?
not really a workaround, but css minification can be disabled to avoid the error, by commenting out the .pipe($.csso()) line form the gulp/build.js file
And it should, even if you don't specify you want it injected.
The demo templates are being built in the dist of a Module project.
The dist directory should look different for Modules.
And the demo content such as demo app, controllers, and templates, should not be packaged in dist.
gulp tasks work pretty well, but the default task throws an error.
The work around is not to use gulp default, so don't run
gulp
instead run a specific task :
gulp serve
This is causing problem in modular deployments, which copy over the old version of dist, before the new one is ready.
Not triggering cleans properly may be causing some other issues in other areas as well.
Gotta keep an eye on this.
very annoying when using touch file.scss
by refreshed i mean either hit the refresh button, or re-save the file to trigger the watcher again
currently gulp serve:dist or gulp build, inside a module project, create a dist folder with index.html and the demo code.
this is ok for demo-ing the module, but a separate task should be provided, that builds a different dist folder that contains a module distribution without the demo code or index.html. This dist folder should provide the file to be imported into other projects.
This issue should fix :
how to prefix suffix a controller/directive/etc
how to build the file name based on the controller/directive/etc name
how to suffix .js file name with type of object
Embarrassing bug which I've ignored for about 2 months >:
Since ATScript and TypeScript seemed to have merged, based on ng-conf.
TypeScript is therefore the way to go
ok clearly, in order to continue adding features i first need to refactor.
the templates need to be a lot more modular, so that different options can be easily provided, and code can be reused.
this becomes the first priority ...
currently module('demo' , and it's files are being packaged with the module code.
modular:route should default to src/routes
modular:controller should default to src/routes/main
modular:directive should default to src/directives
modular:service should default to src/services
Working directly in index.html can be problematic.
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.