4.1.0 • Published 5 years ago

@lernato/schematics v4.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Install

npm i @lernato/schematics

Schematics

setup-jest

ng generate @lernato/schematics:setup-jest

Parameters

No parameters.

Description

Replace Karma with Jest as the unit test framework in a standard Angular project.

Uninstalls Karma and installs Jest.

Deletes src/karma.conf.js and src/test.ts

Creates src/jest.config.js

setup-prettier

ng generate @lernato/schematics:setup-prettier

Parameters

No parameters.

Description

Add the prettier code formatter to your project. Also modifies tslint.json. Totally opinionated - you might not agree with it, so don't use it if you don't like it.

Creates prettier.config.js

setup-styles

ng generate @lernato/schematics:setup-styles

Parameters

No parameters.

Description

Add some default styles to your project. Also creates an angular material theme file, and imports it into your html via your angular.json file.

Overwrites src/styles.scss

Generates the following files

  • src/material.scss
  • src/styles/
    • material-overrides/
      • gitkeep
    • _colors.scss
    • _fonts.scss
    • _globals.scss
    • _spacing.scss

setup-project

ng generate @lernato/schematics:setup-project

Parameters

No parameters.

Description

Calls the other setup schematics

  • setup-jest
  • setup-prettier
  • setup-styles

component

ng generate @lernato/schematics:component -n <component-name> -p <html-prefix>

Parameters

--name, -nstringREQUIREDThe name of the component.
--prefix, -pstringREQUIREDThe html element prefix for your component.
--module, -mbooleandefault: trueCreate a module for the component.
--route, -rbooleandefault: falseCreate a routable module for the component.

Description

Generate an Angular component. Places files in src/app/components.

Generates the following files

  • src/app/components/<component-name>
    • index.ts
    • <component-name>.component.html
    • <component-name>.component.scss
    • <component-name>.component.spec.ts
    • <component-name>.component.ts

If module or route are set, it also generates a module file at:

src/app/components/<component-name>/<component-name>.module.ts

dialog

ng generate @lernato/schematics:dialog  -n <dialog-name> -p <html-prefix>

Parameters

--name, -nstringREQUIREDThe name of the dialog.
--prefix, -pstringREQUIREDThe html element prefix for your dialog.

Description

Generate an Angular Material dialog component. Places files in src/app/components.

Generates the following files

  • src/app/components/<dialog-name>-dialog
    • index.ts
    • <dialog-name>-dialog-body.component.html
    • <dialog-name>-dialog-body.component.scss
    • <dialog-name>-dialog-body.component.spec.ts
    • <dialog-name>-dialog-body.component.ts
    • <dialog-name>-dialog.component.html
    • <dialog-name>-dialog.component.scss
    • <dialog-name>-dialog.component.spec.ts
    • <dialog-name>-dialog.component.ts
    • <dialog-name>-dialog.module.ts

model

ng generate @lernato/schematics:model -n <model-name>

Parameters

--name, -nstringREQUIREDThe name of the dialog.

Description

Generate a model, with unit tests, and automatically add it to the exports from src/app/models/index.ts

Creates src/app/models/index.ts if it does not already exist.

Places files in src/app/models.

Generates the following files

  • src/app/models/<model-name>
    • index.ts
    • <model-name>.model.spec.ts
    • <model-name>.model.ts

service

ng generate @lernato/schematics:service -n <service-name>

Parameters

--name, -nstringREQUIREDThe name of the dialog.

Description

Generate an Angular service, with unit tests, and automatically add it to the exports from src/app/services/index.ts

Creates src/app/services/index.ts if it does not already exist.

Places files in src/app/services.

Generates the following files

  • src/app/services/<service-name>
    • index.ts
    • <service-name>.service.spec.ts
    • <service-name>.service.ts
4.1.0

5 years ago

4.0.4

5 years ago

4.0.3

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago