
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
generator-angular-enterprise
Advanced tools
This is the most comprehensive and strict code generator that adheres to Angular's most popular best practices guide. It also generates companion tests and gives you a gulp build/test process. It even documents best practices that are being employed when generating a snippet (see below).
Most Angular tutorials teach very bad patterns for creating larger Angular applications. Eventually, most devs hit a wall before realizing everybody else has abandoned the practices their tutorials once endorsed.
There are also a lot of really popular patterns that aren't always practiced in the JavaScript community (such as code coverage analysis). This generator encourages some of these patterns as well.
These known best t are often called "enterprise" patterns simply because they aren't critical in small projects. This generator should be used in any project that plans to expand beyond a few primary states.
Whenever possible, rules are directly linked to the standards guide where invoked. This will help ensure future developers continue building on the best practices. For example, when generating a controller:
// start example snippet ...
/**
* Chain to fetch module
* https://github.com/johnpapa/angular-styleguide#style-y022
*/
angular
.module('myApp.aboutPage')
.controller('AboutPageController', AboutPageController);
/**
* Avoid anonymous functions as callbacks
* https://github.com/johnpapa/angular-styleguide#style-y024
*
* Document dependency injenction using annotations
* https://github.com/johnpapa/angular-styleguide#style-y100
*/
/* @ngInject */
function AboutPageController() {
// ... end example snippet
To use it, you will need Yeoman - a tool for managing code generators.
npm install -g yo
Next, you'll need to install the generator
npm install -g generator-angular-enterprise
Now, create a new directory where you want your angular app to live. Then enter that directory.
cd Projects/
mkdir new-angular-app
cd new-angular-app
Then, initiate the generator:
ae new
Create your application's starting point:
ae feature myStartingSection
The above would generate the following folder/files in your designated application folder:
app/
my-starting-section/
my-starting-section.module.js
my-starting-section.route.js
my-starting-section.route.spec.js
You would then add sub-components such as controllers to this module:
ae controller myStartingPage
Now your app looks like this:
app/
my-starting-section/
my-starting-page.controller.js
my-starting-page.controller.spec.js
my-starting-page.html
my-starting-section.module.js
my-starting-section.route.js # <= modified with new routes
my-starting-section.route.spec.js # <= modified with new routes
Running the app:
gulp serve
Running tests:
npm test
While developing, run tests and refresh the app automatically as you make changes:
gulp watch
ae directive myDirective # "myDirective" is the camel case representation of your directive name
ae feature myFeature # "myFeature" is the name of the module (will generate a controller/routes)
ae filter myFilter # "myFilter" is what you would use in the HTML
ae factory myFactory # "myFactory" is the name of factory
ae service myService # "myService" is the name of service (singleton)
If you want to make changes to the generator, you'll want to make sure to observe our testing patterns. You can run tests with:
gulp test
And enable auto-testing via:
gulp watch
To develop on this generator, you will want to clone this repo and run:
npm link
This will "install" your local copy of this repository as a registered Yeoman generator. Note that the name of the
project folder you clone to must match the name of this generator (e.g., generator-...
).
MIT. Copyright (c) 2015 Michi Kono, John Katsnelson, Forrest Thomas
FAQs
Angular Enterprise Yeoman generator
We found that generator-angular-enterprise 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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.