ng-alain 12.4.1 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/application/files/src/app/core/i18n/i18n.service.ts +1 -1
  2. package/application/files/src/app/core/net/default.interceptor.ts +1 -1
  3. package/application/files/src/app/layout/basic/widgets/clear-storage.component.ts +1 -1
  4. package/application/files/src/app/layout/basic/widgets/fullscreen.component.ts +5 -8
  5. package/application/files/src/app/layout/basic/widgets/i18n.component.ts +3 -0
  6. package/application/files/src/app/layout/passport/passport.component.less +1 -1
  7. package/application/files/src/app/routes/exception/exception.component.ts +1 -1
  8. package/application/files/src/app/routes/passport/callback.component.ts +1 -1
  9. package/application/files/src/app/routes/passport/login/login.component.less +1 -1
  10. package/application/files/src/app/routes/passport/login/login.component.ts +4 -4
  11. package/application/files/src/app/routes/passport/register/register.component.less +1 -1
  12. package/application/files/src/app/routes/passport/register/register.component.ts +5 -5
  13. package/application/files/src/app/routes/passport/register-result/register-result.component.ts +1 -1
  14. package/application/files/src/styles/theme.less +1 -1
  15. package/application/files/src/styles.less +5 -5
  16. package/application/files/src/test.ts +3 -1
  17. package/application/index.js +44 -43
  18. package/application/index.js.map +1 -1
  19. package/application/index.ts +11 -8
  20. package/application/schema.json +1 -1
  21. package/collection.json +2 -3
  22. package/curd/index.js +2 -2
  23. package/curd/index.js.map +1 -1
  24. package/curd/schema.json +34 -27
  25. package/docs/generate.en-US.md +7 -7
  26. package/docs/generate.zh-CN.md +7 -7
  27. package/docs/plugin.en-US.md +0 -13
  28. package/docs/plugin.zh-CN.md +0 -13
  29. package/edit/index.js +1 -1
  30. package/edit/index.js.map +1 -1
  31. package/edit/schema.json +2 -7
  32. package/empty/index.js +1 -1
  33. package/empty/index.js.map +1 -1
  34. package/empty/schema.json +2 -7
  35. package/list/index.js +1 -1
  36. package/list/index.js.map +1 -1
  37. package/list/schema.json +2 -7
  38. package/migration.json +5 -10
  39. package/module/index.js +18 -18
  40. package/module/index.js.map +1 -1
  41. package/module/schema.json +1 -1
  42. package/ng-add/index.js +24 -26
  43. package/ng-add/index.js.map +1 -1
  44. package/ng-add/index.spec.ts +13 -3
  45. package/ng-add/index.ts +19 -21
  46. package/ng-add/schema.json +1 -1
  47. package/ng-update/data/attribute-selectors.js +1 -1
  48. package/ng-update/data/attribute-selectors.ts +1 -1
  49. package/ng-update/data/class-names.js +1 -1
  50. package/ng-update/data/class-names.ts +1 -1
  51. package/ng-update/data/constructor-checks.js +1 -1
  52. package/ng-update/data/constructor-checks.ts +1 -1
  53. package/ng-update/data/css-selectors.js +1 -1
  54. package/ng-update/data/css-selectors.ts +1 -1
  55. package/ng-update/data/element-selectors.js +1 -1
  56. package/ng-update/data/element-selectors.ts +1 -1
  57. package/ng-update/data/input-names.js +1 -1
  58. package/ng-update/data/input-names.ts +1 -1
  59. package/ng-update/data/method-call-checks.js +1 -1
  60. package/ng-update/data/method-call-checks.ts +1 -1
  61. package/ng-update/data/output-names.js +1 -1
  62. package/ng-update/data/output-names.ts +1 -1
  63. package/ng-update/data/property-names.js +1 -1
  64. package/ng-update/data/property-names.ts +1 -1
  65. package/ng-update/index.js +8 -13
  66. package/ng-update/index.js.map +1 -1
  67. package/ng-update/index.ts +5 -10
  68. package/ng-update/upgrade-data.js +3 -1
  69. package/ng-update/upgrade-data.js.map +1 -1
  70. package/ng-update/upgrade-data.ts +3 -2
  71. package/ng-update/upgrade-rules/checks/_src-to-nz-image-rule.js +1 -1
  72. package/ng-update/upgrade-rules/checks/_src-to-nz-image-rule.js.map +1 -1
  73. package/ng-update/upgrade-rules/v12/index.js +32 -32
  74. package/ng-update/upgrade-rules/v12/index.js.map +1 -1
  75. package/ng-update/upgrade-rules/v12/index.ts +1 -5
  76. package/ng-update/upgrade-rules/v12/schema.json +1 -1
  77. package/ng-update/upgrade-rules/v13/index.js +100 -0
  78. package/ng-update/upgrade-rules/v13/index.js.map +1 -0
  79. package/ng-update/upgrade-rules/v13/index.spec.ts +39 -0
  80. package/ng-update/upgrade-rules/v13/index.ts +111 -0
  81. package/package.json +1 -1
  82. package/plugin/files/rtl/layout/basic/widgets/rtl.component.ts +1 -1
  83. package/plugin/index.js +10 -14
  84. package/plugin/index.js.map +1 -1
  85. package/plugin/index.ts +0 -4
  86. package/plugin/plugin.code-style.js +2 -2
  87. package/plugin/plugin.code-style.js.map +1 -1
  88. package/plugin/plugin.default-language.js +3 -3
  89. package/plugin/plugin.default-language.js.map +1 -1
  90. package/plugin/plugin.default-language.ts +1 -1
  91. package/plugin/plugin.docker.js +6 -6
  92. package/plugin/plugin.docker.js.map +1 -1
  93. package/plugin/plugin.icon.js +7 -7
  94. package/plugin/plugin.icon.js.map +1 -1
  95. package/plugin/plugin.icon.ts +2 -2
  96. package/plugin/plugin.rtl.js +11 -11
  97. package/plugin/plugin.rtl.js.map +1 -1
  98. package/plugin/plugin.sts.js +1 -1
  99. package/plugin/plugin.sts.js.map +1 -1
  100. package/plugin/schema.json +1 -1
  101. package/schema.json +10 -0
  102. package/sta/index.js +13 -13
  103. package/sta/index.js.map +1 -1
  104. package/sta/schema.json +1 -1
  105. package/tpl/index.js +2 -2
  106. package/tpl/index.js.map +1 -1
  107. package/tpl/index.ts +1 -1
  108. package/tpl/schema.json +3 -8
  109. package/utils/alain.js +17 -18
  110. package/utils/alain.js.map +1 -1
  111. package/utils/alain.ts +1 -2
  112. package/utils/file.js +2 -2
  113. package/utils/file.js.map +1 -1
  114. package/utils/html.js +1 -1
  115. package/utils/html.js.map +1 -1
  116. package/utils/json.js +1 -1
  117. package/utils/json.js.map +1 -1
  118. package/utils/lib-versions.js +2 -2
  119. package/utils/lib-versions.ts +2 -2
  120. package/utils/log.js +3 -3
  121. package/utils/log.js.map +1 -1
  122. package/utils/log.ts +3 -3
  123. package/utils/node.js +8 -0
  124. package/utils/node.js.map +1 -0
  125. package/utils/node.ts +3 -0
  126. package/utils/package.js +4 -4
  127. package/utils/package.js.map +1 -1
  128. package/utils/package.ts +2 -2
  129. package/utils/testing.js +3 -3
  130. package/utils/testing.js.map +1 -1
  131. package/utils/versions.js +24 -20
  132. package/utils/versions.js.map +1 -1
  133. package/utils/versions.ts +20 -16
  134. package/utils/workspace.js +25 -6
  135. package/utils/workspace.js.map +1 -1
  136. package/utils/workspace.ts +15 -0
  137. package/view/index.js +1 -1
  138. package/view/index.js.map +1 -1
  139. package/view/schema.json +2 -7
  140. package/ng-update/upgrade-rules/v11/files-tpl/main.js +0 -31
  141. package/ng-update/upgrade-rules/v11/files-tpl/main.js.map +0 -1
  142. package/ng-update/upgrade-rules/v11/files-tpl/main.ts +0 -28
  143. package/ng-update/upgrade-rules/v11/hmr.js +0 -103
  144. package/ng-update/upgrade-rules/v11/hmr.js.map +0 -1
  145. package/ng-update/upgrade-rules/v11/hmr.ts +0 -109
  146. package/ng-update/upgrade-rules/v11/index.js +0 -72
  147. package/ng-update/upgrade-rules/v11/index.js.map +0 -1
  148. package/ng-update/upgrade-rules/v11/index.spec.ts +0 -51
  149. package/ng-update/upgrade-rules/v11/index.ts +0 -80
  150. package/ng-update/upgrade-rules/v11/layout.js +0 -39
  151. package/ng-update/upgrade-rules/v11/layout.js.map +0 -1
  152. package/ng-update/upgrade-rules/v11/layout.ts +0 -47
  153. package/ng-update/upgrade-rules/v117/index.js +0 -82
  154. package/ng-update/upgrade-rules/v117/index.js.map +0 -1
  155. package/ng-update/upgrade-rules/v117/index.spec.ts +0 -58
  156. package/ng-update/upgrade-rules/v117/index.ts +0 -71
  157. package/plugin/files/ie/tsconfig-es5.app.js +0 -9
  158. package/plugin/files/ie/tsconfig-es5.app.js.map +0 -1
  159. package/plugin/files/ie/tsconfig-es5.spec.js +0 -9
  160. package/plugin/files/ie/tsconfig-es5.spec.js.map +0 -1
  161. package/plugin/plugin.ie.js +0 -128
  162. package/plugin/plugin.ie.js.map +0 -1
  163. package/plugin/plugin.ie.spec.ts +0 -35
  164. package/plugin/plugin.ie.ts +0 -144
package/curd/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "SchematicsNgAlainCURDComponent",
4
4
  "title": "Ng Alain CURD Component Options Schema",
5
5
  "type": "object",
@@ -7,7 +7,7 @@
7
7
  "path": {
8
8
  "type": "string",
9
9
  "format": "path",
10
- "description": "The path to create the component.",
10
+ "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.",
11
11
  "visible": false
12
12
  },
13
13
  "project": {
@@ -24,27 +24,37 @@
24
24
  "$source": "argv",
25
25
  "index": 0
26
26
  },
27
- "x-prompt": "What name would you like to use for the component:"
27
+ "x-prompt": "What name would you like to use for the component?"
28
+ },
29
+ "displayBlock": {
30
+ "description": "Specifies if the style will contain `:host { display: block; }`.",
31
+ "type": "boolean",
32
+ "default": false,
33
+ "alias": "b"
28
34
  },
29
35
  "inlineStyle": {
30
- "description": "Specifies if the style will be in the ts file.",
36
+ "description": "Include styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.",
31
37
  "type": "boolean",
32
38
  "default": false,
33
- "alias": "s"
39
+ "alias": "s",
40
+ "x-user-analytics": 9
34
41
  },
35
42
  "inlineTemplate": {
36
- "description": "Specifies if the template will be in the ts file.",
43
+ "description": "Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.",
37
44
  "type": "boolean",
38
- "default": false
45
+ "default": false,
46
+ "alias": "t",
47
+ "x-user-analytics": 10
39
48
  },
