All Projects β†’ mselerin β†’ yang-schematics

mselerin / yang-schematics

Licence: MIT License
Yet Another Angular Generator - based on @schematics/angular

Programming Languages

typescript
32286 projects
SCSS
7915 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to yang-schematics

Lib
πŸ€– Lets you focus on the stuff that matters
Stars: ✭ 142 (+787.5%)
Mutual labels:  angular-cli, schematics
Model
Angular Model - Simple state management with minimalist API, one way data flow, multiple model support and immutable data exposed as RxJS Observable.
Stars: ✭ 242 (+1412.5%)
Mutual labels:  angular-cli, schematics
Nativescript Schematics
nativescript, mobile, schematics, angular
Stars: ✭ 176 (+1000%)
Mutual labels:  angular-cli, schematics
Devkit
Stars: ✭ 561 (+3406.25%)
Mutual labels:  generator, schematics
Ngtron
Easily serve and build angular based electron applications
Stars: ✭ 178 (+1012.5%)
Mutual labels:  angular-cli, schematics
Generator Ngx Rocket
πŸš€ Extensible Angular 11+ enterprise-grade project generator
Stars: ✭ 1,329 (+8206.25%)
Mutual labels:  generator, angular-cli
bc-hardware
HARDWARIO Hardware (Schematic and Assembly Drawings)
Stars: ✭ 16 (+0%)
Mutual labels:  schematics
python-lorem
🐍 Python library for the generation of random text that looks like Latin
Stars: ✭ 19 (+18.75%)
Mutual labels:  generator
angular-unit-testing-examples
Showroom for different Angular unit testing concepts
Stars: ✭ 19 (+18.75%)
Mutual labels:  angular-cli
kicad-exports
Auto generate exports (schematics, gerbers, plots) for any KiCAD5 project.
Stars: ✭ 69 (+331.25%)
Mutual labels:  schematics
yii2-rest-doc
Yii2 REST doc generator
Stars: ✭ 35 (+118.75%)
Mutual labels:  generator
roadifier
Open Source road mesh generator script for Unity
Stars: ✭ 30 (+87.5%)
Mutual labels:  generator
BFSG
BFSG - BruteForce String Generator 😾
Stars: ✭ 16 (+0%)
Mutual labels:  generator
angular-pwa
Angular 13 Example Progressive Web App (PWA)
Stars: ✭ 45 (+181.25%)
Mutual labels:  angular-cli
gommon
A collection of common util libraries for Go
Stars: ✭ 26 (+62.5%)
Mutual labels:  generator
okta-angular-openid-connect-example
Angular + Angular CLI with Authentication from OpenID Connect and Okta
Stars: ✭ 19 (+18.75%)
Mutual labels:  angular-cli
nuzlocke-generator
πŸ“ƒ A nuzlocke template generator.
Stars: ✭ 21 (+31.25%)
Mutual labels:  generator
pi485
An open-source TTL UART <-> RS485 converter, intended for a Raspberry Pi or Arduino
Stars: ✭ 29 (+81.25%)
Mutual labels:  schematics
reactcci
React create component interactive CLI
Stars: ✭ 49 (+206.25%)
Mutual labels:  generator
liferay-starter
Generate & download your Liferay workspace from a webapp.
Stars: ✭ 25 (+56.25%)
Mutual labels:  generator

License: MIT npm CI codecov

Yang Schematics

Yet Another Angular Generator - Powered by Schematics

Yang Logo

Intro

The purpose of YANG is to create a more production-ready Angular application.

It use the Angular Schematics to generate the code.

