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.
- package/application/files/src/app/core/i18n/i18n.service.ts +1 -1
- package/application/files/src/app/core/net/default.interceptor.ts +1 -1
- package/application/files/src/app/layout/basic/widgets/clear-storage.component.ts +1 -1
- package/application/files/src/app/layout/basic/widgets/fullscreen.component.ts +5 -8
- package/application/files/src/app/layout/basic/widgets/i18n.component.ts +3 -0
- package/application/files/src/app/layout/passport/passport.component.less +1 -1
- package/application/files/src/app/routes/exception/exception.component.ts +1 -1
- package/application/files/src/app/routes/passport/callback.component.ts +1 -1
- package/application/files/src/app/routes/passport/login/login.component.less +1 -1
- package/application/files/src/app/routes/passport/login/login.component.ts +4 -4
- package/application/files/src/app/routes/passport/register/register.component.less +1 -1
- package/application/files/src/app/routes/passport/register/register.component.ts +5 -5
- package/application/files/src/app/routes/passport/register-result/register-result.component.ts +1 -1
- package/application/files/src/styles/theme.less +1 -1
- package/application/files/src/styles.less +5 -5
- package/application/files/src/test.ts +3 -1
- package/application/index.js +44 -43
- package/application/index.js.map +1 -1
- package/application/index.ts +11 -8
- package/application/schema.json +1 -1
- package/collection.json +2 -3
- package/curd/index.js +2 -2
- package/curd/index.js.map +1 -1
- package/curd/schema.json +34 -27
- package/docs/generate.en-US.md +7 -7
- package/docs/generate.zh-CN.md +7 -7
- package/docs/plugin.en-US.md +0 -13
- package/docs/plugin.zh-CN.md +0 -13
- package/edit/index.js +1 -1
- package/edit/index.js.map +1 -1
- package/edit/schema.json +2 -7
- package/empty/index.js +1 -1
- package/empty/index.js.map +1 -1
- package/empty/schema.json +2 -7
- package/list/index.js +1 -1
- package/list/index.js.map +1 -1
- package/list/schema.json +2 -7
- package/migration.json +5 -10
- package/module/index.js +18 -18
- package/module/index.js.map +1 -1
- package/module/schema.json +1 -1
- package/ng-add/index.js +24 -26
- package/ng-add/index.js.map +1 -1
- package/ng-add/index.spec.ts +13 -3
- package/ng-add/index.ts +19 -21
- package/ng-add/schema.json +1 -1
- package/ng-update/data/attribute-selectors.js +1 -1
- package/ng-update/data/attribute-selectors.ts +1 -1
- package/ng-update/data/class-names.js +1 -1
- package/ng-update/data/class-names.ts +1 -1
- package/ng-update/data/constructor-checks.js +1 -1
- package/ng-update/data/constructor-checks.ts +1 -1
- package/ng-update/data/css-selectors.js +1 -1
- package/ng-update/data/css-selectors.ts +1 -1
- package/ng-update/data/element-selectors.js +1 -1
- package/ng-update/data/element-selectors.ts +1 -1
- package/ng-update/data/input-names.js +1 -1
- package/ng-update/data/input-names.ts +1 -1
- package/ng-update/data/method-call-checks.js +1 -1
- package/ng-update/data/method-call-checks.ts +1 -1
- package/ng-update/data/output-names.js +1 -1
- package/ng-update/data/output-names.ts +1 -1
- package/ng-update/data/property-names.js +1 -1
- package/ng-update/data/property-names.ts +1 -1
- package/ng-update/index.js +8 -13
- package/ng-update/index.js.map +1 -1
- package/ng-update/index.ts +5 -10
- package/ng-update/upgrade-data.js +3 -1
- package/ng-update/upgrade-data.js.map +1 -1
- package/ng-update/upgrade-data.ts +3 -2
- package/ng-update/upgrade-rules/checks/_src-to-nz-image-rule.js +1 -1
- package/ng-update/upgrade-rules/checks/_src-to-nz-image-rule.js.map +1 -1
- package/ng-update/upgrade-rules/v12/index.js +32 -32
- package/ng-update/upgrade-rules/v12/index.js.map +1 -1
- package/ng-update/upgrade-rules/v12/index.ts +1 -5
- package/ng-update/upgrade-rules/v12/schema.json +1 -1
- package/ng-update/upgrade-rules/v13/index.js +100 -0
- package/ng-update/upgrade-rules/v13/index.js.map +1 -0
- package/ng-update/upgrade-rules/v13/index.spec.ts +39 -0
- package/ng-update/upgrade-rules/v13/index.ts +111 -0
- package/package.json +1 -1
- package/plugin/files/rtl/layout/basic/widgets/rtl.component.ts +1 -1
- package/plugin/index.js +10 -14
- package/plugin/index.js.map +1 -1
- package/plugin/index.ts +0 -4
- package/plugin/plugin.code-style.js +2 -2
- package/plugin/plugin.code-style.js.map +1 -1
- package/plugin/plugin.default-language.js +3 -3
- package/plugin/plugin.default-language.js.map +1 -1
- package/plugin/plugin.default-language.ts +1 -1
- package/plugin/plugin.docker.js +6 -6
- package/plugin/plugin.docker.js.map +1 -1
- package/plugin/plugin.icon.js +7 -7
- package/plugin/plugin.icon.js.map +1 -1
- package/plugin/plugin.icon.ts +2 -2
- package/plugin/plugin.rtl.js +11 -11
- package/plugin/plugin.rtl.js.map +1 -1
- package/plugin/plugin.sts.js +1 -1
- package/plugin/plugin.sts.js.map +1 -1
- package/plugin/schema.json +1 -1
- package/schema.json +10 -0
- package/sta/index.js +13 -13
- package/sta/index.js.map +1 -1
- package/sta/schema.json +1 -1
- package/tpl/index.js +2 -2
- package/tpl/index.js.map +1 -1
- package/tpl/index.ts +1 -1
- package/tpl/schema.json +3 -8
- package/utils/alain.js +17 -18
- package/utils/alain.js.map +1 -1
- package/utils/alain.ts +1 -2
- package/utils/file.js +2 -2
- package/utils/file.js.map +1 -1
- package/utils/html.js +1 -1
- package/utils/html.js.map +1 -1
- package/utils/json.js +1 -1
- package/utils/json.js.map +1 -1
- package/utils/lib-versions.js +2 -2
- package/utils/lib-versions.ts +2 -2
- package/utils/log.js +3 -3
- package/utils/log.js.map +1 -1
- package/utils/log.ts +3 -3
- package/utils/node.js +8 -0
- package/utils/node.js.map +1 -0
- package/utils/node.ts +3 -0
- package/utils/package.js +4 -4
- package/utils/package.js.map +1 -1
- package/utils/package.ts +2 -2
- package/utils/testing.js +3 -3
- package/utils/testing.js.map +1 -1
- package/utils/versions.js +24 -20
- package/utils/versions.js.map +1 -1
- package/utils/versions.ts +20 -16
- package/utils/workspace.js +25 -6
- package/utils/workspace.js.map +1 -1
- package/utils/workspace.ts +15 -0
- package/view/index.js +1 -1
- package/view/index.js.map +1 -1
- package/view/schema.json +2 -7
- package/ng-update/upgrade-rules/v11/files-tpl/main.js +0 -31
- package/ng-update/upgrade-rules/v11/files-tpl/main.js.map +0 -1
- package/ng-update/upgrade-rules/v11/files-tpl/main.ts +0 -28
- package/ng-update/upgrade-rules/v11/hmr.js +0 -103
- package/ng-update/upgrade-rules/v11/hmr.js.map +0 -1
- package/ng-update/upgrade-rules/v11/hmr.ts +0 -109
- package/ng-update/upgrade-rules/v11/index.js +0 -72
- package/ng-update/upgrade-rules/v11/index.js.map +0 -1
- package/ng-update/upgrade-rules/v11/index.spec.ts +0 -51
- package/ng-update/upgrade-rules/v11/index.ts +0 -80
- package/ng-update/upgrade-rules/v11/layout.js +0 -39
- package/ng-update/upgrade-rules/v11/layout.js.map +0 -1
- package/ng-update/upgrade-rules/v11/layout.ts +0 -47
- package/ng-update/upgrade-rules/v117/index.js +0 -82
- package/ng-update/upgrade-rules/v117/index.js.map +0 -1
- package/ng-update/upgrade-rules/v117/index.spec.ts +0 -58
- package/ng-update/upgrade-rules/v117/index.ts +0 -71
- package/plugin/files/ie/tsconfig-es5.app.js +0 -9
- package/plugin/files/ie/tsconfig-es5.app.js.map +0 -1
- package/plugin/files/ie/tsconfig-es5.spec.js +0 -9
- package/plugin/files/ie/tsconfig-es5.spec.js.map +0 -1
- package/plugin/plugin.ie.js +0 -128
- package/plugin/plugin.ie.js.map +0 -1
- package/plugin/plugin.ie.spec.ts +0 -35
- 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": "
|
|
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": "
|
|
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": "
|
|
42
|
-
"enum": ["Emulated", "
|
|
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": "
|
|
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
|
|
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", "
|
|
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": "
|
|
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": "
|
|
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
|
|
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
|
-
"
|
|
111
|
+
"skipSelector": {
|
|
106
112
|
"type": "boolean",
|
|
107
113
|
"default": false,
|
|
108
|
-
"description": "Specifies if the component
|
|
114
|
+
"description": "Specifies if the component should have a selector or not."
|
|
109
115
|
},
|
|
110
|
-
"
|
|
116
|
+
"export": {
|
|
111
117
|
"type": "boolean",
|
|
112
118
|
"default": false,
|
|
113
|
-
"description": "
|
|
119
|
+
"description": "The declaring NgModule exports this component.",
|
|
120
|
+
"x-user-analytics": 19
|
|
114
121
|
},
|
|
115
122
|
"withoutPrefix": {
|
|
116
123
|
"type": "boolean",
|
package/docs/generate.en-US.md
CHANGED
|
@@ -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
|
|
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
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
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
|
|
package/docs/generate.zh-CN.md
CHANGED
|
@@ -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
|
|
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
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
51
|
+
| `-m` 或 `--module` | 指定目标模块 |
|
|
52
|
+
| `-t` 或 `--target` | 指定目标路径,支持 `bus/list` 写法 |
|
|
53
|
+
| `--modal` | 指定是否使用模态框 |
|
|
54
|
+
| `--withoutPrefix` | 指定选择器名不加前缀 |
|
|
55
|
+
| `--withoutModulePrefixInComponentName` | 组件名不加模块名前缀 |
|
|
56
56
|
|
|
57
57
|
## Module 模块
|
|
58
58
|
|
package/docs/plugin.en-US.md
CHANGED
|
@@ -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.
|
package/docs/plugin.zh-CN.md
CHANGED
|
@@ -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,
|
|
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
|
package/empty/index.js.map
CHANGED
|
@@ -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,
|
|
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,
|
|
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
|
}
|
package/module/index.js.map
CHANGED
|
@@ -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,
|
|
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,IAAA,gBAAS,EAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAEnD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnC,IAAI,IAAI,KAAK,IA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G,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,SAAS,CAAC,EAAE;YAC3C,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,iBAAI,GAAE,CAAC,CAAC,CAAC,IAAA,mBAAM,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,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"}
|
package/module/schema.json
CHANGED
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
|
|
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
|
|
43
|
-
|
|
44
|
-
|
|
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 (
|
|
66
|
-
|
|
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
|
|
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.
|
|
72
|
+
ngCoreVersion = ngCoreVersion.substring(1);
|
|
75
73
|
}
|
|
76
74
|
if (!ngCoreVersion.startsWith(`${V}.`)) {
|
|
77
|
-
throw new
|
|
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;
|
package/ng-add/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;AAAA,wDAAsD;AAEtD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;AAAA,wDAAsD;AAEtD,2DAAiH;AACjH,4DAA0E;AAG1E,oCAAiD;AACjD,wCAAoD;AAGpD,MAAM,CAAC,GAAG,EAAE,CAAC;AAEb,SAAS,QAAQ,CAAC,OAAqB;IACrC,OAAO,GAAG,EAAE;QACV,MAAM,KAAK,GAAW,EAAE,CAAC;QAEzB,MAAM,kBAAkB,qBAA4B,OAAO,CAAE,CAAC;QAC9D,KAAK,CAAC,IAAI,CAAC,IAAA,sBAAS,EAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC,CAAC;QAEzD,IAAI,OAAO,CAAC,SAAS,EAAE;YACrB,KAAK,CAAC,IAAI,CAAC,IAAA,sBAAS,EAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;SACrE;QAED,IAAI,OAAO,CAAC,eAAe,EAAE;YAC3B,KAAK,CAAC,IAAI,CACR,IAAA,sBAAS,EAAC,QAAQ,EAAE;gBAClB,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,KAAK;gBACX,eAAe,EAAE,OAAO,CAAC,eAAe;aACzC,CAAC,CACH,CAAC;SACH;QAED,IAAI,OAAO,CAAC,GAAG,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