All Projects → ngxs → Schematics

ngxs / Schematics

Licence: mit
🔧 Schematics for @ngxs/store

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Schematics

Devkit
Stars: ✭ 561 (+658.11%)
Mutual labels:  cli, schematics
Radon
Various code metrics for Python code
Stars: ✭ 1,193 (+1512.16%)
Mutual labels:  cli
Sandmap
Nmap on steroids. Simple CLI with the ability to run pure Nmap engine, 31 modules with 459 scan profiles.
Stars: ✭ 1,180 (+1494.59%)
Mutual labels:  cli
Nodo
☑ Command line TODO app
Stars: ✭ 73 (-1.35%)
Mutual labels:  cli
Dynamorm
Python object & relation mapping library for Amazon's DynamoDB service
Stars: ✭ 72 (-2.7%)
Mutual labels:  schematics
Scritch
A small CLI to help you write sharable scripts for your team
Stars: ✭ 74 (+0%)
Mutual labels:  cli
Conget
A CLI app for downloading file concurrently.
Stars: ✭ 72 (-2.7%)
Mutual labels:  cli
Console
The Console component eases the creation of beautiful and testable command line interfaces.
Stars: ✭ 8,988 (+12045.95%)
Mutual labels:  cli
Fbi
Node.js workflow tool
Stars: ✭ 74 (+0%)
Mutual labels:  cli
Nexmo Cli
Nexmo CLI (Command Line Interface)
Stars: ✭ 73 (-1.35%)
Mutual labels:  cli
Github Files Fetcher
Download a specific folder or file from a GitHub repo through command line
Stars: ✭ 73 (-1.35%)
Mutual labels:  cli
Listr2
NodeJS Task List derived from the best! Create beautiful CLI interfaces via easy and logical to implement task lists that feel alive and interactive.
Stars: ✭ 73 (-1.35%)
Mutual labels:  cli
Shark
A CLI to Interact with DigitalOcean
Stars: ✭ 74 (+0%)
Mutual labels:  cli
Dji Hardware Schematics
Community made schematics for the DJI drones and devices.
Stars: ✭ 72 (-2.7%)
Mutual labels:  schematics
Php codesniffer
PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.
Stars: ✭ 9,004 (+12067.57%)
Mutual labels:  cli
Angular Cli Webpack
Webpack configuration modifier for @angular/cli
Stars: ✭ 72 (-2.7%)
Mutual labels:  cli
Schematics Utilities
🛠️ Useful exported utilities for working with Schematics
Stars: ✭ 73 (-1.35%)
Mutual labels:  schematics
Omelette
Omelette is a simple, template based autocompletion tool for Node and Deno projects with super easy API. (For Bash, Zsh and Fish)
Stars: ✭ 1,184 (+1500%)
Mutual labels:  cli
Image To Xls
A simple tool to make ascii art from an image using excel colored cells.
Stars: ✭ 75 (+1.35%)
Mutual labels:  cli
Navi
An interactive cheatsheet tool for the command-line
Stars: ✭ 10,055 (+13487.84%)
Mutual labels:  cli

Schematics

This repository contains schematics for generating NGXS Store in Angular apps using the Angular CLI.

Installation

Install Angular CLI

You should be using @angular/[email protected] or newer.

npm i -g @angular/cli

Install NGXS Schematics

npm i @ngxs/schematics

Easy way to add NGXS Store in your application

To add NGXS Store in application, you can use ng add with @ngxs/schematics.

ng add @ngxs/schematics
Option Description
--skipInstall The flag to skip packages installing

Result:

Installed packages for tooling via npm.

  Adding npm dependencies

  ✅️ Added "@ngxs/devtools-plugin" into dependencies
  ✅️ Added "@ngxs/logger-plugin" into dependencies
  ✅️ Added "@ngxs/store" into dependencies
  ✅️ Added "@ngxs/schematics" into devDependencies

  Adding @ngxs/schematics to angular.json

  UPDATE package.json (2920 bytes)
  ✅️ Setting NGXS Schematics as default

  👏 Create your first ngxs store by using starter kit: ng g ngxs-sk --spec

  🔍 Installing packages...

Usage

Generating Components

You can use the ng generate (or just ng g) command to generate ngxs components:

ng generate @ngxs/schematics:store --name todo
ng g @ngxs/schematics:store --name todo

All possible commands in the table below:

Scaffold Usage Aliases Options
Store ng g @ngxs/schematics:store ngxs-store --name (required), --path, --sourceRoot, --spec (boolean)
State ng g @ngxs/schematics:state ngxs-state --name (required), --path, --sourceRoot, --spec (boolean)
Actions ng g @ngxs/schematics:actions ngxs-actions --name (required), --path, --sourceRoot
Starter Kit ng g @ngxs/schematics:starter-kit ngxs-sk --path, --sourceRoot, --spec (boolean)

Aliases

For used the aliases you need to set @ngxs/schematics as the default collection. Update your project's angular.json:

"cli": {
  "defaultCollection": "@ngxs/schematics"
}

Or simply use ng add @ngxs/schematics --skipInstall

Options

--name - there is a name of your store, state or actions
--spec - flag that allow to generate the test file
--sourceRoot - absolute path to create your files (in default - src)
--path - path relative to --sourceRoot (for example, --path=app -> /src/app)

Examples

Create a NGXS Store

To generate store with @ngxs/schematics:

ng generate @ngxs/schematics:store --name todo

Result:

CREATE src/todo/todo.actions.ts
CREATE src/todo/todo.state.ts

Or with spec:

ng generate @ngxs/schematics:store --name todo --spec

Result:

CREATE src/todo/todo.actions.ts
CREATE src/todo/todo.state.spec.ts
CREATE src/todo/todo.state.ts

Create a NGXS State

To generate state with @ngxs/schematics:

ng generate @ngxs/schematics:state --name todo

Result:

CREATE src/todo/todo.state.ts

Or with spec:

ng generate @ngxs/schematics:state --name todo --spec

Result:

CREATE src/todo/todo.state.spec.ts
CREATE src/todo/todo.state.ts

Create a NGXS Actions

To generate state with @ngxs/schematics:

ng generate @ngxs/schematics:actions --name todo

Result:

CREATE src/todo/todo.actions.ts

NGXS Starter Kit

Usage

To generate store with @ngxs/schematics:starter-kit:

ng generate @ngxs/schematics:starter-kit

Result:

CREATE src/store/store.config.ts
CREATE src/store/store.module.ts
CREATE src/store/auth/auth.actions.ts
CREATE src/store/auth/auth.state.ts
CREATE src/store/dashboard/index.ts
CREATE src/store/dashboard/states/dictionary/dictionary.actions.ts
CREATE src/store/dashboard/states/dictionary/dictionary.state.ts
CREATE src/store/dashboard/states/user/user.actions.ts
CREATE src/store/dashboard/states/user/user.state.ts

Or with spec:

ng generate @ngxs/schematics:starter-kit --spec

Result:

CREATE src/store/store.config.ts
CREATE src/store/store.module.ts
CREATE src/store/auth/auth.actions.ts
CREATE src/store/auth/auth.state.spec.ts
CREATE src/store/auth/auth.state.ts
CREATE src/store/dashboard/index.ts
CREATE src/store/dashboard/states/dictionary/dictionary.actions.ts
CREATE src/store/dashboard/states/dictionary/dictionary.state.spec.ts
CREATE src/store/dashboard/states/dictionary/dictionary.state.ts
CREATE src/store/dashboard/states/user/user.actions.ts
CREATE src/store/dashboard/states/user/user.state.spec.ts
CREATE src/store/dashboard/states/user/user.state.ts
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].