@magic-xpa/cli 4.1000.0 → 4.1100.0-dev000.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/README.md +28 -28
- package/index.d.ts +1 -1
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/index.ts +1 -1
- package/package.json +2 -2
- package/src/collection.json +75 -75
- package/src/public_api.d.ts +3 -3
- package/src/public_api.js +6 -6
- package/src/public_api.js.map +1 -1
- package/src/public_api.ts +5 -5
- package/src/schematics/magic-utils/Util.d.ts +6 -6
- package/src/schematics/magic-utils/Util.js +26 -26
- package/src/schematics/magic-utils/Util.js.map +1 -1
- package/src/schematics/magic-utils/config.d.ts +12 -12
- package/src/schematics/magic-utils/config.js +56 -56
- package/src/schematics/magic-utils/config.js.map +1 -1
- package/src/schematics/magic-utils/config.ts +68 -68
- package/src/schematics/magic-utils/env.d.ts +23 -23
- package/src/schematics/magic-utils/env.js +39 -39
- package/src/schematics/magic-utils/env.js.map +1 -1
- package/src/schematics/magic-utils/env.ts +50 -50
- package/src/schematics/magic-utils/manifest.d.ts +11 -11
- package/src/schematics/magic-utils/manifest.js +40 -40
- package/src/schematics/magic-utils/manifest.js.map +1 -1
- package/src/schematics/magic-utils/manifest.ts +46 -46
- package/src/schematics/magic-utils/metadata.class.d.ts +51 -51
- package/src/schematics/magic-utils/metadata.class.js +124 -124
- package/src/schematics/magic-utils/metadata.class.js.map +1 -1
- package/src/schematics/magic-utils/metadata.class.ts +159 -159
- package/src/schematics/magic-utils/process-json.d.ts +2 -2
- package/src/schematics/magic-utils/process-json.js +157 -158
- package/src/schematics/magic-utils/process-json.js.map +1 -1
- package/src/schematics/magic-utils/rules/build-control.rule.d.ts +5 -5
- package/src/schematics/magic-utils/rules/build-control.rule.js +73 -74
- package/src/schematics/magic-utils/rules/build-control.rule.js.map +1 -1
- package/src/schematics/magic-utils/rules/build-view.rule.d.ts +3 -3
- package/src/schematics/magic-utils/rules/build-view.rule.js +82 -80
- package/src/schematics/magic-utils/rules/build-view.rule.js.map +1 -1
- package/src/schematics/magic-utils/rules/build-view.rule.ts +4 -0
- package/src/schematics/magic-utils/rules/component-list.rule.d.ts +3 -3
- package/src/schematics/magic-utils/rules/component-list.rule.js +316 -317
- package/src/schematics/magic-utils/rules/component-list.rule.js.map +1 -1
- package/src/schematics/magic-utils/rules/generate.rule.d.ts +5 -5
- package/src/schematics/magic-utils/rules/generate.rule.js +53 -54
- package/src/schematics/magic-utils/rules/generate.rule.js.map +1 -1
- package/src/schematics/magic-utils/rules/generate.rule.ts +61 -61
- package/src/schematics/magic-utils/rules/init-add-modules.rule.d.ts +12 -12
- package/src/schematics/magic-utils/rules/init-add-modules.rule.js +295 -296
- package/src/schematics/magic-utils/rules/init-add-modules.rule.js.map +1 -1
- package/src/schematics/magic-utils/rules/init-add-modules.rule.ts +360 -360
- package/src/schematics/magic-utils/rules/init-gen-components.rule.d.ts +4 -4
- package/src/schematics/magic-utils/rules/init-gen-components.rule.js +65 -66
- package/src/schematics/magic-utils/rules/init-gen-components.rule.js.map +1 -1
- package/src/schematics/magic-utils/rules/init-magic-metadata.rule.d.ts +3 -3
- package/src/schematics/magic-utils/rules/init-magic-metadata.rule.js +17 -18
- package/src/schematics/magic-utils/rules/init-magic-metadata.rule.js.map +1 -1
- package/src/schematics/magic-utils/rules/init-magic-metadata.rule.ts +19 -19
- package/src/schematics/magic-utils/rules/load-views-gen.rule.d.ts +3 -3
- package/src/schematics/magic-utils/rules/load-views-gen.rule.js +28 -29
- package/src/schematics/magic-utils/rules/load-views-gen.rule.js.map +1 -1
- package/src/schematics/magic-utils/rules/magic-option.scheme.d.ts +22 -21
- package/src/schematics/magic-utils/rules/magic-option.scheme.js +2 -2
- package/src/schematics/magic-utils/rules/magic-option.scheme.js.map +1 -1
- package/src/schematics/magic-utils/rules/magic-option.scheme.ts +24 -23
- package/src/schematics/magic-utils/utils.d.ts +12 -12
- package/src/schematics/magic-utils/utils.js +116 -117
- package/src/schematics/magic-utils/utils.js.map +1 -1
- package/src/schematics/magic-utils/utils.ts +134 -134
- package/src/schematics/mg-Install-prerequisites/index.d.ts +3 -3
- package/src/schematics/mg-Install-prerequisites/index.js +24 -25
- package/src/schematics/mg-Install-prerequisites/index.js.map +1 -1
- package/src/schematics/mg-Install-prerequisites/index.ts +30 -30
- package/src/schematics/mg-Install-prerequisites/schema.json +14 -14
- package/src/schematics/mg-add/files/src/app/app.component.html +17 -17
- package/src/schematics/mg-add/files/src/app/app.routes.ts +14 -14
- package/src/schematics/mg-add/files/src/app/magic/component-list.g.ts +9 -9
- package/src/schematics/mg-add/files/src/app/magic/lazy-loader.service.ts +2 -1
- package/src/schematics/mg-add/files/src/app/magic/magic.gen.lib.module.ts +19 -19
- package/src/schematics/mg-add/files/src/magic-styles.css +131 -131
- package/src/schematics/mg-add/index.d.ts +3 -3
- package/src/schematics/mg-add/index.js +150 -151
- package/src/schematics/mg-add/index.js.map +1 -1
- package/src/schematics/mg-add/schema.json +29 -29
- package/src/schematics/mg-add/utils/add-declaration-to-root-module.d.ts +2 -2
- package/src/schematics/mg-add/utils/add-declaration-to-root-module.js +10 -11
- package/src/schematics/mg-add/utils/add-declaration-to-root-module.js.map +1 -1
- package/src/schematics/mg-add/utils/add-declaration-to-root-module.ts +12 -12
- package/src/schematics/mg-add/webModule/app.routes.ts +14 -14
- package/src/schematics/mg-add-tasks/index.d.ts +3 -3
- package/src/schematics/mg-add-tasks/index.js +29 -30
- package/src/schematics/mg-add-tasks/index.js.map +1 -1
- package/src/schematics/mg-add-tasks/index.ts +53 -53
- package/src/schematics/mg-add-tasks/schema.json +41 -41
- package/src/schematics/mg-delete-files/index.d.ts +3 -3
- package/src/schematics/mg-delete-files/index.js +12 -13
- package/src/schematics/mg-delete-files/index.js.map +1 -1
- package/src/schematics/mg-delete-files/index.ts +12 -12
- package/src/schematics/mg-delete-files/schema.json +14 -14
- package/src/schematics/mg-gen-module/index.d.ts +3 -3
- package/src/schematics/mg-gen-module/index.js +14 -15
- package/src/schematics/mg-gen-module/index.js.map +1 -1
- package/src/schematics/mg-gen-module/index.ts +14 -14
- package/src/schematics/mg-gen-module/schema.json +24 -24
- package/src/schematics/mg-generate/index.d.ts +3 -3
- package/src/schematics/mg-generate/index.js +12 -13
- package/src/schematics/mg-generate/index.js.map +1 -1
- package/src/schematics/mg-generate/index.ts +12 -12
- package/src/schematics/mg-generate/schema.json +34 -34
- package/src/schematics/mg-generate-component/index.d.ts +3 -3
- package/src/schematics/mg-generate-component/index.js +34 -35
- package/src/schematics/mg-generate-component/index.js.map +1 -1
- package/src/schematics/mg-generate-component/schema.json +6 -0
- package/src/schematics/mg-install/index.d.ts +3 -3
- package/src/schematics/mg-install/index.js +29 -30
- package/src/schematics/mg-install/index.js.map +1 -1
- package/src/schematics/mg-install/index.ts +37 -37
- package/src/schematics/mg-install/schema.json +24 -24
- package/src/schematics/mg-routes/index.d.ts +6 -6
- package/src/schematics/mg-routes/index.js +62 -63
- package/src/schematics/mg-routes/index.js.map +1 -1
- package/src/schematics/mg-routes/schema.json +14 -14
- package/src/schematics/mg-single-control/index.d.ts +3 -3
- package/src/schematics/mg-single-control/index.js +28 -29
- package/src/schematics/mg-single-control/index.js.map +1 -1
- package/src/schematics/mg-single-control/schema.json +24 -24
- package/src/schematics/utils/ast.d.ts +21 -21
- package/src/schematics/utils/ast.js +90 -91
- package/src/schematics/utils/ast.js.map +1 -1
- package/src/schematics/utils/ast.ts +103 -103
- package/src/schematics/utils/devkit-utils/README.md +1 -1
- package/src/schematics/utils/devkit-utils/ast-utils.d.ts +87 -87
- package/src/schematics/utils/devkit-utils/ast-utils.js +489 -490
- package/src/schematics/utils/devkit-utils/ast-utils.js.map +1 -1
- package/src/schematics/utils/devkit-utils/ast-utils.ts +570 -570
- package/src/schematics/utils/devkit-utils/ast-utils_old.d.ts +68 -68
- package/src/schematics/utils/devkit-utils/ast-utils_old.js +419 -420
- package/src/schematics/utils/devkit-utils/ast-utils_old.js.map +1 -1
- package/src/schematics/utils/devkit-utils/ast-utils_old.ts +478 -478
- package/src/schematics/utils/devkit-utils/change.d.ts +66 -66
- package/src/schematics/utils/devkit-utils/change.js +94 -94
- package/src/schematics/utils/devkit-utils/change.js.map +1 -1
- package/src/schematics/utils/devkit-utils/change.ts +127 -127
- package/src/schematics/utils/devkit-utils/component.d.ts +2 -2
- package/src/schematics/utils/devkit-utils/component.js +96 -97
- package/src/schematics/utils/devkit-utils/component.js.map +1 -1
- package/src/schematics/utils/devkit-utils/component.ts +136 -136
- package/src/schematics/utils/devkit-utils/config.d.ts +78 -78
- package/src/schematics/utils/devkit-utils/config.js +52 -52
- package/src/schematics/utils/devkit-utils/config.js.map +1 -1
- package/src/schematics/utils/devkit-utils/config.ts +120 -120
- package/src/schematics/utils/devkit-utils/find-module.d.ts +28 -28
- package/src/schematics/utils/devkit-utils/find-module.js +92 -93
- package/src/schematics/utils/devkit-utils/find-module.js.map +1 -1
- package/src/schematics/utils/devkit-utils/find-module.ts +108 -108
- package/src/schematics/utils/devkit-utils/ng-ast-utils.d.ts +5 -5
- package/src/schematics/utils/devkit-utils/ng-ast-utils.js +73 -74
- package/src/schematics/utils/devkit-utils/ng-ast-utils.js.map +1 -1
- package/src/schematics/utils/devkit-utils/ng-ast-utils.ts +84 -84
- package/src/schematics/utils/devkit-utils/parse-name.d.ts +13 -13
- package/src/schematics/utils/devkit-utils/parse-name.js +19 -20
- package/src/schematics/utils/devkit-utils/parse-name.js.map +1 -1
- package/src/schematics/utils/devkit-utils/parse-name.ts +24 -24
- package/src/schematics/utils/devkit-utils/route-utils.d.ts +20 -20
- package/src/schematics/utils/devkit-utils/route-utils.js +133 -134
- package/src/schematics/utils/devkit-utils/route-utils.js.map +1 -1
- package/src/schematics/utils/devkit-utils/route-utils.ts +180 -180
- package/src/schematics/utils/devkit-utils/validation.d.ts +1 -1
- package/src/schematics/utils/devkit-utils/validation.js +18 -19
- package/src/schematics/utils/devkit-utils/validation.js.map +1 -1
- package/src/schematics/utils/devkit-utils/validation.ts +16 -16
- package/src/schematics/utils/html.d.ts +18 -18
- package/src/schematics/utils/html.js +59 -60
- package/src/schematics/utils/html.js.map +1 -1
- package/src/schematics/utils/html.ts +63 -63
- package/src/schematics/utils/lib-versions.d.ts +3 -3
- package/src/schematics/utils/lib-versions.js +6 -6
- package/src/schematics/utils/lib-versions.js.map +1 -1
- package/src/schematics/utils/lib-versions.ts +3 -3
- package/src/schematics/utils/package.d.ts +5 -5
- package/src/schematics/utils/package.js +20 -21
- package/src/schematics/utils/package.js.map +1 -1
- package/src/schematics/utils/package.ts +22 -22
- package/src/schematics/utils/testing.d.ts +5 -5
- package/src/schematics/utils/testing.js +26 -27
- package/src/schematics/utils/testing.js.map +1 -1
- package/src/schematics/utils/testing.ts +25 -25
- package/src/types/enums/Enums.d.ts +1646 -1646
- package/src/types/enums/Enums.js +1862 -1862
- package/src/types/enums/Enums.js.map +1 -1
- package/src/types/enums/Enums.ts +2063 -2063
- package/src/types/enums/generated-file-types.enum.d.ts +6 -6
- package/src/types/enums/generated-file-types.enum.js +10 -10
- package/src/types/enums/generated-file-types.enum.js.map +1 -1
- package/src/types/enums/generated-file-types.enum.ts +6 -6
- package/src/types/enums/horizontal-alignments.enum.d.ts +5 -5
- package/src/types/enums/horizontal-alignments.enum.js +9 -9
- package/src/types/enums/horizontal-alignments.enum.js.map +1 -1
- package/src/types/enums/horizontal-alignments.enum.ts +6 -6
- package/src/types/enums/themes.enum.d.ts +6 -6
- package/src/types/enums/themes.enum.js +10 -10
- package/src/types/enums/themes.enum.js.map +1 -1
- package/src/types/enums/themes.enum.ts +6 -6
- package/src/types/index.d.ts +7 -7
- package/src/types/index.js +10 -10
- package/src/types/index.js.map +1 -1
- package/src/types/index.ts +8 -8
- package/src/types/interfaces/app.d.ts +53 -53
- package/src/types/interfaces/app.js +9 -9
- package/src/types/interfaces/app.js.map +1 -1
- package/src/types/interfaces/app.ts +89 -89
- package/src/types/interfaces/control.d.ts +82 -82
- package/src/types/interfaces/control.js +2 -2
- package/src/types/interfaces/control.js.map +1 -1
- package/src/types/interfaces/control.ts +106 -106
- package/src/types/interfaces/env.interface.d.ts +19 -19
- package/src/types/interfaces/env.interface.js +10 -10
- package/src/types/interfaces/template.config.d.ts +8 -8
- package/src/types/interfaces/template.config.js +2 -2
- package/src/types/interfaces/template.config.js.map +1 -1
- package/src/types/interfaces/template.config.ts +11 -11
- package/templates/angular/src/app/app.component.html.ejs +17 -17
- package/templates/angular/src/app/cmp-array.ejs +3 -3
- package/templates/angular/src/app/cmp-hash.ejs +3 -3
- package/templates/angular/src/app/component-list.g.ts +21 -21
- package/templates/angular/src/app.component.ts +14 -14
- package/templates/angular/src/app.module.ts +70 -70
- package/templates/angular/src/app.routes.ts +73 -73
- package/templates/angular/src/styles/app.css +5 -5
- package/templates/attributes/button_attributes.ejs +2 -2
- package/templates/attributes/common/base/class.ejs +6 -6
- package/templates/attributes/common/base/control_type.ejs +53 -53
- package/templates/attributes/common/base/enabled.ejs +9 -9
- package/templates/attributes/common/base/imageFileName.ejs +3 -3
- package/templates/attributes/common/base/no_control_class.ejs +3 -3
- package/templates/attributes/common/base/rtol.ejs +3 -3
- package/templates/attributes/common/base/tabindex.ejs +11 -11
- package/templates/attributes/common/base/testingId.ejs +8 -8
- package/templates/attributes/common/base/tooltip.ejs +7 -7
- package/templates/attributes/common/base/visible.ejs +6 -6
- package/templates/attributes/common/base/wallpaper.ejs +3 -3
- package/templates/attributes/common/base_attributes.ejs +10 -10
- package/templates/attributes/common/container_attributes.ejs +6 -6
- package/templates/attributes/common/control_attributes.ejs +3 -3
- package/templates/attributes/common/format.ejs +5 -5
- package/templates/attributes/common/input/hint.ejs +13 -13
- package/templates/attributes/common/input/multiline_edit.ejs +3 -3
- package/templates/attributes/common/input/must_input.ejs +8 -8
- package/templates/attributes/common/input/password_edit.ejs +7 -7
- package/templates/attributes/common/input/row_editing_input_attributes.ejs +6 -6
- package/templates/attributes/common/input/validation.ejs +5 -5
- package/templates/attributes/common/input_attributes.ejs +4 -4
- package/templates/attributes/common/no_control_base_attributes.ejs +4 -4
- package/templates/attributes/common/row_editing_button_attributes.ejs +10 -10
- package/templates/component/view.component.html +14 -14
- package/templates/component/view.component.ts +123 -122
- package/templates/themes/basicHTML/Code/theme.module.ts +10 -10
- package/templates/themes/basicHTML/checkbox.ejs +1 -1
- package/templates/themes/basicHTML/combobox.ejs +37 -37
- package/templates/themes/basicHTML/edit.ejs +169 -168
- package/templates/themes/basicHTML/form.ejs +4 -4
- package/templates/themes/basicHTML/group.ejs +4 -4
- package/templates/themes/basicHTML/image.ejs +6 -6
- package/templates/themes/basicHTML/label.ejs +11 -11
- package/templates/themes/basicHTML/listbox.ejs +21 -21
- package/templates/themes/basicHTML/push-button.ejs +28 -28
- package/templates/themes/basicHTML/radio.ejs +20 -20
- package/templates/themes/basicHTML/subform.ejs +6 -6
- package/templates/themes/basicHTML/tab.ejs +31 -31
- package/templates/themes/basicHTML/tabpage.ejs +5 -5
- package/templates/themes/basicHiddenHTML/Code/theme.module.ts +10 -10
- package/templates/themes/basicHiddenHTML/combobox.ejs +5 -5
- package/templates/themes/basicHiddenHTML/form.ejs +3 -3
- package/templates/themes/basicHiddenHTML/group.ejs +2 -2
- package/templates/themes/basicHiddenHTML/image.ejs +4 -4
- package/templates/themes/basicHiddenHTML/label.ejs +1 -1
- package/templates/themes/basicHiddenHTML/listbox.ejs +8 -8
- package/templates/themes/basicHiddenHTML/push-button.ejs +26 -26
- package/templates/themes/basicHiddenHTML/radio.ejs +17 -17
- package/templates/themes/basicHiddenHTML/tab.ejs +13 -13
- package/templates/themes/basicHiddenHTML/table.ejs +18 -18
- package/templates/themes/basicHiddenHTML/tabpage.ejs +2 -2
- package/templates/themes/container.ejs +26 -26
- package/templates/themes/control.ejs +52 -52
- package/templates/themes/editTypeSelector.ejs +1 -1
- package/templates/themes/material/Code/theme.module.ts +68 -68
- package/templates/themes/material/base_attributes_date.ejs +8 -8
- package/templates/themes/material/checkbox.ejs +1 -1
- package/templates/themes/material/combobox.ejs +43 -43
- package/templates/themes/material/edit.ejs +204 -204
- package/templates/themes/material/group.ejs +3 -3
- package/templates/themes/material/listbox.ejs +22 -23
- package/templates/themes/material/push-button.ejs +28 -28
- package/templates/themes/material/radio.ejs +22 -22
- package/templates/themes/material/subform.ejs +8 -8
- package/templates/themes/material/tab.ejs +19 -19
- package/templates/themes/router_outlet.ejs +5 -5
- package/templates/themes/table/HTMLTable/columnHeader.ejs +3 -1
- package/templates/themes/table/HTMLTable/table.ejs +37 -37
- package/templates/themes/table/grid/additionalComponentCode.ejs +26 -26
- package/templates/themes/table/grid/additionalIncludes.ejs +1 -1
- package/templates/themes/table/grid/column.ejs +3 -1
- package/templates/themes/table/grid/table.ejs +37 -37
- package/templates/themes/table/repeatable/column.ejs +11 -11
- package/templates/themes/table/repeatable/table.ejs +28 -28
- package/templates/themes/tableTypeSelector.ejs +21 -21
- package/tsconfig.json +36 -36
|
@@ -1,297 +1,296 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
//-------------------------------------------------------------------------------------------------
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
//
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
//-------------------------------------------------------------------------------------------------
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
rules
|
|
240
|
-
|
|
241
|
-
//
|
|
242
|
-
//
|
|
243
|
-
// routeItem
|
|
244
|
-
//
|
|
245
|
-
//
|
|
246
|
-
// route
|
|
247
|
-
// route.
|
|
248
|
-
// route.
|
|
249
|
-
// route.
|
|
250
|
-
//
|
|
251
|
-
//
|
|
252
|
-
//
|
|
253
|
-
//
|
|
254
|
-
//
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
//-------------------------------------------------------------------------------------------------
|
|
261
|
-
// create route for module
|
|
262
|
-
//-------------------------------------------------------------------------------------------------
|
|
263
|
-
function addRouteFileToModuleFile(options, webModuleName) {
|
|
264
|
-
return (tree, context) => {
|
|
265
|
-
let rules = [];
|
|
266
|
-
const modulePath = getWebModuleFullFileName(webModuleName); // get the magic.gen.lib.module.ts according to the module name
|
|
267
|
-
const moduleName = `MagicRoutingModule`; //for now it will be the same for all modules ... getWebModuleClass(webModuleName);
|
|
268
|
-
const srcModuleName = `./app.routes`;
|
|
269
|
-
rules.push(addMagicModuleToAppModule(options, modulePath, moduleName, srcModuleName));
|
|
270
|
-
return (0, schematics_1.chain)(rules)(tree, context);
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
(0,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initGenModules = initGenModules;
|
|
4
|
+
exports.overwriteWebModuleFileName = overwriteWebModuleFileName;
|
|
5
|
+
exports.updateWebModuleFileWithNewClassName = updateWebModuleFileWithNewClassName;
|
|
6
|
+
exports.getDestinationModulePathByWebModuleName = getDestinationModulePathByWebModuleName;
|
|
7
|
+
exports.checkAndCreateModule = checkAndCreateModule;
|
|
8
|
+
exports.generateWebModule = generateWebModule;
|
|
9
|
+
exports.generateWebModules = generateWebModules;
|
|
10
|
+
exports.checkAndCreateRouteForModule = checkAndCreateRouteForModule;
|
|
11
|
+
exports.createRoute = createRoute;
|
|
12
|
+
exports.addRouteFileToModuleFile = addRouteFileToModuleFile;
|
|
13
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
14
|
+
const env_1 = require("../env");
|
|
15
|
+
const Util_1 = require("../Util");
|
|
16
|
+
const ast_1 = require("../../utils/ast");
|
|
17
|
+
const env_interface_1 = require("../../../types/interfaces/env.interface");
|
|
18
|
+
//-------------------------------------------------------------------------------------------------
|
|
19
|
+
// init generate module into env.modulesGen
|
|
20
|
+
//-------------------------------------------------------------------------------------------------
|
|
21
|
+
function initGenModules(options, generateViaCLI = false) {
|
|
22
|
+
return (tree, context) => {
|
|
23
|
+
let metadata = env_1.env.metadata;
|
|
24
|
+
let programList = env_1.env.programList;
|
|
25
|
+
env_1.env.modulesGen = [];
|
|
26
|
+
let web_modules = metadata.config.web_modules;
|
|
27
|
+
if (generateViaCLI) {
|
|
28
|
+
let programListString = JSON.stringify(programList.programListContents);
|
|
29
|
+
// Validate whether the component is valid
|
|
30
|
+
if (programListString.includes(options.component)) {
|
|
31
|
+
let moduleInfo = new env_interface_1.ModuleInfo(options.module, options.loadOnDemand);
|
|
32
|
+
env_1.env.modulesGen.push(moduleInfo);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
(0, Util_1.LogLn)(`Invalid component ${options.component} to generate.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// Generate only one module from --module=xxxx
|
|
40
|
+
if (options.module) {
|
|
41
|
+
let moduleInfo = new env_interface_1.ModuleInfo(options.module, options.loadOnDemand);
|
|
42
|
+
env_1.env.modulesGen.push(moduleInfo);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
// Generate list of components from config.json, properties web_modules.module_name
|
|
46
|
+
for (let modulePath of web_modules) {
|
|
47
|
+
//LogLn(` Web Module name: [${modulePath.module_name}] IsLoadOnDemand? [${modulePath.load_on_demand}]`);
|
|
48
|
+
let moduleInfo = new env_interface_1.ModuleInfo(modulePath.module_name, modulePath.load_on_demand);
|
|
49
|
+
env_1.env.modulesGen.push(moduleInfo);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (!generateViaCLI)
|
|
54
|
+
(0, Util_1.LogLn)(` Number of modules to be check for generate: ${web_modules.length}`);
|
|
55
|
+
return tree;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//-------------------------------------------------------------------------------------------------
|
|
59
|
+
// overwrite the web module file name with the new content
|
|
60
|
+
//-------------------------------------------------------------------------------------------------
|
|
61
|
+
function overwriteWebModuleFileName(options, moduleNameFileName, content) {
|
|
62
|
+
return (tree, _context) => {
|
|
63
|
+
if (!tree.exists(moduleNameFileName)) {
|
|
64
|
+
(0, Util_1.LogLn)(` [>Error] File cannot be overwrite, The file is not exist !!! : ${moduleNameFileName}`);
|
|
65
|
+
}
|
|
66
|
+
tree.overwrite(moduleNameFileName, content);
|
|
67
|
+
return tree;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//-------------------------------------------------------------------------------------------------
|
|
71
|
+
// update the the web module file name with the new class name
|
|
72
|
+
//-------------------------------------------------------------------------------------------------
|
|
73
|
+
function updateWebModuleFileWithNewClassName(options, webModuleName) {
|
|
74
|
+
return (tree, context) => {
|
|
75
|
+
let rules = [];
|
|
76
|
+
const origModuleFileName = getWebModuleFullFileName(webModuleName);
|
|
77
|
+
// create new class name for "web Module Name"
|
|
78
|
+
let newClassModuleName = getWebModuleClass(webModuleName);
|
|
79
|
+
//read the exist module file name
|
|
80
|
+
const text = tree.read(origModuleFileName);
|
|
81
|
+
if (text === null) {
|
|
82
|
+
throw new schematics_1.SchematicsException(`File ${origModuleFileName} does not exist.`);
|
|
83
|
+
}
|
|
84
|
+
let sourceText = text.toString('utf-8');
|
|
85
|
+
if (sourceText !== "") {
|
|
86
|
+
let newsourceText = sourceText.replace(`MagicGenLibModule`, newClassModuleName);
|
|
87
|
+
rules.push(overwriteWebModuleFileName(options, origModuleFileName, newsourceText));
|
|
88
|
+
}
|
|
89
|
+
return (0, schematics_1.chain)(rules)(tree, context);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//-------------------------------------------------------------------------------------------------
|
|
93
|
+
// copy the two default files into the web module path
|
|
94
|
+
//-------------------------------------------------------------------------------------------------
|
|
95
|
+
function copyDefaultMagicFilesToWebModule(options, webModuleName) {
|
|
96
|
+
return (tree, context) => {
|
|
97
|
+
const webModulePath = getDestinationModulePathByWebModuleName(webModuleName);
|
|
98
|
+
return (0, schematics_1.chain)([
|
|
99
|
+
(0, schematics_1.branchAndMerge)((0, schematics_1.chain)([
|
|
100
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)(`./../mg-add/files/src/app/magic/`), [
|
|
101
|
+
(0, schematics_1.move)(webModulePath)
|
|
102
|
+
]), schematics_1.MergeStrategy.AllowCreationConflict)
|
|
103
|
+
]))
|
|
104
|
+
])(tree, context);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
//-------------------------------------------------------------------------------------------------
|
|
108
|
+
// delete LazyLoadService for non root modules
|
|
109
|
+
//-------------------------------------------------------------------------------------------------
|
|
110
|
+
function deleteLazyLoadService(webModuleName) {
|
|
111
|
+
return (tree) => {
|
|
112
|
+
const lazyLoaderServicePath = getDestinationModulePathByWebModuleName(webModuleName) + '/lazy-loader.service.ts';
|
|
113
|
+
if (webModuleName != '') {
|
|
114
|
+
if (!tree.exists(lazyLoaderServicePath)) {
|
|
115
|
+
(0, Util_1.LogLn)(` [>Error] File cannot be overwrite, The file is not exist !!! :lazyLoaderServicePath`);
|
|
116
|
+
}
|
|
117
|
+
tree.delete(lazyLoaderServicePath);
|
|
118
|
+
return tree;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//-------------------------------------------------------------------------------------------------
|
|
123
|
+
// get destination path according to the send webModuleName
|
|
124
|
+
//-------------------------------------------------------------------------------------------------
|
|
125
|
+
function getDestinationModulePathByWebModuleName(webModuleName) {
|
|
126
|
+
const newDestModulePath = `${env_1.env.metadata.paths.rootMagicGenFolder}/${env_1.GEN_FOLDER}/${webModuleName}`;
|
|
127
|
+
return newDestModulePath;
|
|
128
|
+
}
|
|
129
|
+
//-------------------------------------------------------------------------------------------------
|
|
130
|
+
// get web module full file name according to the send webModuleName
|
|
131
|
+
//-------------------------------------------------------------------------------------------------
|
|
132
|
+
function getWebModuleFullFileName(webModuleName) {
|
|
133
|
+
// calc the path of new the module
|
|
134
|
+
const newDestModulePath = getDestinationModulePathByWebModuleName(webModuleName);
|
|
135
|
+
return `${newDestModulePath}/magic.gen.lib.module.ts`;
|
|
136
|
+
}
|
|
137
|
+
//-------------------------------------------------------------------------------------------------
|
|
138
|
+
// get web module class according to the send webModuleName
|
|
139
|
+
//-------------------------------------------------------------------------------------------------
|
|
140
|
+
function getWebModuleClass(webModuleName) {
|
|
141
|
+
return `Magic` + webModuleName + `Module`;
|
|
142
|
+
}
|
|
143
|
+
//-------------------------------------------------------------------------------------------------
|
|
144
|
+
// add magic module to app module
|
|
145
|
+
//-------------------------------------------------------------------------------------------------
|
|
146
|
+
function addMagicModuleToAppModule(options, modulePath, moduleName, srcModuleName) {
|
|
147
|
+
return (tree, context) => {
|
|
148
|
+
const project = env_1.env.project;
|
|
149
|
+
(0, Util_1.LogLn)(` [>] add New Web Module :[${moduleName}] `);
|
|
150
|
+
(0, Util_1.LogLn)(` [>] from :[${srcModuleName}]`);
|
|
151
|
+
(0, Util_1.LogLn)(` [>] To App Module :[${modulePath}]`);
|
|
152
|
+
(0, ast_1.addModuleImportToModule)(tree, modulePath, // for now we will update env.metadata.paths.magicGenLibModule
|
|
153
|
+
moduleName, // 'MagicXXXModule',
|
|
154
|
+
srcModuleName);
|
|
155
|
+
return tree;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
//-------------------------------------------------------------------------------------------------
|
|
159
|
+
// create module
|
|
160
|
+
//-------------------------------------------------------------------------------------------------
|
|
161
|
+
function checkAndCreateModule(options, webModuleName, loadOnDemand) {
|
|
162
|
+
return (tree, context) => {
|
|
163
|
+
let rules = [];
|
|
164
|
+
const webModuleFullFileName = getWebModuleFullFileName(webModuleName);
|
|
165
|
+
// only if not exist create the new 2 files magic.gen.lib.module.ts & component-list.g.ts
|
|
166
|
+
if (!tree.exists(webModuleFullFileName)) {
|
|
167
|
+
rules.push(copyDefaultMagicFilesToWebModule(options, webModuleName));
|
|
168
|
+
rules.push(updateWebModuleFileWithNewClassName(tree, webModuleName));
|
|
169
|
+
rules.push(deleteLazyLoadService(webModuleName));
|
|
170
|
+
// for NON load on demand we need to update magic root module
|
|
171
|
+
if (!loadOnDemand) {
|
|
172
|
+
const newDestModulePath = `./${webModuleName}/magic.gen.lib.module`;
|
|
173
|
+
const webModuleClass = getWebModuleClass(webModuleName);
|
|
174
|
+
rules.push(addMagicModuleToAppModule(options, env_1.env.metadata.paths.magicGenLibModule, webModuleClass, newDestModulePath));
|
|
175
|
+
}
|
|
176
|
+
return (0, schematics_1.chain)(rules)(tree, context);
|
|
177
|
+
}
|
|
178
|
+
;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
//-------------------------------------------------------------------------------------------------
|
|
182
|
+
// check if module is exist, only if not exist create the web module
|
|
183
|
+
//-------------------------------------------------------------------------------------------------
|
|
184
|
+
function generateWebModule(options, webModuleName, loadOnDemand) {
|
|
185
|
+
return (tree, context) => {
|
|
186
|
+
let rules = [];
|
|
187
|
+
(0, Util_1.LogLn)(` [>]Handling Web Module named: [${webModuleName}] isLoadOnDemand: [${loadOnDemand}]`);
|
|
188
|
+
rules.push(checkAndCreateModule(options, webModuleName, loadOnDemand));
|
|
189
|
+
rules.push(checkAndCreateRouteForModule(options, webModuleName, loadOnDemand));
|
|
190
|
+
return (0, schematics_1.chain)(rules)(tree, context);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
//-------------------------------------------------------------------------------------------------
|
|
194
|
+
// generate all the modules in env.modulesGen
|
|
195
|
+
//-------------------------------------------------------------------------------------------------
|
|
196
|
+
function generateWebModules(options, generateViaCLI = false) {
|
|
197
|
+
return (tree, context) => {
|
|
198
|
+
let rules = [];
|
|
199
|
+
for (let webModuleInfo of env_1.env.modulesGen) {
|
|
200
|
+
if (webModuleInfo.moduleName !== undefined && webModuleInfo.moduleName !== "") {
|
|
201
|
+
if (generateViaCLI) {
|
|
202
|
+
if (webModuleInfo.moduleName === options.module) {
|
|
203
|
+
rules.push(generateWebModule(options, webModuleInfo.moduleName, webModuleInfo.loadOnDemand));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
rules.push(generateWebModule(options, webModuleInfo.moduleName, webModuleInfo.loadOnDemand));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return (0, schematics_1.chain)(rules)(tree, context);
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
//-------------------------------------------------------------------------------------------------
|
|
215
|
+
// check if module is exist, only if not exist create the web module
|
|
216
|
+
//-------------------------------------------------------------------------------------------------
|
|
217
|
+
function checkAndCreateRouteForModule(options, webModuleName, loadOnDemand) {
|
|
218
|
+
return (tree, context) => {
|
|
219
|
+
let rules = [];
|
|
220
|
+
if (loadOnDemand) {
|
|
221
|
+
const newDestRoutePathForModule = env_1.env.metadata.paths.getRoutePathForWebModule(webModuleName);
|
|
222
|
+
// only if file not exist then copy the default route
|
|
223
|
+
if (!tree.exists(newDestRoutePathForModule)) {
|
|
224
|
+
rules.push(createRoute(options, webModuleName));
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
// if file exist then only update the magic.gen.lib.module.ts
|
|
228
|
+
rules.push(addRouteFileToModuleFile(options, webModuleName));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return (0, schematics_1.chain)(rules)(tree, context);
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
//-------------------------------------------------------------------------------------------------
|
|
235
|
+
// create route for module
|
|
236
|
+
//-------------------------------------------------------------------------------------------------
|
|
237
|
+
function createRoute(options, webModuleName) {
|
|
238
|
+
return (tree, context) => {
|
|
239
|
+
let rules = [];
|
|
240
|
+
rules.push(copyDefaultRouteMagicFilesToWebModule(options, webModuleName));
|
|
241
|
+
// --------------------------------------------------------
|
|
242
|
+
// // generate the route for module /////
|
|
243
|
+
// let routeItem : RouteTable = new RouteTable();
|
|
244
|
+
// routeItem.module_name = webModuleName;
|
|
245
|
+
//
|
|
246
|
+
// let route:Route = new Route();
|
|
247
|
+
// route.ModuleName = webModuleName;
|
|
248
|
+
// route.OutletName="";
|
|
249
|
+
// route.RouteName="";
|
|
250
|
+
// route.children=null;
|
|
251
|
+
//
|
|
252
|
+
// routeItem.routesArray = [route];
|
|
253
|
+
// rules.push(genRouteFile(options, routeItem ));
|
|
254
|
+
// --------------------------------------------------------
|
|
255
|
+
// update the new MagicRoutingModule in file magic.gen.lib.module.ts of the module
|
|
256
|
+
rules.push(addRouteFileToModuleFile(options, webModuleName));
|
|
257
|
+
return (0, schematics_1.chain)(rules)(tree, context);
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
//-------------------------------------------------------------------------------------------------
|
|
261
|
+
// create route for module
|
|
262
|
+
//-------------------------------------------------------------------------------------------------
|
|
263
|
+
function addRouteFileToModuleFile(options, webModuleName) {
|
|
264
|
+
return (tree, context) => {
|
|
265
|
+
let rules = [];
|
|
266
|
+
const modulePath = getWebModuleFullFileName(webModuleName); // get the magic.gen.lib.module.ts according to the module name
|
|
267
|
+
const moduleName = `MagicRoutingModule`; //for now it will be the same for all modules ... getWebModuleClass(webModuleName);
|
|
268
|
+
const srcModuleName = `./app.routes`;
|
|
269
|
+
rules.push(addMagicModuleToAppModule(options, modulePath, moduleName, srcModuleName));
|
|
270
|
+
return (0, schematics_1.chain)(rules)(tree, context);
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
//-------------------------------------------------------------------------------------------------
|
|
274
|
+
// copy the two default files into the web module path
|
|
275
|
+
//-------------------------------------------------------------------------------------------------
|
|
276
|
+
function copyDefaultRouteMagicFilesToWebModule(options, webModuleName) {
|
|
277
|
+
return (tree, context) => {
|
|
278
|
+
const routeFileForWebModulePath = env_1.env.metadata.paths.getRoutePathForWebModule(webModuleName);
|
|
279
|
+
if (tree.exists(routeFileForWebModulePath)) {
|
|
280
|
+
let rules = [];
|
|
281
|
+
return (0, schematics_1.chain)(rules)(tree, context);
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
const webModulePath = getDestinationModulePathByWebModuleName(webModuleName);
|
|
285
|
+
(0, Util_1.LogLn)(`[ >] copy default Route file to webModule [${webModuleName}]`);
|
|
286
|
+
return (0, schematics_1.chain)([
|
|
287
|
+
(0, schematics_1.branchAndMerge)((0, schematics_1.chain)([
|
|
288
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)(`./../mg-add/webModule/`), [
|
|
289
|
+
(0, schematics_1.move)(webModulePath)
|
|
290
|
+
]), schematics_1.MergeStrategy.AllowCreationConflict)
|
|
291
|
+
]))
|
|
292
|
+
])(tree, context);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
}
|
|
297
296
|
//# sourceMappingURL=init-add-modules.rule.js.map
|