
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
generator-angular-flow
Advanced tools
AngularJS+Webpack app generator for large applications with maintainable and clear file structure
Improve productivity and consistency on your AngularJS projects.
Designed for large multi-module ng apps.
Uses: angular, webpack, sass, ui-router, ui-bootstrap, angular-modals.
Author: Piotr Błaszczak
first make sure you have installed node.js with npm then you have to install:
yeoman
npm install -g yo
angular-flow generaotr
npm install -g generator-angular-flow
Make a new directory, and cd
into it
mkdir my-new-project
cd my-new-project
generate new app
yo angular-flow
Run npm run start
and go to localhost:8080/webpack-dev-server/
to see the app running with live reload
Now you are ready to start developing your app.
Helpful scripts ready for you to start your work
npm run start to watch files for changes and build for dev.
npm run watch watch for changes and build it to /dist/.
npm run build build for production to /dist/.
Available generators:
Note: Generators are to be run from the root directory of your app.
Sets up a new AngularJS app, generating all the boilerplate you need to get started. The app generator will gide you through the process with questions.
Example:
yo angular-flow
it will generate files required to develop, build and run your app
you should look to /public/src
becourse there you will be doing your work
This generator wil create the project and default module "app" with all basic configuration
When you generate your app with yo angular-flow
command you will have "app" module created so you can put your states, components and other stuff there
but when your application grows, it's better to separate some functionality to other modules
for this task we can se yo angular-flow:module {moduleName}
command
This generator creates new module in /public/src
Example:
yo angular-flow:module user
will generate /public/src/user/user-module.js
Creates new ui-router state in module.
The argument should require the path of the state
notice: the path should start with module name, otherwise you will get module not found error
Example:
yo angular-flow:state user;
creates
public/src/user/_states/user-state.js
public/src/user/_states/user-state.html
public/src/user/_states/user-state.scss
you can create another nested state
yo angular-flow:state user/login;
creates
public/src/user/_states/login/user-login-state.js
public/src/user/_states/login/user-login-state.html
public/src/user/_states/login/user-login-state.scss
A component is basically a element directive that by convention keeps all js,html and css files in one place.
This helps keep complexity low, and makes it easy to separate parts of your application into smaller and more maintainable parts.
Example:
yo angular-flow:component user/login
Produces these files:
public/src/user/login/user-login.js
public/src/user/login/user-login.html
public/src/user/login/user-login.scss
Witch in turn lets you specify custom HTML tags like this to invoke a completely self contained component:
<user-login></user-login>
The view has specified a component name as a class, helping you avoid CSS collisions.
Specify your styles specific for this component in SCSS under a .user-login
class wrapper,
and only this component is targeted.
This is an OK approach until shadow DOMs and web components become widely supported.
Similar to components but uses angular-modals
module to register ui-bootstrap modal
Example:
yo angular-flow:modal user/login
Produces these files:
public/src/user/login-modal/user-login-modal.js
public/src/user/login-modal/user-login-modal.html
public/src/user/login-modal/user-login-modal.scss
now to open the modal use modal
directive
<button modal="user-login">login</button>
or $modals
service
$modals.open('user-login').then(function(user){
// user was logged in
}, function(error){
// modal closed or dismised
});
check the angular-modals documentation for more info how to use it
Generates an AngularJS service in module.
Example:
yo angular-flow:service user/auth
Produces public/src/user/_services/auth-srv.js
:
and you can inject it with name authSrv
Generates an restmod resource in module.
Example:
yo angular-flow:resource user/profile
Produces public/src/user/_resource/profile-res.js
:
and you can inject it with name profileRes
Generates an AngularJS directive in module.
Example:
yo angular-flow:directive user/status
Produces public/src/user/_directives/status-directive.js
:
and you can use it like <div status></div>
Generates an AngularJS filter in module.
Example:
yo angular-flow:service user/user-name
Produces public/src/user/_filters/user-name-filter.js
:
and you can inject it with name {{user.id|userStatus}}
The following packages can be required by the module generator:
FAQs
AngularJS+Webpack app generator for large applications with maintainable and clear file structure
We found that generator-angular-flow demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.