Introducing Angular Schematics for Akita

Netanel Basal
Datorama Engineering
2 min readAug 7, 2018

--

akita-schematics provides CLI commands for generating files when building new features with Akita. Built on top of Angular Schematics, this tool integrates with the Angular CLI.

Whether you want to add Akita to your application or you’re already using it, you can use schematics to streamline the generation of Akita features.

Installation

Install akita-schematics from npm:

npm install akita-schematics --save-dev

Default Schematics Collection

To use akita-schematics as the default collection in your Angular CLI project,
add it to your angular.json file:

ng config cli.defaultCollection akita-schematics

The akita-schematics extends the default @schematics/angular collection.

Create a New Feature

ng g akita-schematics:feature todos/todos

The default command will output an entity based feature, but you can also generate a regular one:

ng g akita-schematics:feature todos/todos --plain

Note that the akita-schematics: prefix is only needed when the default collection isn’t set to akita-schematics .

Generate a Store

ng g akita-schematics:store todos
ng g akita-schematics:entity-store todos
Alias:
ng g akita-schematics:as todos
ng g akita-schematics:aes todos

Generate a Query

ng g akita-schematics:query todos
ng g akita-schematics:entity-query todos
Alias:
ng g akita-schematics:aq todos
ng g akita-schematics:aeq todos

For the full documentation check out the repo.

Things to not miss:

--

--

A FrontEnd Tech Lead, blogger, and open source maintainer. The founder of ngneat, husband and father.