Pluggable plugin

Foreword

Plugins are the add and remove of optional features, such as when you don't need code style (although I don't think so), only need to:

ng g ng-alain:plugin codeStyle -t=remove

Or add code style:

ng g ng-alain:plugin codeStyle

Command format

ng g ng-alain:plugin [plugin name] -t=[add | remove]

The [plugin name] is plugin name, -t supports two values add (default) and remove.

List of plugins

codeStyle

Code style rules:

# add
ng g ng-alain:plugin codeStyle
# remove
ng g ng-alain:plugin codeStyle -t=remove

docker

Support for Docker deployment.

# add
ng g ng-alain:plugin docker
# remove
ng g ng-alain:plugin docker -t=remove

defaultLanguage

Change the current default language, refer to: I18n - Default Language

# change to [en]
ng g ng-alain:plugin defaultLanguage --defaultLanguage=en
# change to [zh]
ng g ng-alain:plugin defaultLanguage --defaultLanguage=zh
# change to [zh-tw]
ng g ng-alain:plugin defaultLanguage --defaultLanguage=zh-tw

Supported language list

NameLanguage pack nameAngular packZorro packDelon pack
Simplified Chinesezh-Hans,zh-cn,zh-Hans-CN,zhzh-Hans,zh-cn,zh-Hans-CN,zhzh_CNzh_CN
Traditional Chinesezh-Hant,zh-tw,zh-Hant-TWzh-Hant,zh-tw,zh-Hant-TWzh_TWzh_TW
English (American)enenen_USen_US
Turkishtrtrtr_TRtr_TR
Polishplplpl_PLpl_PL
Greekelelel_GRel_GR
Koreankokoko_KRko_KR
Croatianhrhrhr_HRhr_HR
Slovenianslslsl_SIsl_SI
Frenchfrfrfr_FRfr_FR
Spanisheseses_ESes_ES
Italianititit_ITit_IT

networkEnv

Allow chinese users to add a taobao mirror configuration file .npmrc or .yarnrc to solve network problems.

# add npm
ng g ng-alain:plugin networkEnv --packageManager=npm
# add yarn
ng g ng-alain:plugin networkEnv --packageManager=yarn
# remove npm
ng g ng-alain:plugin networkEnv --packageManager=npm -t=remove
# remove yarn
ng g ng-alain:plugin networkEnv --packageManager=yarn -t=remove

sts

ng-alain-sts Plugins, Build Swagger APIs to list, edit pages, You can finish some interesting things.

# add
ng g ng-alain:plugin sts
# remove
ng g ng-alain:plugin sts -t=remove

icon

From the project to analyze and generate static load Icon, The plugin will automatically generate two files in the src directory:

  • src/style-icons.ts Custom Icon (e.g: remote menu icon)

  • src/style-icons-auto.ts command automatically generates files

Automatically exclude ng-zorro-antd and @delon already loaded icons.

ng g ng-alain:plugin icon

Also, you need to manually import in startup.service.ts:

import { ICONS_AUTO } from '../../../style-icons-auto';
import { ICONS } from '../../../style-icons';

@Injectable()
export class StartupService {
  constructor(iconSrv: NzIconService) {
    iconSrv.addIcon(...ICONS_AUTO, ...ICONS);
  }
}

Valid Grammar

<i class="anticon anticon-user"></i>
<i class="anticon anticon-question-circle-o"></i>
<i class="anticon anticon-spin anticon-loading"></i>
<i nz-icon class="anticon anticon-user"></i>
<i nz-icon nzType="align-{{type ? 'left' : 'right'}}"></i>
<i nz-icon [type]="type ? 'menu-fold' : 'menu-unfold'" [theme]="theme ? 'outline' : 'fill'"></i>
<i nz-icon [type]="type ? 'fullscreen' : 'fullscreen-exit'"></i>
<i nz-icon [nzType]="d.status === 'NORMAL' ? 'close1' : 'close2'"></i>
<i nz-icon nzType="{{ type ? 'arrow-left' : 'arrow-right' }}"></i>
<i nz-icon nzType="filter" theme="outline"></i>
<nz-input-group [nzAddOnBeforeIcon]="focus ? 'anticon anticon-arrow-down' : 'anticon anticon-search'"></nz-input-group>

rtl

Support RTL plug-in, the text direction is set to "from right to left".

ng g ng-alain:plugin rtl

The plug-in does not support hot swap, if you need to remove it, please handle it manually.