40
49
  "viewEncapsulation": {
41
- "description": "Specifies the view encapsulation strategy.",
42
- "enum": ["Emulated", "Native", "None", "ShadowDom"],
50
+ "description": "The view encapsulation strategy to use in the new component.",
51
+ "enum": ["Emulated", "None", "ShadowDom"],
43
52
  "type": "string",
44
- "alias": "v"
53
+ "alias": "v",
54
+ "x-user-analytics": 11
45
55
  },
46
56
  "changeDetection": {
47
- "description": "Specifies the change detection strategy.",
57
+ "description": "The change detection strategy to use in the new component.",
48
58
  "enum": ["Default", "OnPush"],
49
59
  "type": "string",
50
60
  "default": "Default",
@@ -52,7 +62,7 @@
52
62
  },
53
63
  "prefix": {
54
64
  "type": "string",
55
- "description": "The prefix to apply to generated selectors.",
65
+ "description": "The prefix to apply to the generated component selector.",
56
66
  "alias": "p",
57
67
  "oneOf": [
58
68
  {
@@ -65,10 +75,10 @@
65
75
  ]
66
76
  },
67
77
  "style": {
68
- "description": "The file extension or preprocessor to use for style files.",
78
+ "description": "The file extension or preprocessor to use for style files, or 'none' to skip generating the style file.",
69
79
  "type": "string",
70
80
  "default": "css",
71
- "enum": ["css", "scss", "sass", "less", "styl"],
81
+ "enum": ["css", "scss", "sass", "less", "none"],
72
82
  "x-user-analytics": 5
73
83
  },
74
84
  "type": {
@@ -84,33 +94,30 @@
84
94
  },
85
95
  "flat": {
86
96
  "type": "boolean",
87
- "description": "Flag to indicate if a directory is created.",
97
+ "description": "Create the new files at the top level of the current project.",
88
98
  "default": false
89
99
  },
90
100
  "skipImport": {
91
101
  "type": "boolean",
92
- "description": "Flag to skip the module import.",
93
- "default": false
102
+ "description": "Do not import this component into the owning NgModule.",
103
+ "default": false,
104
+ "x-user-analytics": 18
94
105
  },
95
106
  "selector": {
96
107
  "type": "string",
97
108
  "format": "html-selector",
98
- "description": "The selector to use for the component."
99
- },
100
- "export": {
101
- "type": "boolean",
102
- "default": false,
103
- "description": "Specifies if declaring module exports the component."
109
+ "description": "The HTML selector to use for this component."
104
110
  },
105
- "entryComponent": {
111
+ "skipSelector": {
106
112
  "type": "boolean",
107
113
  "default": false,
108
- "description": "Specifies if the component is an entry component of declaring module."
114
+ "description": "Specifies if the component should have a selector or not."
109
115
  },
110
- "lintFix": {
116
+ "export": {
111
117
  "type": "boolean",
112
118
  "default": false,
113
- "description": "Specifies whether to apply lint fixes after generating the component."
119
+ "description": "The declaring NgModule exports this component.",
120
+ "x-user-analytics": 19
114
121
  },
115
122
  "withoutPrefix": {
116
123
  "type": "boolean",
@@ -21,11 +21,11 @@ Examples:
21
21
 
22
22
  ```bash
23
23
  # Generate a trade module
24
- ng g ng-alain:trade
24
+ ng g ng-alain:module trade
25
25
  # Generate a TradeListComponent List component under the trade module
26
26
  ng g ng-alain:list list -m=trade
27
27
  # Generate a ListComponent List component under the trade module
28
- ng g ng-alain:list list -m=trade -withoutModulePrefixInComponentName=true
28
+ ng g ng-alain:list list -m=trade --withoutModulePrefixInComponentName=true
29
29
  # Generate a TradeEditComponent Edit component under the trade module
30
30
  ng g ng-alain:edit edit -m=trade
31
31
  ```
@@ -34,11 +34,11 @@ ng g ng-alain:edit edit -m=trade
34
34
 
35
35
  | Option | Description |
36
36
  | ---- | --- |
37
- | `-m` | Allows specification of the declaring module. |
38
- | `-target` | Specifies relative path, could be set like `bus/list` |
39
- | `-modal` | Specifies using modal mode |
40
- | `-withoutPrefix` | Without prefix to selectors |
41
- | `-withoutModulePrefixInComponentName` | Without prefix to component name |
37
+ | `-m` or `--module` | Allows specification of the declaring module. |
38
+ | `-t` or `--target` | Specifies relative path, could be set like `bus/list` |
39
+ | `--modal` | Specifies using modal mode |
40
+ | `--withoutPrefix` | Without prefix to selectors |
41
+ | `--withoutModulePrefixInComponentName` | Without prefix to component name |
42
42
 
43
43
  ## Module
44
44
 
@@ -35,11 +35,11 @@ ng g ng-alain:[command name] [name] [options]
35
35
 
36
36
  ```bash
37
37
  # 生成一个 trade 模块
38
- ng g ng-alain:trade
38
+ ng g ng-alain:module trade
39
39
  # trade 模块下生成一个 TradeListComponent List组件
40
40
  ng g ng-alain:list list -m=trade
41
41
  # trade 模块下生成一个 ListComponent List组件
42
- ng g ng-alain:list list -m=trade -withoutModulePrefixInComponentName=true
42
+ ng g ng-alain:list list -m=trade --withoutModulePrefixInComponentName=true
43
43
  # trade 模块下生成一个 TradeEditComponent Edit组件
44
44
  ng g ng-alain:edit edit -m=trade
45
45
  ```
@@ -48,11 +48,11 @@ ng g ng-alain:edit edit -m=trade
48
48
 
49
49
  | 参数 | 描述 |
50
50
  | ---- | --- |
51
- | `-m` | 指定目标模块 |
52
- | `-target` | 指定目标路径,支持 `bus/list` 写法 |
53
- | `-modal` | 指定是否使用模态框 |
54
- | `-withoutPrefix` | 指定选择器名不加前缀 |
55
- | `-withoutModulePrefixInComponentName` | 组件名不加模块名前缀 |
51
+ | `-m` 或 `--module` | 指定目标模块 |
52
+ | `-t` 或 `--target` | 指定目标路径,支持 `bus/list` 写法 |
53
+ | `--modal` | 指定是否使用模态框 |
54
+ | `--withoutPrefix` | 指定选择器名不加前缀 |
55
+ | `--withoutModulePrefixInComponentName` | 组件名不加模块名前缀 |
56
56
 
57
57
  ## Module 模块
58
58
 
@@ -44,19 +44,6 @@ ng g ng-alain:plugin codeStyle
44
44
  ng g ng-alain:plugin codeStyle -t=remove
45
45
  ```
46
46
 
47
- ### ie
48
-
49
- IE browser can only be used under ES5. For more details, please refer to [Support IE11](/docs/ie11).
50
-
51
- ```bash
52
- # add
53
- ng g ng-alain:plugin ie
54
- # remove
55
- ng g ng-alain:plugin ie -t=remove
56
- ```
57
-
58
- After installation, you can use `npm run ie: start` to enter IE11 development environment.
59
-
60
47
  ### docker
61
48
 
62
49
  Support for Docker deployment.
@@ -46,19 +46,6 @@ ng g ng-alain:plugin codeStyle
46
46
  ng g ng-alain:plugin codeStyle -t=remove
47
47
  ```
48
48
 
49
- ### ie
50
-
51
- IE 浏览器只能在 ES5 下使用,有关更多细节请参考[支持IE11](/docs/ie11)。
52
-
53
- ```bash
54
- # add
55
- ng g ng-alain:plugin ie
56
- # remove
57
- ng g ng-alain:plugin ie -t=remove
58
- ```
59
-
60
- 安装后可使用 `npm run ie:start` 进入IE11的开发环境。
61
-
62
49
  ### docker
63
50
 
64
51
  支持 Docker 部署。
package/edit/index.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const schematics_1 = require("@angular-devkit/schematics");
4
4
  const utils_1 = require("../utils");
5
5
  function default_1(options) {
6
- return schematics_1.chain([utils_1.buildAlain(Object.assign({ schematicName: 'edit' }, options))]);
6
+ return (0, schematics_1.chain)([(0, utils_1.buildAlain)(Object.assign({ schematicName: 'edit' }, options))]);
7
7
  }
8
8
  exports.default = default_1;
9
9
  //# sourceMappingURL=index.js.map
package/edit/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/edit/index.ts"],"names":[],"mappings":";;AAAA,2DAAyD;AAEzD,oCAAsC;AAGtC,mBAAyB,OAAe;IACtC,OAAO,kBAAK,CAAC,CAAC,kBAAU,iBAAG,aAAa,EAAE,MAAM,IAAK,OAAO,EAAG,CAAC,CAAC,CAAC;AACpE,CAAC;AAFD,4BAEC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/edit/index.ts"],"names":[],"mappings":";;AAAA,2DAAyD;AAEzD,oCAAsC;AAGtC,mBAAyB,OAAe;IACtC,OAAO,IAAA,kBAAK,EAAC,CAAC,IAAA,kBAAU,kBAAG,aAAa,EAAE,MAAM,IAAK,OAAO,EAAG,CAAC,CAAC,CAAC;AACpE,CAAC;AAFD,4BAEC"}
package/edit/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "SchematicsNgAlainEditComponent",
4
4
  "title": "Ng Alain Edit Component Options Schema",
5
5
  "type": "object",
@@ -44,6 +44,7 @@
44
44
  "description": "Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.",
45
45
  "type": "boolean",
46
46
  "default": false,
47
+ "alias": "t",
47
48
  "x-user-analytics": 10
48
49
  },
49
50
  "viewEncapsulation": {
@@ -119,12 +120,6 @@
119
120
  "description": "The declaring NgModule exports this component.",
120
121
  "x-user-analytics": 19
121
122
  },
122
- "lintFix": {
123
- "type": "boolean",
124
- "description": "Apply lint fixes after generating the component.",
125
- "x-user-analytics": 15,
126
- "x-deprecated": "Use \"ng lint --fix\" directly instead."
127
- },
128
123
  "withoutPrefix": {
129
124
  "type": "boolean",
130
125
  "description": "指定选择器名不加前缀 (Without prefix to selectors)",
package/empty/index.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const schematics_1 = require("@angular-devkit/schematics");
4
4
  const utils_1 = require("../utils");
5
5
  function default_1(options) {
6
- return schematics_1.chain([utils_1.buildAlain(Object.assign({ schematicName: 'empty' }, options))]);
6
+ return (0, schematics_1.chain)([(0, utils_1.buildAlain)(Object.assign({ schematicName: 'empty' }, options))]);
7
7
  }
8
8
  exports.default = default_1;
9
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/empty/index.ts"],"names":[],"mappings":";;AAAA,2DAAyD;AAEzD,oCAAsC;AAGtC,mBAAyB,OAAe;IACtC,OAAO,kBAAK,CAAC,CAAC,kBAAU,iBAAG,aAAa,EAAE,OAAO,IAAK,OAAO,EAAG,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,4BAEC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/empty/index.ts"],"names":[],"mappings":";;AAAA,2DAAyD;AAEzD,oCAAsC;AAGtC,mBAAyB,OAAe;IACtC,OAAO,IAAA,kBAAK,EAAC,CAAC,IAAA,kBAAU,kBAAG,aAAa,EAAE,OAAO,IAAK,OAAO,EAAG,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,4BAEC"}
package/empty/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "SchematicsNgAlainEmptyComponent",
4
4
  "title": "Ng Alain Empty Component Options Schema",
5
5
  "type": "object",
@@ -44,6 +44,7 @@
44
44
  "description": "Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.",
45
45
  "type": "boolean",
46
46
  "default": false,
47
+ "alias": "t",
47
48
  "x-user-analytics": 10
48
49
  },
49
50
  "viewEncapsulation": {
@@ -119,12 +120,6 @@
119
120
  "description": "The declaring NgModule exports this component.",
120
121
  "x-user-analytics": 19
121
122
  },
122
- "lintFix": {
123
- "type": "boolean",
124
- "description": "Apply lint fixes after generating the component.",
125
- "x-user-analytics": 15,
126
- "x-deprecated": "Use \"ng lint --fix\" directly instead."
127
- },
128
123
  "withoutPrefix": {
129
124
  "type": "boolean",
130
125
  "description": "指定选择器名不加前缀 (Without prefix to selectors)",
package/list/index.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const schematics_1 = require("@angular-devkit/schematics");
4
4
  const utils_1 = require("../utils");
5
5
  function default_1(options) {
6
- return schematics_1.chain([utils_1.buildAlain(Object.assign({ schematicName: 'list' }, options))]);
6
+ return (0, schematics_1.chain)([(0, utils_1.buildAlain)(Object.assign({ schematicName: 'list' }, options))]);
7
7
  }
8
8
  exports.default = default_1;
9
9
  //# sourceMappingURL=index.js.map
package/list/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/list/index.ts"],"names":[],"mappings":";;AAAA,2DAAyD;AAEzD,oCAAsC;AAGtC,mBAAyB,OAAe;IACtC,OAAO,kBAAK,CAAC,CAAC,kBAAU,iBAAG,aAAa,EAAE,MAAM,IAAK,OAAO,EAAG,CAAC,CAAC,CAAC;AACpE,CAAC;AAFD,4BAEC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/list/index.ts"],"names":[],"mappings":";;AAAA,2DAAyD;AAEzD,oCAAsC;AAGtC,mBAAyB,OAAe;IACtC,OAAO,IAAA,kBAAK,EAAC,CAAC,IAAA,kBAAU,kBAAG,aAAa,EAAE,MAAM,IAAK,OAAO,EAAG,CAAC,CAAC,CAAC;AACpE,CAAC;AAFD,4BAEC"}
package/list/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "SchematicsNgAlainListComponent",
4
4
  "title": "Ng Alain List Component Options Schema",
5
5
  "type": "object",
@@ -44,6 +44,7 @@
44
44
  "description": "Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.",
45
45
  "type": "boolean",
46
46
  "default": false,
47
+ "alias": "t",
47
48
  "x-user-analytics": 10
48
49
  },
49
50
  "viewEncapsulation": {
@@ -119,12 +120,6 @@
119
120
  "description": "The declaring NgModule exports this component.",
120
121
  "x-user-analytics": 19
121
122
  },
122
- "lintFix": {
123
- "type": "boolean",
124
- "description": "Apply lint fixes after generating the component.",
125
- "x-user-analytics": 15,
126
- "x-deprecated": "Use \"ng lint --fix\" directly instead."
127
- },
128
123
  "withoutPrefix": {
129
124
  "type": "boolean",
130
125
  "description": "指定选择器名不加前缀 (Without prefix to selectors)",
package/migration.json CHANGED
@@ -1,21 +1,16 @@
1
1
  {
2
2
  "$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json",
3
3
  "schematics": {
4
- "migration-v11": {
5
- "version": "11",
6
- "description": "Updates NG-ALAIN to v11 [https://github.com/ng-alain/ng-alain/issues/1863]",
7
- "factory": "./ng-update/index#updateToV11"
8
- },
9
- "migration-v117": {
10
- "version": "11.7.0",
11
- "description": "Updates NG-ALAIN to v11.7.0",
12
- "factory": "./ng-update/index#updateToV117"
13
- },
14
4
  "migration-v12": {
15
5
  "version": "12",
16
6
  "description": "Updates NG-ALAIN to v12 [https://github.com/ng-alain/ng-alain/issues/2027]",
17
7
  "factory": "./ng-update/index#updateToV12"
18
8
  },
9
+ "migration-v13": {
10
+ "version": "13",
11
+ "description": "Updates NG-ALAIN to v13 [https://github.com/ng-alain/ng-alain/issues/2174]",
12
+ "factory": "./ng-update/index#updateToV13"
13
+ },
19
14
  "ng-post-update": {
20
15
  "description": "Performs cleanup after ng-update.",
21
16
  "factory": "./ng-update/index#postUpdate",
package/module/index.js CHANGED
@@ -22,17 +22,17 @@ function addDeclarationToNgModule(options) {
22
22
  if (!options.module) {
23
23
  return tree;
24
24
  }
25
- const modulePath = core_1.normalize(`/${options.module}`);
25
+ const modulePath = (0, core_1.normalize)(`/${options.module}`);
26
26
  const text = tree.read(modulePath);
27
27
  if (text === null) {
28
28
  throw new schematics_1.SchematicsException(`File ${modulePath} does not exist.`);
29
29
  }
30
30
  const sourceText = text.toString('utf-8');
31
31
  const source = ts.createSourceFile(modulePath, sourceText, ts.ScriptTarget.Latest, true);
32
- const importModulePath = core_1.normalize(`/${options.path}/${options.flat ? '' : `${core_1.strings.dasherize(options.name)}/`}${core_1.strings.dasherize(options.name)}.module`);
33
- const relativeDir = core_1.relative(core_1.dirname(modulePath), core_1.dirname(importModulePath));
34
- const relativePath = `${relativeDir.startsWith('.') ? relativeDir : `./${relativeDir}`}/${core_1.basename(importModulePath)}`;
35
- const changes = ast_utils_1.addImportToModule(source, modulePath, core_1.strings.classify(`${options.name}Module`), relativePath);
32
+ const importModulePath = (0, core_1.normalize)(`/${options.path}/${options.flat ? '' : `${core_1.strings.dasherize(options.name)}/`}${core_1.strings.dasherize(options.name)}.module`);
33
+ const relativeDir = (0, core_1.relative)((0, core_1.dirname)(modulePath), (0, core_1.dirname)(importModulePath));
34
+ const relativePath = `${relativeDir.startsWith('.') ? relativeDir : `./${relativeDir}`}/${(0, core_1.basename)(importModulePath)}`;
35
+ const changes = (0, ast_utils_1.addImportToModule)(source, modulePath, core_1.strings.classify(`${options.name}Module`), relativePath);
36
36
  const recorder = tree.beginUpdate(modulePath);
37
37
  for (const change of changes) {
38
38
  if (change instanceof change_1.InsertChange) {
@@ -45,13 +45,13 @@ function addDeclarationToNgModule(options) {
45
45
  }
46
46
  function addRoutingModuleToTop(options) {
47
47
  return (tree) => {
48
- const modulePath = core_1.normalize(`${options.path}/routes-routing.module.ts`);
48
+ const modulePath = (0, core_1.normalize)(`${options.path}/routes-routing.module.ts`);
49
49
  if (!tree.exists(modulePath)) {
50
50
  return tree;
51
51
  }
52
52
  const sourceText = tree.read(modulePath).toString('utf-8');
53
53
  const source = ts.createSourceFile(modulePath, sourceText, ts.ScriptTarget.Latest, true);
54
- const routesNode = ast_utils_1.findNode(source, ts.SyntaxKind.Identifier, 'routes');
54
+ const routesNode = (0, ast_utils_1.findNode)(source, ts.SyntaxKind.Identifier, 'routes');
55
55
  if (routesNode == null || routesNode.parent == null) {
56
56
  return tree;
57
57
  }
@@ -60,7 +60,7 @@ function addRoutingModuleToTop(options) {
60
60
  parentNode.initializer.getChildCount() === 0) {
61
61
  return tree;
62
62
  }
63
- const childrenNode = ast_utils_1.findNode(parentNode.initializer, ts.SyntaxKind.Identifier, 'children');
63
+ const childrenNode = (0, ast_utils_1.findNode)(parentNode.initializer, ts.SyntaxKind.Identifier, 'children');
64
64
  if (childrenNode == null || childrenNode.parent == null) {
65
65
  return tree;
66
66
  }
@@ -76,23 +76,23 @@ function addRoutingModuleToTop(options) {
76
76
  }
77
77
  function default_1(schema) {
78
78
  return (tree) => __awaiter(this, void 0, void 0, function* () {
79
- const proj = yield utils_1.getProject(tree, schema.project);
80
- utils_1.refreshPathRoot(proj.project, schema, proj.alainProject);
79
+ const proj = yield (0, utils_1.getProject)(tree, schema.project);
80
+ (0, utils_1.refreshPathRoot)(proj.project, schema, proj.alainProject);
81
81
  if (schema.module) {
82
- schema.module = find_module_1.findModuleFromOptions(tree, schema);
82
+ schema.module = (0, find_module_1.findModuleFromOptions)(tree, schema);
83
83
  }
84
- const parsedPath = parse_name_1.parseName(schema.path, schema.name);
84
+ const parsedPath = (0, parse_name_1.parseName)(schema.path, schema.name);
85
85
  schema.name = parsedPath.name;
86
86
  schema.path = parsedPath.path;
87
87
  schema.routing = true;
88
88
  schema.flat = false;
89
- const templateSource = schematics_1.apply(schematics_1.url('./files'), [
90
- schema.routing ? schematics_1.noop() : schematics_1.filter(path => !path.endsWith('-routing.module.ts')),
91
- schematics_1.applyTemplates(Object.assign(Object.assign(Object.assign({}, core_1.strings), { 'if-flat': (s) => (schema.flat ? '' : s) }), schema)),
92
- schematics_1.move(parsedPath.path)
89
+ const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
90
+ schema.routing ? (0, schematics_1.noop)() : (0, schematics_1.filter)(path => !path.endsWith('-routing.module.ts')),
91
+ (0, schematics_1.applyTemplates)(Object.assign(Object.assign(Object.assign({}, core_1.strings), { 'if-flat': (s) => (schema.flat ? '' : s) }), schema)),
92
+ (0, schematics_1.move)(parsedPath.path)
93
93
  ]);
94
- return schematics_1.chain([
95
- schematics_1.branchAndMerge(schematics_1.chain([addDeclarationToNgModule(schema), addRoutingModuleToTop(schema), schematics_1.mergeWith(templateSource)]))
94
+ return (0, schematics_1.chain)([
95
+ (0, schematics_1.branchAndMerge)((0, schematics_1.chain)([addDeclarationToNgModule(schema), addRoutingModuleToTop(schema), (0, schematics_1.mergeWith)(templateSource)]))
96
96
  ]);
97
97
  });
98
98
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/module/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAuF;AACvF,2DAaoC;AACpC,qEAAoF;AACpF,+DAAkE;AAClE,yEAAgF;AAChF,uEAAmE;AACnE,iCAAiC;AAEjC,oCAAuD;AAGvD,SAAS,wBAAwB,CAAC,OAAqB;IACrD,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACnB,OAAO,IAAI,CAAC;SACb;QAED,MAAM,UAAU,GAAG,gBAAS,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAEnD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnC,IAAI,IAAI,KAAK,IAAI,EAAE;YACjB,MAAM,IAAI,gCAAmB,CAAC,QAAQ,UAAU,kBAAkB,CAAC,CAAC;SACrE;QACD,MAAM,UAAU,GAAG,IAAI,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CAAC,CAAC;YAC9E,IAAA,2BAAc,gDACT,cAAO,KACV,SAAS,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAC7C,MAAM,EACT;YACF,IAAA,iBAAI,EAAC,UAAU,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC;QAEH,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,2BAAc,EACZ,IAAA,kBAAK,EAAC,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,qBAAqB,CAAC,MAAM,CAAC,EAAE,IAAA,sBAAS,EAAC,cAAc,CAAC,CAAC,CAAC,CACpG;SACF,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;AACJ,CAAC;AAjCD,4BAiCC"}
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "SchematicsNgAlainModule",
4
4
  "title": "Ng Alain Module Options Schema",
5
5
  "type": "object",
package/ng-add/index.js CHANGED
@@ -3,52 +3,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const color_1 = require("@angular/cli/utilities/color");
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
5
  const tasks_1 = require("@angular-devkit/schematics/tasks");
6
- const fs_1 = require("fs");
7
- const path_1 = require("path");
8
6
  const utils_1 = require("../utils");
9
- const V = 12;
7
+ const node_1 = require("../utils/node");
8
+ const V = 13;
10
9
  function genRules(options) {
11
10
  return () => {
12
11
  const rules = [];
13
12
  const applicationOptions = Object.assign({}, options);
14
- rules.push(schematics_1.schematic('application', applicationOptions));
13
+ rules.push((0, schematics_1.schematic)('application', applicationOptions));
15
14
  if (options.codeStyle) {
16
- rules.push(schematics_1.schematic('plugin', { name: 'codeStyle', type: 'add' }));
15
+ rules.push((0, schematics_1.schematic)('plugin', { name: 'codeStyle', type: 'add' }));
17
16
  }
18
17
  if (options.defaultLanguage) {
19
- rules.push(schematics_1.schematic('plugin', {
18
+ rules.push((0, schematics_1.schematic)('plugin', {
20
19
  name: 'defaultLanguage',
21
20
  type: 'add',
22
21
  defaultLanguage: options.defaultLanguage
23
22
  }));
24
23
  }
25
24
  if (options.npm) {
26
- rules.push(schematics_1.schematic('plugin', {
25
+ rules.push((0, schematics_1.schematic)('plugin', {
27
26
  name: 'networkEnv',
28
27
  type: 'add',
29
28
  packageManager: 'npm'
30
29
  }));
31
30
  }
32
31
  if (options.yarn) {
33
- rules.push(schematics_1.schematic('plugin', {
32
+ rules.push((0, schematics_1.schematic)('plugin', {
34
33
  name: 'networkEnv',
35
34
  type: 'add',
36
35
  packageManager: 'yarn'
37
36
  }));
38
37
  }
39
- return schematics_1.chain(rules);
38
+ return (0, schematics_1.chain)(rules);
40
39
  };
41
40
  }
42
- function getFiles() {
43
- const nodeModulesPath = path_1.join(process.cwd(), 'node_modules');
44
- if (!fs_1.statSync(nodeModulesPath).isDirectory())
45
- return [];
46
- return fs_1.readdirSync(nodeModulesPath) || [];
47
- }
48
- function isUseCNPM() {
49
- const names = getFiles();
50
- const res = ['_@angular', '_ng-zorro-antd'].every(prefix => names.findIndex(w => w.startsWith(prefix)) !== -1);
51
- return res;
41
+ function isYarn(tree) {
42
+ var _a, _b;
43
+ return ((_b = (_a = (0, utils_1.readJSON)(tree, '/angular.json')) === null || _a === void 0 ? void 0 : _a.cli) === null || _b === void 0 ? void 0 : _b.packageManager) === 'yarn';
52
44
  }
53
45
  function finished() {
54
46
  return (_, context) => {
@@ -62,21 +54,27 @@ NG-ALAIN documentation site: https://ng-alain.com
62
54
  }
63
55
  function default_1(options) {
64
56
  return (tree, context) => {
65
- if (isUseCNPM()) {
66
- throw new Error(`Sorry, Don't use cnpm to install dependencies, pls refer to: https://ng-alain.com/docs/faq#Installation`);
57
+ if (!isYarn(tree)) {
58
+ context.logger.warn(`TIPS:: Please use yarn instead of NPM to install dependencies`);
59
+ }
60
+ const nodeVersion = (0, node_1.getNodeMajorVersion)();
61
+ const allowNodeVersions = [12, 14, 16];
62
+ if (!allowNodeVersions.some(v => nodeVersion === v)) {
63
+ const versions = allowNodeVersions.join(', ');
64
+ throw new schematics_1.SchematicsException(`Sorry, currently only supports ${versions} major version number of node (Got ${process.version}), pls refer to https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3`);
67
65
  }
68
- const pkg = utils_1.readPackage(tree);
66
+ const pkg = (0, utils_1.readPackage)(tree);
69
67
  if (pkg.devDependencies['ng-alain']) {
70
- throw new Error(`Already an NG-ALAIN project and can't be executed again: ng add ng-alain`);
68
+ throw new schematics_1.SchematicsException(`Already an NG-ALAIN project and can't be executed again: ng add ng-alain`);
71
69
  }
72
70
  let ngCoreVersion = pkg.dependencies['@angular/core'];
73
71
  if (/^[\^|\~]/g.test(ngCoreVersion)) {
74
- ngCoreVersion = ngCoreVersion.substr(1);
72
+ ngCoreVersion = ngCoreVersion.substring(1);
75
73
  }
76
74
  if (!ngCoreVersion.startsWith(`${V}.`)) {
77
- throw new Error(`Sorry, the current version only supports angular ${V}.x, pls downgrade the global Anguar-cli version: [yarn global add @angular/cli@${V}] (or via npm: [npm install -g @angular/cli@${V}])`);
75
+ throw new schematics_1.SchematicsException(`Sorry, the current version only supports angular ${V}.x, pls downgrade the global Anguar-cli version: [yarn global add @angular/cli@${V}] (or via npm: [npm install -g @angular/cli@${V}])`);
78
76
  }
79
- return schematics_1.chain([genRules(options), finished()])(tree, context);
77
+ return (0, schematics_1.chain)([genRules(options), finished()])(tree, context);
80
78
  };
81
79
  }
82
80
  exports.default = default_1;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;AAAA,wDAAsD;AAEtD,2DAA4F;AAC5F,4DAA0E;AAC1E,2BAA2C;AAC3C,+BAA4B;AAG5B,oCAAuC;AAGvC,MAAM,CAAC,GAAG,EAAE,CAAC;AAE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