ng-alain / ng-alain

NG-ZORRO admin panel front-end framework (surge mirror https://ng-alain-doc.surge.sh)
https://ng-alain.com
MIT License
4.54k stars 1.16k forks source link

自定义模板时,cli生成list时,不生成组件,但更新了模块。 #2208

Closed xingkoo closed 2 years ago

xingkoo commented 2 years ago

Reproduction link

https://github.com/ng-alain/ng-alain/tree/master/_cli-tpl/test/path/name%40dasherize%40if-flat

Steps to reproduce

使用ng g ng-alain:list sms -m=services生成组件,不使用自定义时可以有效生成。自定义后,不生成组件,但更新模块导入。 我直接拿test目录改为_list也同样不可以生成。 文件拿delon中的list模板直接复制过来。也是同样的问题。 路径无误,_list/__path__/__name@dasherize@if-flat__/__name@dasherize_*

What is expected?

可以使用自定义模板

What is actually happening?

使用后不能正常生成组件,但在模型中却导出了这个不存在的组件。

Environment Info
ng-alain 13.2.0
Browser chrome
alain-bot[bot] commented 2 years ago

Translation of this issue:

When you customize the template, the CLI generates a component, does not generate a component, but the module is updated.

reproduction link

[https://github.com/ng-alain/ng-alain/tree/master/_cli-tpl/test/__path__/__name%40dasherize%40IF-FLAT__](Https://github.com/ng-alain/ Ng-alain / tree / master / _cli-tpl / test / path / name% 40dasherize% 40IF-FLAT)

steps to reproduce

Use NG G NG-alain: List SMS -M = Services to generate components, which can be effectively generated when customizing is used. After customization, no components are generated, but the module import is updated. I will change directly to the Test directory to _List or can also be generated. Document [List template in Delon] (https://github.com/ng-alain/delon/blob/master/schematics/list/files/_path____name%40dasherize%40IF-FLAT____Name%40dasherize__.component. Html.Template is directly copied. Also equaborable.

What is expected?

Custom template

What is actually happens?

The components are not generated normally after use, but this does not exist in the model.

ENVIRONMENT INFO
NG-alain 13.2.0
Browser Chrome
cipchk commented 2 years ago

我无法重现这种情况,以 NG-ALAIN 源代码的环境下,我的完整路径:

/Users/cipchk/Desktop/work/ng-alain/_cli-tpl/_list/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template

命令:

ng g ng-alain:list sms -m=delon

一切正常。

xingkoo commented 2 years ago

可能是我的用法有问题。在根目录下使用可以正常生成。切换到子目录下无法生成。(默认的可以生成) (主要是分了好多次子模块,在根目录下指定孙子父辈模块下生成。) image

image