YANG use the LIFT principle :

  • Locating our code is easy
  • Identify code at a glance
  • Flat structure as long as we can
  • Try to stay DRY (Don't Repeat Yourself) or T-DRY

When generating a new Angular application with the Yang-Schematics, you have :

  • A simple 4 modules structure : core, shared, layouts and features (see below)
  • Lazy loading for all modules inside 'features'
  • Sample bootstrap code
  • Sample interceptor code
  • i18n with @ngx-translate

CoreModule

The CoreModule contains all the @Injectable elements that should be instantiate only once in the application.

Ex: services, interceptors, etc.

You can also add the modules with a .forRoot() method inside the imports array of the CoreModule.

SharedModule

The SharedModule contains all elements (components, directives, pipes) that will be used accross the entire application.

Ex: a PageHeaderComponent, a security directive, etc.

You can also add the modules you want to use everywhere inside the MODULES array of the SharedModule.
Then, you just have import the SharedModule inside your module.

LayoutsModule

This module contains a MainLayoutModule where you can customise the application layout.
You can also add others layout inside (for example, a LoginLayout).

FeaturesModule

You can see a feature as a "business block" for your application.
A good example would be an "admin feature" where you can have a component to manage the users, the configuration, etc.

Each feature is lazy-loaded by default.

You can create what you want inside a feature (a component, a directive, a module, another feature).

Folder Structure

PROJECT_ROOT
β”‚  ...
β”‚  webpack.extra.js            <----------------- Script for generating "app-manifest.json" (version number and built date)
β”‚  ...
β”‚
β”œβ”€β”€β”€e2e
└───src
   β”‚
   β”œβ”€β”€β”€app
   β”‚  β”‚  app-routing.module.ts    <------ Main routing
   β”‚  β”‚  app.component.spec.ts
   β”‚  β”‚  app.component.ts
   β”‚  β”‚  app.module.ts
   β”‚  β”‚
   β”‚  β”œβ”€β”€β”€core                            
   β”‚  β”‚  β”‚  core.initializer.ts   <------ Code to execute when the application starts
   β”‚  β”‚  β”‚  core.interceptors.ts  <------ HttpClient interceptors (rewrite /api/ to the api url inside environment config file)
   β”‚  β”‚  β”‚  core.module.ts
   β”‚  β”‚  β”‚  core.services.ts     <------- Module pour regrouper tous les services
   β”‚  β”‚  β”‚
   β”‚  β”‚  └───services
   β”‚  β”‚        config.service.ts  <------ Load assets/config/app-config.json and expose an AppConfig object
   β”‚  β”‚        logger.service.ts  <------ Logging that can send error to a server
   β”‚  β”‚
   β”‚  β”œβ”€β”€β”€features
   β”‚  β”‚  β”‚  features.module.ts
   β”‚  β”‚  β”‚
   β”‚  β”‚  └───home
   β”‚  β”‚       home-routing.module.ts
   β”‚  β”‚       home.component.spec.ts
   β”‚  β”‚       home.component.ts
   β”‚  β”‚       home.module.ts
   β”‚  β”‚  
   β”‚  β”œβ”€β”€β”€layouts
   β”‚  β”‚  └───main               <-------- Main layout module for the application
   β”‚  β”‚
   β”‚  β”œβ”€β”€β”€models
   β”‚  β”‚     app-config.model.ts  <------- See assets/config/app-config.json
   β”‚  β”‚
   β”‚  └───shared
   β”‚     β”‚  base.module.ts      <-------- Base modules for the main components (app & layouts)
   β”‚     β”‚  shared.module.ts    <-------- Shared modules (where you can add 3rd party modules used almost everywhere)
   β”‚     β”‚
   β”‚     β”œβ”€β”€β”€components
   β”‚     └───pipes
   β”‚
   β”œβ”€β”€β”€assets                <----------- Assets folders (images, styles, etc)
   β”‚  β”œβ”€β”€β”€config
   β”‚  β”‚     app-config.json
   β”‚  β”‚
   β”‚  β”œβ”€β”€β”€i18n
   β”‚  β”œβ”€β”€β”€images
   β”‚  └───styles
   β”‚        app-styles.scss
   β”‚        _variables.scss
   β”‚
   └───environments            <--------- Environnements configuration
        environment.prod.ts
        environment.ts

Installation

Install Yang-Schematics using npm npm install -g yang-schematics.

Usage

Generate your new project inside any folder:

ng new my-awesome-project -c yang-schematics

This will create a new folder my-awesome-project containing a fresh Angular application, powered with the YANG structure.

Next : install dependencies and run the project :

cd my-awesome-project
npm install
npm run start

Browse to http://localhost:4200. That's all !

Schematics

The default schematics for this project is 'yang-schematics'.
If you have changed it, don't forget to append yang-schematics: before every schematic call.

Feature

ng g feature my-super-feature (or ng g f...)
Generates a feature under app/features with an empty component.

To skip the component generation, use : ng g feature foo --component=false or ng g f foo -c=false

Options
  • --component : Create a 'my-super-feature' component. Options from the 'component' schematic are available. (default: true)

Component

ng g component my-nice-component (or ng g c...)
Generates a component under the current directory.

ng g component shared/my-shared-component
Generates a component under app/shared/components.

ng g component my-super-feature/my-feature-component
Generates a component under app/features/my-super-feature/my-feature-component.

Options
  • --routing : Specifies if a route should be generated for this component
  • --route <name> : Specifies the name of the route to generate

Service

ng g service my-cool-service (or ng g s...)
Generates a service under app/services.


Directive

ng g directive my-small-directive (or ng g d...)
Generates a stub directive under app/shared/directives.


Pipe

ng g pipe my-nice-pipe (or ng g p...)
Generates a pipe under app/shared/pipes.


Proxy

ng g proxy
Generates a simple proxy configuration inside your project.
(more info: Angular documentation)


Jest

ng g jest
Replace Karma by Jest without changing your unit-tests.
Your npm run test and ng test commands still work but now, you can also use npm run jest:watch.


I18N

ng g i18n
Add @ngx-translate/core to the project.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].