ng-alain 12.4.2 → 13.1.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 (180) hide show
  1. package/application/files/root/.husky/pre-commit +1 -1
  2. package/application/files/root/.stylelintrc +1 -0
  3. package/application/files/src/app/core/i18n/i18n.service.ts +1 -1
  4. package/application/files/src/app/core/net/default.interceptor.ts +1 -1
  5. package/application/files/src/app/layout/basic/widgets/clear-storage.component.ts +1 -1
  6. package/application/files/src/app/layout/basic/widgets/fullscreen.component.ts +5 -8
  7. package/application/files/src/app/layout/basic/widgets/i18n.component.ts +3 -0
  8. package/application/files/src/app/layout/passport/passport.component.less +15 -1
  9. package/application/files/src/app/routes/exception/exception.component.ts +1 -1
  10. package/application/files/src/app/routes/passport/callback.component.ts +1 -1
  11. package/application/files/src/app/routes/passport/lock/lock.component.less +1 -0
  12. package/application/files/src/app/routes/passport/login/login.component.less +13 -3
  13. package/application/files/src/app/routes/passport/login/login.component.ts +4 -4
  14. package/application/files/src/app/routes/passport/register/register.component.less +10 -1
  15. package/application/files/src/app/routes/passport/register/register.component.ts +5 -5
  16. package/application/files/src/app/routes/passport/register-result/register-result.component.ts +1 -1
  17. package/application/files/src/styles/theme.less +1 -1
  18. package/application/files/src/styles.less +5 -5
  19. package/application/files/src/test.ts +3 -1
  20. package/application/index.js +45 -44
  21. package/application/index.js.map +1 -1
  22. package/application/index.ts +12 -9
  23. package/collection.json +2 -3
  24. package/curd/index.js +3 -3
  25. package/curd/index.js.map +1 -1
  26. package/curd/index.ts +1 -1
  27. package/curd/schema.json +16 -0
  28. package/curd/schema.ts +1 -0
  29. package/docs/generate.en-US.md +3 -0
  30. package/docs/generate.zh-CN.md +3 -0
  31. package/docs/plugin.en-US.md +0 -13
  32. package/docs/plugin.zh-CN.md +0 -13
  33. package/edit/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.service.ts.template +9 -0
  34. package/edit/index.js +1 -1
  35. package/edit/index.js.map +1 -1
  36. package/edit/schema.json +16 -0
  37. package/edit/schema.ts +1 -0
  38. package/empty/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.service.ts.template +9 -0
  39. package/empty/index.js +1 -1
  40. package/empty/index.js.map +1 -1
  41. package/empty/index.spec.ts +25 -5
  42. package/empty/schema.json +16 -0
  43. package/empty/schema.ts +1 -0
  44. package/list/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.service.ts.template +9 -0
  45. package/list/index.js +1 -1
  46. package/list/index.js.map +1 -1
  47. package/list/index.spec.ts +7 -0
  48. package/list/schema.json +16 -0
  49. package/list/schema.ts +1 -0
  50. package/migration.json +5 -10
  51. package/module/files/__name@dasherize@if-flat__/__name@dasherize__.service.ts.template +9 -0
  52. package/module/index.js +46 -20
  53. package/module/index.js.map +1 -1
  54. package/module/index.spec.ts +16 -0
  55. package/module/index.ts +33 -5
  56. package/module/schema.json +16 -0
  57. package/module/schema.ts +3 -1
  58. package/ng-add/index.js +24 -26
  59. package/ng-add/index.js.map +1 -1
  60. package/ng-add/index.spec.ts +13 -3
  61. package/ng-add/index.ts +19 -21
  62. package/ng-update/data/attribute-selectors.js +1 -1
  63. package/ng-update/data/attribute-selectors.ts +1 -1
  64. package/ng-update/data/class-names.js +1 -1
  65. package/ng-update/data/class-names.ts +1 -1
  66. package/ng-update/data/constructor-checks.js +1 -1
  67. package/ng-update/data/constructor-checks.ts +1 -1
  68. package/ng-update/data/css-selectors.js +1 -1
  69. package/ng-update/data/css-selectors.ts +1 -1
  70. package/ng-update/data/element-selectors.js +1 -1
  71. package/ng-update/data/element-selectors.ts +1 -1
  72. package/ng-update/data/input-names.js +1 -1
  73. package/ng-update/data/input-names.ts +1 -1
  74. package/ng-update/data/method-call-checks.js +1 -1
  75. package/ng-update/data/method-call-checks.ts +1 -1
  76. package/ng-update/data/output-names.js +1 -1
  77. package/ng-update/data/output-names.ts +1 -1
  78. package/ng-update/data/property-names.js +1 -1
  79. package/ng-update/data/property-names.ts +1 -1
  80. package/ng-update/index.js +8 -13
  81. package/ng-update/index.js.map +1 -1
  82. package/ng-update/index.ts +5 -10
  83. package/ng-update/upgrade-data.js +3 -1
  84. package/ng-update/upgrade-data.js.map +1 -1
  85. package/ng-update/upgrade-data.ts +3 -2
  86. package/ng-update/upgrade-rules/checks/_src-to-nz-image-rule.js +1 -1
  87. package/ng-update/upgrade-rules/checks/_src-to-nz-image-rule.js.map +1 -1
  88. package/ng-update/upgrade-rules/v12/index.js +32 -32
  89. package/ng-update/upgrade-rules/v12/index.js.map +1 -1
  90. package/ng-update/upgrade-rules/v12/index.ts +1 -5
  91. package/ng-update/upgrade-rules/v13/index.js +100 -0
  92. package/ng-update/upgrade-rules/v13/index.js.map +1 -0
  93. package/ng-update/upgrade-rules/v13/index.spec.ts +39 -0
  94. package/ng-update/upgrade-rules/v13/index.ts +111 -0
  95. package/package.json +1 -1
  96. package/plugin/files/rtl/layout/basic/widgets/rtl.component.ts +1 -1
  97. package/plugin/index.js +10 -14
  98. package/plugin/index.js.map +1 -1
  99. package/plugin/index.ts +0 -4
  100. package/plugin/plugin.code-style.js +2 -2
  101. package/plugin/plugin.code-style.js.map +1 -1
  102. package/plugin/plugin.default-language.js +3 -3
  103. package/plugin/plugin.default-language.js.map +1 -1
  104. package/plugin/plugin.default-language.ts +1 -1
  105. package/plugin/plugin.docker.js +6 -6
  106. package/plugin/plugin.docker.js.map +1 -1
  107. package/plugin/plugin.icon.js +7 -7
  108. package/plugin/plugin.icon.js.map +1 -1
  109. package/plugin/plugin.icon.ts +2 -2
  110. package/plugin/plugin.rtl.js +11 -11
  111. package/plugin/plugin.rtl.js.map +1 -1
  112. package/plugin/plugin.sts.js +1 -1
  113. package/plugin/plugin.sts.js.map +1 -1
  114. package/schema.json +10 -0
  115. package/sta/index.js +13 -13
  116. package/sta/index.js.map +1 -1
  117. package/tpl/index.js +2 -2
  118. package/tpl/index.js.map +1 -1
  119. package/tpl/index.ts +1 -1
  120. package/utils/alain.js +51 -26
  121. package/utils/alain.js.map +1 -1
  122. package/utils/alain.ts +45 -10
  123. package/utils/code-style.js +1 -1
  124. package/utils/code-style.js.map +1 -1
  125. package/utils/code-style.ts +1 -1
  126. package/utils/file.js +2 -2
  127. package/utils/file.js.map +1 -1
  128. package/utils/html.js +1 -1
  129. package/utils/html.js.map +1 -1
  130. package/utils/json.js +1 -1
  131. package/utils/json.js.map +1 -1
  132. package/utils/lib-versions.js +2 -2
  133. package/utils/lib-versions.ts +2 -2
  134. package/utils/log.js +3 -3
  135. package/utils/log.js.map +1 -1
  136. package/utils/log.ts +3 -3
  137. package/utils/node.js +8 -0
  138. package/utils/node.js.map +1 -0
  139. package/utils/node.ts +3 -0
  140. package/utils/package.js +4 -4
  141. package/utils/package.js.map +1 -1
  142. package/utils/package.ts +2 -2
  143. package/utils/testing.js +3 -3
  144. package/utils/testing.js.map +1 -1
  145. package/utils/versions.js +24 -20
  146. package/utils/versions.js.map +1 -1
  147. package/utils/versions.ts +20 -16
  148. package/utils/workspace.js +25 -6
  149. package/utils/workspace.js.map +1 -1
  150. package/utils/workspace.ts +15 -0
  151. package/view/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.service.ts.template +9 -0
  152. package/view/index.js +1 -1
  153. package/view/index.js.map +1 -1
  154. package/view/schema.json +16 -0
  155. package/view/schema.ts +1 -0
  156. package/ng-update/upgrade-rules/v11/files-tpl/main.js +0 -31
  157. package/ng-update/upgrade-rules/v11/files-tpl/main.js.map +0 -1
  158. package/ng-update/upgrade-rules/v11/files-tpl/main.ts +0 -28
  159. package/ng-update/upgrade-rules/v11/hmr.js +0 -103
  160. package/ng-update/upgrade-rules/v11/hmr.js.map +0 -1
  161. package/ng-update/upgrade-rules/v11/hmr.ts +0 -109
  162. package/ng-update/upgrade-rules/v11/index.js +0 -72
  163. package/ng-update/upgrade-rules/v11/index.js.map +0 -1
  164. package/ng-update/upgrade-rules/v11/index.spec.ts +0 -51
  165. package/ng-update/upgrade-rules/v11/index.ts +0 -80
  166. package/ng-update/upgrade-rules/v11/layout.js +0 -39
  167. package/ng-update/upgrade-rules/v11/layout.js.map +0 -1
  168. package/ng-update/upgrade-rules/v11/layout.ts +0 -47
  169. package/ng-update/upgrade-rules/v117/index.js +0 -82
  170. package/ng-update/upgrade-rules/v117/index.js.map +0 -1
  171. package/ng-update/upgrade-rules/v117/index.spec.ts +0 -58
  172. package/ng-update/upgrade-rules/v117/index.ts +0 -71
  173. package/plugin/files/ie/tsconfig-es5.app.js +0 -9
  174. package/plugin/files/ie/tsconfig-es5.app.js.map +0 -1
  175. package/plugin/files/ie/tsconfig-es5.spec.js +0 -9
  176. package/plugin/files/ie/tsconfig-es5.spec.js.map +0 -1
  177. package/plugin/plugin.ie.js +0 -128
  178. package/plugin/plugin.ie.js.map +0 -1
  179. package/plugin/plugin.ie.spec.ts +0 -35
  180. package/plugin/plugin.ie.ts +0 -144
@@ -1,5 +1,5 @@
1
1
  #!/bin/sh
2
2
  . "$(dirname "$0")/_/husky.sh"
3
3
  export NODE_OPTIONS="--max-old-space-size=4096"
4
- npx --no-install tsc -p tsconfig.json --noEmit
4
+ npx --no-install tsc -p tsconfig.app.json --noEmit
5
5
  npx --no-install lint-staged
@@ -4,6 +4,7 @@
4
4
  "stylelint-config-rational-order",
5
5
  "stylelint-config-prettier"
6
6
  ],
7
+ "customSyntax": "postcss-less",
7
8
  "plugins": [
8
9
  "stylelint-order",
9
10
  "stylelint-declaration-block-no-ignored-properties"
@@ -59,7 +59,7 @@ const LANGS: { [key: string]: LangConfigData } = {
59
59
 
60
60
  @Injectable({ providedIn: 'root' })
61
61
  export class I18NService extends AlainI18nBaseService {
62
- protected _defaultLang = DEFAULT;
62
+ protected override _defaultLang = DEFAULT;
63
63
  private _langs = Object.keys(LANGS).map(code => {
64
64
  const item = LANGS[code];
65
65
  return { code, text: item.text, abbr: item.abbr };
@@ -80,7 +80,7 @@ export class DefaultInterceptor implements HttpInterceptor {
80
80
  */
81
81
  private refreshTokenRequest(): Observable<any> {
82
82
  const model = this.tokenSrv.get();
83
- return this.http.post(`/api/auth/refresh`, null, null, { headers: { refresh_token: model?.refresh_token || '' } });
83
+ return this.http.post(`/api/auth/refresh`, null, null, { headers: { refresh_token: model?.['refresh_token'] || '' } });
84
84
  }
85
85
 
86
86
  // #region 刷新Token方式一:使用 401 重新刷新 Token
@@ -9,7 +9,7 @@ import { NzModalService } from 'ng-zorro-antd/modal';
9
9
  {{ 'menu.clear.local.storage' | i18n }}
10
10
  `,
11
11
  host: {
12
- '[class.d-block]': 'true'
12
+ '[class.flex-1]': 'true'
13
13
  },
14
14
  changeDetection: ChangeDetectionStrategy.OnPush
15
15
  })
@@ -1,5 +1,5 @@
1
1
  import { ChangeDetectionStrategy, Component, HostListener } from '@angular/core';
2
- import * as screenfull from 'screenfull';
2
+ import screenfull from 'screenfull';
3
3
 
4
4
  @Component({
5
5
  selector: 'header-fullscreen',
@@ -8,25 +8,22 @@ import * as screenfull from 'screenfull';
8
8
  {{ (status ? 'menu.fullscreen.exit' : 'menu.fullscreen') | i18n }}
9
9
  `,
10
10
  host: {
11
- '[class.d-block]': 'true'
11
+ '[class.flex-1]': 'true'
12
12
  },
13
13
  changeDetection: ChangeDetectionStrategy.OnPush
14
14
  })
15
15
  export class HeaderFullScreenComponent {
16
16
  status = false;
17
- private get sf(): screenfull.Screenfull {
18
- return screenfull as screenfull.Screenfull;
19
- }
20
17
 
21
18
  @HostListener('window:resize')
22
19
  _resize(): void {
23
- this.status = this.sf.isFullscreen;
20
+ this.status = screenfull.isFullscreen;
24
21
  }
25
22
 
26
23
  @HostListener('click')
27
24
  _click(): void {
28
- if (this.sf.isEnabled) {
29
- this.sf.toggle();
25
+ if (screenfull.isEnabled) {
26
+ screenfull.toggle();
30
27
  }
31
28
  }
32
29
  }
@@ -22,6 +22,9 @@ import { BooleanInput, InputBoolean } from '@delon/util/decorator';
22
22
  </ul>
23
23
  </nz-dropdown-menu>
24
24
  `,
25
+ host: {
26
+ '[class.flex-1]': 'true'
27
+ },
25
28
  changeDetection: ChangeDetectionStrategy.OnPush
26
29
  })
27
30
  export class HeaderI18nComponent {
@@ -1,4 +1,5 @@
1
- @import '~@delon/theme/index';
1
+ @import '@delon/theme/index';
2
+
2
3
  :host ::ng-deep {
3
4
  .container {
4
5
  display: flex;
@@ -6,11 +7,13 @@
6
7
  min-height: 100%;
7
8
  background: #f0f2f5;
8
9
  }
10
+
9
11
  .langs {
10
12
  width: 100%;
11
13
  height: 40px;
12
14
  line-height: 44px;
13
15
  text-align: right;
16
+
14
17
  .anticon {
15
18
  margin-top: 24px;
16
19
  margin-right: 24px;
@@ -19,10 +22,12 @@
19
22
  cursor: pointer;
20
23
  }
21
24
  }
25
+
22
26
  .wrap {
23
27
  flex: 1;
24
28
  padding: 32px 0;
25
29
  }
30
+
26
31
  .ant-form-item {
27
32
  display: flex;
28
33
  justify-content: space-between;
@@ -36,24 +41,30 @@
36
41
  background-position: center 110px;
37
42
  background-size: 100%;
38
43
  }
44
+
39
45
  .wrap {
40
46
  padding: 32px 0 24px;
41
47
  }
42
48
  }
49
+
43
50
  .top {
44
51
  text-align: center;
45
52
  }
53
+
46
54
  .header {
47
55
  height: 44px;
48
56
  line-height: 44px;
57
+
49
58
  a {
50
59
  text-decoration: none;
51
60
  }
52
61
  }
62
+
53
63
  .logo {
54
64
  height: 44px;
55
65
  margin-right: 16px;
56
66
  }
67
+
57
68
  .title {
58
69
  position: relative;
59
70
  color: @heading-color;
@@ -62,6 +73,7 @@
62
73
  font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
63
74
  vertical-align: middle;
64
75
  }
76
+
65
77
  .desc {
66
78
  margin-top: 12px;
67
79
  margin-bottom: 40px;
@@ -75,9 +87,11 @@
75
87
  .container {
76
88
  background: #141414;
77
89
  }
90
+
78
91
  .title {
79
92
  color: fade(@white, 85%);
80
93
  }
94
+
81
95
  .desc {
82
96
  color: fade(@white, 45%);
83
97
  }
@@ -9,7 +9,7 @@ import { ExceptionType } from '@delon/abc/exception';
9
9
  })
10
10
  export class ExceptionComponent {
11
11
  get type(): ExceptionType {
12
- return this.route.snapshot.data.type;
12
+ return this.route.snapshot.data['type'];
13
13
  }
14
14
 
15
15
  constructor(private route: ActivatedRoute) {}
@@ -14,7 +14,7 @@ export class CallbackComponent implements OnInit {
14
14
  constructor(private socialService: SocialService, private settingsSrv: SettingsService, private route: ActivatedRoute) {}
15
15
 
16
16
  ngOnInit(): void {
17
- this.type = this.route.snapshot.params.type;
17
+ this.type = this.route.snapshot.params['type'];
18
18
  this.mockModel();
19
19
  }
20
20
 
@@ -3,6 +3,7 @@
3
3
  position: relative;
4
4
  margin-top: 80px;
5
5
  }
6
+
6
7
  .avatar {
7
8
  position: absolute;
8
9
  top: -20px;
@@ -1,39 +1,48 @@
1
- @import '~@delon/theme/index';
1
+ @import '@delon/theme/index';
2
+
2
3
  :host {
3
4
  display: block;
4
5
  width: 368px;
5
6
  margin: 0 auto;
7
+
6
8
  ::ng-deep {
7
9
  .ant-tabs .ant-tabs-bar {
8
10
  margin-bottom: 24px;
9
11
  text-align: center;
10
12
  border-bottom: 0;
11
13
  }
14
+
12
15
  .ant-tabs-tab {
13
16
  font-size: 16px;
14
17
  line-height: 24px;
15
18
  }
19
+
16
20
  .ant-input-affix-wrapper .ant-input:not(:first-child) {
17
21
  padding-left: 4px;
18
22
  }
23
+
19
24
  .icon {
20
25
  margin-left: 16px;
21
- color: rgba(0, 0, 0, 0.2);
26
+ color: rgb(0 0 0 / 20%);
22
27
  font-size: 24px;
23
28
  vertical-align: middle;
24
29
  cursor: pointer;
25
30
  transition: color 0.3s;
31
+
26
32
  &:hover {
27
33
  color: @primary-color;
28
34
  }
29
35
  }
36
+
30
37
  .other {
31
38
  margin-top: 24px;
32
39
  line-height: 22px;
33
40
  text-align: left;
41
+
34
42
  nz-tooltip {
35
43
  vertical-align: middle;
36
44
  }
45
+
37
46
  .register {
38
47
  float: right;
39
48
  }
@@ -44,7 +53,8 @@
44
53
  [data-theme='dark'] {
45
54
  :host ::ng-deep {
46
55
  .icon {
47
- color: rgba(255, 255, 255, 0.2);
56
+ color: rgb(255 255 255 / 20%);
57
+
48
58
  &:hover {
49
59
  color: #fff;
50
60
  }
@@ -42,16 +42,16 @@ export class UserLoginComponent implements OnDestroy {
42
42
  // #region fields
43
43
 
44
44
  get userName(): AbstractControl {
45
- return this.form.controls.userName;
45
+ return this.form.get('userName')!;
46
46
  }
47
47
  get password(): AbstractControl {
48
- return this.form.controls.password;
48
+ return this.form.get('password')!;
49
49
  }
50
50
  get mobile(): AbstractControl {
51
- return this.form.controls.mobile;
51
+ return this.form.get('mobile')!;
52
52
  }
53
53
  get captcha(): AbstractControl {
54
- return this.form.controls.captcha;
54
+ return this.form.get('captcha')!;
55
55
  }
56
56
  form: FormGroup;
57
57
  error = '';
@@ -1,22 +1,27 @@
1
- @import '~@delon/theme/index';
1
+ @import '@delon/theme/index';
2
+
2
3
  :host {
3
4
  display: block;
4
5
  width: 368px;
5
6
  margin: 0 auto;
7
+
6
8
  ::ng-deep {
7
9
  h3 {
8
10
  margin-bottom: 20px;
9
11
  font-size: 16px;
10
12
  }
13
+
11
14
  .submit {
12
15
  width: 50%;
13
16
  }
17
+
14
18
  .login {
15
19
  float: right;
16
20
  line-height: @btn-height-lg;
17
21
  }
18
22
  }
19
23
  }
24
+
20
25
  ::ng-deep {
21
26
  .register-password-cdk {
22
27
  .success,
@@ -24,15 +29,19 @@
24
29
  .error {
25
30
  transition: color 0.3s;
26
31
  }
32
+
27
33
  .success {
28
34
  color: @success-color;
29
35
  }
36
+
30
37
  .warning {
31
38
  color: @warning-color;
32
39
  }
40
+
33
41
  .error {
34
42
  color: @error-color;
35
43
  }
44
+
36
45
  .progress-pass > .progress {
37
46
  .ant-progress-bg {
38
47
  background-color: @warning-color;
@@ -32,19 +32,19 @@ export class UserRegisterComponent implements OnDestroy {
32
32
  // #region fields
33
33
 
34
34
  get mail(): AbstractControl {
35
- return this.form.controls.mail;
35
+ return this.form.get('mail')!;
36
36
  }
37
37
  get password(): AbstractControl {
38
- return this.form.controls.password;
38
+ return this.form.get('password')!;
39
39
  }
40
40
  get confirm(): AbstractControl {
41
- return this.form.controls.confirm;
41
+ return this.form.get('confirm')!;
42
42
  }
43
43
  get mobile(): AbstractControl {
44
- return this.form.controls.mobile;
44
+ return this.form.get('mobile')!;
45
45
  }
46
46
  get captcha(): AbstractControl {
47
- return this.form.controls.captcha;
47
+ return this.form.get('captcha')!;
48
48
  }
49
49
  form: FormGroup;
50
50
  error = '';
@@ -10,6 +10,6 @@ export class UserRegisterResultComponent {
10
10
  params = { email: '' };
11
11
  email = '';
12
12
  constructor(route: ActivatedRoute, public msg: NzMessageService) {
13
- this.params.email = this.email = route.snapshot.queryParams.email || 'ng-alain@example.com';
13
+ this.params.email = this.email = route.snapshot.queryParams['email'] || 'ng-alain@example.com';
14
14
  }
15
15
  }
@@ -2,7 +2,7 @@
2
2
  // - `default` Default theme
3
3
  // - `dark` Import the official dark less style file
4
4
  // - `compact` Import the official compact less style file
5
- @import '~@delon/theme/theme-default.less';
5
+ @import '@delon/theme/theme-default.less';
6
6
 
7
7
  // ==========The following is the custom theme variable area==========
8
8
  // The theme paraments can be generated at https://ng-alain.github.io/ng-alain/
@@ -1,8 +1,8 @@
1
- @import '~@delon/theme/system/index';
2
- @import '~@delon/abc/index';
3
- @import '~@delon/chart/index';
4
- @import '~@delon/theme/layout-default/style/index';
5
- @import '~@delon/theme/layout-blank/style/index';
1
+ @import '@delon/theme/system/index';
2
+ @import '@delon/abc/index';
3
+ @import '@delon/chart/index';
4
+ @import '@delon/theme/layout-default/style/index';
5
+ @import '@delon/theme/layout-blank/style/index';
6
6
 
7
7
  @import './styles/index';
8
8
  @import './styles/theme';
@@ -13,7 +13,9 @@ declare const require: any;
13
13
  // First, initialize the Angular testing environment.
14
14
  getTestBed().initTestEnvironment(
15
15
  BrowserDynamicTestingModule,
16
- platformBrowserDynamicTesting()
16
+ platformBrowserDynamicTesting(), {
17
+ teardown: { destroyAfterEach: false }
18
+ }
17
19
  );
18
20
 
19
21
  // Then we find all the tests.
@@ -39,16 +39,16 @@ function removeOrginalFiles() {
39
39
  };
40
40
  }
41
41
  function fixAngularJson(options) {
42
- return workspace_1.updateWorkspace((workspace) => __awaiter(this, void 0, void 0, function* () {
42
+ return (0, workspace_1.updateWorkspace)((workspace) => __awaiter(this, void 0, void 0, function* () {
43
43
  var _a;
44
- const p = utils_1.getProjectFromWorkspace(workspace, options.project);
44
+ const p = (0, utils_1.getProjectFromWorkspace)(workspace, options.project);
45
45
  // Add proxy.conf.js
46
46
  const serveTarget = (_a = p.targets) === null || _a === void 0 ? void 0 : _a.get(utils_1.BUILD_TARGET_SERVE);
47
47
  if (serveTarget.options == null)
48
48
  serveTarget.options = {};
49
49
  serveTarget.options.proxyConfig = 'proxy.conf.js';
50
50
  // 调整budgets
51
- const budgets = utils_1.getProjectTarget(p, utils_1.BUILD_TARGET_BUILD, 'configurations').production
51
+ const budgets = (0, utils_1.getProjectTarget)(p, utils_1.BUILD_TARGET_BUILD, 'configurations').production
52
52
  .budgets;
53
53
  if (budgets && budgets.length > 0) {
54
54
  const initial = budgets.find(w => w.type === 'initial');
@@ -57,19 +57,20 @@ function fixAngularJson(options) {
57
57
  initial.maximumError = '3mb';
58
58
  }
59
59
  }
60
+ (0, utils_1.addStylePreprocessorOptionsToAllProject)(workspace);
60
61
  }));
61
62
  }
62
63
  function addDependenciesToPackageJson(options) {
63
64
  return (tree) => {
64
- versions_1.UpgradeMainVersions(tree);
65
+ (0, versions_1.UpgradeMainVersions)(tree);
65
66
  // 3rd
66
- utils_1.addPackage(tree, ['screenfull@^5.1.0']);
67
+ (0, utils_1.addPackage)(tree, ['screenfull@^6.0.0']);
67
68
  return tree;
68
69
  };
69
70
  }
70
71
  function addRunScriptToPackageJson() {
71
72
  return (tree) => {
72
- const json = utils_1.readPackage(tree, 'scripts');
73
+ const json = (0, utils_1.readPackage)(tree, 'scripts');
73
74
  if (json == null)
74
75
  return tree;
75
76
  json.scripts['ng-high-memory'] = `node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng`;
@@ -83,13 +84,13 @@ function addRunScriptToPackageJson() {
83
84
  json.scripts.theme = `ng-alain-plugin-theme -t=themeCss`;
84
85
  json.scripts.icon = `ng g ng-alain:plugin icon`;
85
86
  json.scripts.prepare = `husky install`;
86
- utils_1.writePackage(tree, json);
87
+ (0, utils_1.writePackage)(tree, json);
87
88
  return tree;
88
89
  };
89
90
  }
90
91
  function addPathsToTsConfig() {
91
92
  return (tree) => {
92
- const json = utils_1.readJSON(tree, 'tsconfig.json', 'compilerOptions');
93
+ const json = (0, utils_1.readJSON)(tree, 'tsconfig.json', 'compilerOptions');
93
94
  if (json == null)
94
95
  return tree;
95
96
  if (!json.compilerOptions)
@@ -100,44 +101,44 @@ function addPathsToTsConfig() {
100
101
  paths['@shared'] = ['src/app/shared/index'];
101
102
  paths['@core'] = ['src/app/core/index'];
102
103
  paths['@env/*'] = ['src/environments/*'];
103
- utils_1.writeJSON(tree, 'tsconfig.json', json);
104
+ (0, utils_1.writeJSON)(tree, 'tsconfig.json', json);
104
105
  return tree;
105
106
  };
106
107
  }
107
108
  function addCodeStylesToPackageJson() {
108
109
  return (tree) => {
109
- const json = utils_1.readPackage(tree);
110
+ const json = (0, utils_1.readPackage)(tree);
110
111
  if (json == null)
111
112
  return tree;
112
113
  json.scripts.lint = `npm run lint:ts && npm run lint:style`;
113
114
  json.scripts['lint:ts'] = `ng lint --fix`;
114
- json.scripts['lint:style'] = `stylelint \"src/**/*.less\" --syntax less --fix`;
115
+ json.scripts['lint:style'] = `npx stylelint \"src/**/*.less\" --fix`;
115
116
  json.scripts['prepare'] = 'husky install';
116
- utils_1.writePackage(tree, json);
117
+ (0, utils_1.writePackage)(tree, json);
117
118
  // fix polyfills.ts
118
119
  const polyfillsPath = `${project.sourceRoot}/polyfills.ts`;
119
120
  if (tree.exists(polyfillsPath)) {
120
- const polyfillsContent = `/* eslint-disable import/no-unassigned-import */\n${utils_1.readContent(tree, polyfillsPath)}`;
121
- utils_1.writeFile(tree, polyfillsPath, polyfillsContent);
121
+ const polyfillsContent = `/* eslint-disable import/no-unassigned-import */\n${(0, utils_1.readContent)(tree, polyfillsPath)}`;
122
+ (0, utils_1.writeFile)(tree, polyfillsPath, polyfillsContent);
122
123
  }
123
124
  // dependencies
124
- utils_1.addPackage(tree, [
125
+ (0, utils_1.addPackage)(tree, [
125
126
  `husky@^6.0.0`,
126
- `lint-staged@^11.1.2`,
127
- `prettier@^2.2.1`,
128
- `stylelint@^13.13.1`,
129
- `stylelint-config-prettier@^8.0.2`,
127
+ `lint-staged@^12.1.4`,
128
+ `prettier@^2.5.1`,
129
+ `stylelint@^14.2.0`,
130
+ `stylelint-config-prettier@^9.0.3`,
130
131
  `stylelint-config-rational-order@^0.1.2`,
131
- `stylelint-config-standard@^22.0.0`,
132
- `stylelint-declaration-block-no-ignored-properties@^2.4.0`,
133
- `stylelint-order@^4.1.0`
132
+ `stylelint-config-standard@^24.0.0`,
133
+ `stylelint-declaration-block-no-ignored-properties@^2.5.0`,
134
+ `stylelint-order@^5.0.0`
134
135
  ], 'devDependencies');
135
136
  return tree;
136
137
  };
137
138
  }
138
139
  function addSchematics(options) {
139
- return workspace_1.updateWorkspace((workspace) => __awaiter(this, void 0, void 0, function* () {
140
- const p = utils_1.getProjectFromWorkspace(workspace, options.project);
140
+ return (0, workspace_1.updateWorkspace)((workspace) => __awaiter(this, void 0, void 0, function* () {
141
+ const p = (0, utils_1.getProjectFromWorkspace)(workspace, options.project);
141
142
  const schematics = p.extensions.schematics;
142
143
  schematics['ng-alain:module'] = {
143
144
  routing: true,
@@ -172,13 +173,13 @@ function addSchematics(options) {
172
173
  }
173
174
  function forceLess() {
174
175
  return () => {
175
- utils_1.addAssetsToTarget([{ type: 'style', value: 'src/styles.less' }], 'add', [utils_1.BUILD_TARGET_BUILD], null, true);
176
+ (0, utils_1.addAssetsToTarget)([{ type: 'style', value: 'src/styles.less' }], 'add', [utils_1.BUILD_TARGET_BUILD], null, true);
176
177
  };
177
178
  }
178
179
  function addStyle() {
179
180
  return (tree) => {
180
- utils_1.addHeadStyle(tree, project, ` <style type="text/css">.preloader{position:fixed;top:0;left:0;width:100%;height:100%;overflow:hidden;background:#49a9ee;z-index:9999;transition:opacity .65s}.preloader-hidden-add{opacity:1;display:block}.preloader-hidden-add-active{opacity:0}.preloader-hidden{display:none}.cs-loader{position:absolute;top:0;left:0;height:100%;width:100%}.cs-loader-inner{transform:translateY(-50%);top:50%;position:absolute;width:100%;color:#fff;text-align:center}.cs-loader-inner label{font-size:20px;opacity:0;display:inline-block}@keyframes lol{0%{opacity:0;transform:translateX(-300px)}33%{opacity:1;transform:translateX(0)}66%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(300px)}}.cs-loader-inner label:nth-child(6){animation:lol 3s infinite ease-in-out}.cs-loader-inner label:nth-child(5){animation:lol 3s .1s infinite ease-in-out}.cs-loader-inner label:nth-child(4){animation:lol 3s .2s infinite ease-in-out}.cs-loader-inner label:nth-child(3){animation:lol 3s .3s infinite ease-in-out}.cs-loader-inner label:nth-child(2){animation:lol 3s .4s infinite ease-in-out}.cs-loader-inner label:nth-child(1){animation:lol 3s .5s infinite ease-in-out}</style>`);
181
- utils_1.addHtmlToBody(tree, project, ` <div class="preloader"><div class="cs-loader"><div class="cs-loader-inner"><label> ●</label><label> ●</label><label> ●</label><label> ●</label><label> ●</label><label> ●</label></div></div></div>\n`);
181
+ (0, utils_1.addHeadStyle)(tree, project, ` <style type="text/css">.preloader{position:fixed;top:0;left:0;width:100%;height:100%;overflow:hidden;background:#49a9ee;z-index:9999;transition:opacity .65s}.preloader-hidden-add{opacity:1;display:block}.preloader-hidden-add-active{opacity:0}.preloader-hidden{display:none}.cs-loader{position:absolute;top:0;left:0;height:100%;width:100%}.cs-loader-inner{transform:translateY(-50%);top:50%;position:absolute;width:100%;color:#fff;text-align:center}.cs-loader-inner label{font-size:20px;opacity:0;display:inline-block}@keyframes lol{0%{opacity:0;transform:translateX(-300px)}33%{opacity:1;transform:translateX(0)}66%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(300px)}}.cs-loader-inner label:nth-child(6){animation:lol 3s infinite ease-in-out}.cs-loader-inner label:nth-child(5){animation:lol 3s .1s infinite ease-in-out}.cs-loader-inner label:nth-child(4){animation:lol 3s .2s infinite ease-in-out}.cs-loader-inner label:nth-child(3){animation:lol 3s .3s infinite ease-in-out}.cs-loader-inner label:nth-child(2){animation:lol 3s .4s infinite ease-in-out}.cs-loader-inner label:nth-child(1){animation:lol 3s .5s infinite ease-in-out}</style>`);
182
+ (0, utils_1.addHtmlToBody)(tree, project, ` <div class="preloader"><div class="cs-loader"><div class="cs-loader-inner"><label> ●</label><label> ●</label><label> ●</label><label> ●</label><label> ●</label><label> ●</label></div></div></div>\n`);
182
183
  // // add styles
183
184
  // [`${project.sourceRoot}/styles/index.less`, `${project.sourceRoot}/styles/theme.less`].forEach(p => {
184
185
  // overwriteFile({ tree, filePath: p, content: path.join(overwriteDataFileRoot, p), overwrite: true });
@@ -187,18 +188,18 @@ function addStyle() {
187
188
  };
188
189
  }
189
190
  function addFilesToRoot(options) {
190
- return schematics_1.chain([
191
- schematics_1.mergeWith(schematics_1.apply(schematics_1.url('./files/src'), [
192
- options.i18n ? schematics_1.noop() : schematics_1.filter(p => p.indexOf('i18n') === -1),
193
- options.form ? schematics_1.noop() : schematics_1.filter(p => p.indexOf('json-schema') === -1),
194
- schematics_1.template(Object.assign(Object.assign({ utils: core_1.strings }, options), { dot: '.', VERSION: utils_1.VERSION,
191
+ return (0, schematics_1.chain)([
192
+ (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files/src'), [
193
+ options.i18n ? (0, schematics_1.noop)() : (0, schematics_1.filter)(p => p.indexOf('i18n') === -1),
194
+ options.form ? (0, schematics_1.noop)() : (0, schematics_1.filter)(p => p.indexOf('json-schema') === -1),
195
+ (0, schematics_1.template)(Object.assign(Object.assign({ utils: core_1.strings }, options), { dot: '.', VERSION: utils_1.VERSION,
195
196
  ZORROVERSION: utils_1.ZORROVERSION })),
196
- schematics_1.move(project.sourceRoot)
197
+ (0, schematics_1.move)(project.sourceRoot)
197
198
  ])),
198
- schematics_1.mergeWith(schematics_1.apply(schematics_1.url('./files/root'), [
199
- options.i18n ? schematics_1.noop() : schematics_1.filter(p => p.indexOf('i18n') === -1),
200
- options.form ? schematics_1.noop() : schematics_1.filter(p => p.indexOf('json-schema') === -1),
201
- schematics_1.template(Object.assign(Object.assign({ utils: core_1.strings }, options), { dot: '.', VERSION: utils_1.VERSION,
199
+ (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files/root'), [
200
+ options.i18n ? (0, schematics_1.noop)() : (0, schematics_1.filter)(p => p.indexOf('i18n') === -1),
201
+ options.form ? (0, schematics_1.noop)() : (0, schematics_1.filter)(p => p.indexOf('json-schema') === -1),
202
+ (0, schematics_1.template)(Object.assign(Object.assign({ utils: core_1.strings }, options), { dot: '.', VERSION: utils_1.VERSION,
202
203
  ZORROVERSION: utils_1.ZORROVERSION }))
203
204
  // move('/')
204
205
  ]), schematics_1.MergeStrategy.Overwrite)
@@ -208,7 +209,7 @@ function fixLang(options) {
208
209
  return (tree, context) => {
209
210
  if (options.i18n)
210
211
  return;
211
- const langs = lang_config_1.getLangData(options.defaultLanguage);
212
+ const langs = (0, lang_config_1.getLangData)(options.defaultLanguage);
212
213
  if (!langs)
213
214
  return;
214
215
  context.logger.info(`Translating template into ${options.defaultLanguage} language, please wait...`);
@@ -261,32 +262,32 @@ function fixLangInHtml(tree, p, langs) {
261
262
  function fixVsCode() {
262
263
  return (tree) => {
263
264
  const filePath = '.vscode/extensions.json';
264
- let json = utils_1.readJSON(tree, filePath);
265
+ let json = (0, utils_1.readJSON)(tree, filePath);
265
266
  if (json == null) {
266
267
  tree.create(filePath, '');
267
268
  json = {};
268
269
  }
269
270
  json.recommendations = ['cipchk.ng-alain-extension-pack'];
270
- utils_1.writeJSON(tree, filePath, json);
271
+ (0, utils_1.writeJSON)(tree, filePath, json);
271
272
  };
272
273
  }
273
274
  function default_1(options) {
274
275
  return (tree, context) => __awaiter(this, void 0, void 0, function* () {
275
- project = (yield utils_1.getProject(tree, options.project)).project;
276
+ project = (yield (0, utils_1.getProject)(tree, options.project)).project;
276
277
  context.logger.info(`Generating NG-ALAIN scaffold...`);
277
- return schematics_1.chain([
278
+ return (0, schematics_1.chain)([
278
279
  // @delon/* dependencies
279
280
  addDependenciesToPackageJson(options),
280
281
  // Configuring CommonJS dependencies
281
282
  // https://angular.io/guide/build#configuring-commonjs-dependencies
282
- utils_1.addAllowedCommonJsDependencies([]),
283
+ (0, utils_1.addAllowedCommonJsDependencies)([]),
283
284
  // ci
284
285
  addRunScriptToPackageJson(),
285
286
  addPathsToTsConfig(),
286
287
  // code style
287
288
  addCodeStylesToPackageJson(),
288
289
  addSchematics(options),
289
- versions_1.addESLintRule(context, false),
290
+ (0, versions_1.addESLintRule)(context, false),
290
291
  // files
291
292
  removeOrginalFiles(),
292
293
  addFilesToRoot(options),