@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,78 +1,78 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Tree } from '@angular-devkit/schematics';
|
|
9
|
-
export declare const ANGULAR_CLI_WORKSPACE_PATH = "/angular.json";
|
|
10
|
-
/** An Angular CLI Workspacer config (angular.json) */
|
|
11
|
-
export interface Workspace {
|
|
12
|
-
/** Link to schema. */
|
|
13
|
-
$schema?: string;
|
|
14
|
-
/** Workspace Schema version. */
|
|
15
|
-
version: number;
|
|
16
|
-
/** New project root. */
|
|
17
|
-
newProjectRoot?: string;
|
|
18
|
-
/** Tool options. */
|
|
19
|
-
cli?: {
|
|
20
|
-
/** Link to schema. */
|
|
21
|
-
$schema?: string;
|
|
22
|
-
[k: string]: any;
|
|
23
|
-
};
|
|
24
|
-
/** Tool options. */
|
|
25
|
-
schematics?: {
|
|
26
|
-
/** Link to schema. */
|
|
27
|
-
$schema?: string;
|
|
28
|
-
[k: string]: any;
|
|
29
|
-
};
|
|
30
|
-
/** Tool options. */
|
|
31
|
-
architect?: {
|
|
32
|
-
/** Link to schema. */
|
|
33
|
-
$schema?: string;
|
|
34
|
-
[k: string]: any;
|
|
35
|
-
};
|
|
36
|
-
/** A map of project names to project options. */
|
|
37
|
-
projects: {
|
|
38
|
-
[k: string]: Project;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* A project in an Angular CLI workspace (e.g. an app or a library). A single workspace
|
|
43
|
-
* can house multiple projects.
|
|
44
|
-
*/
|
|
45
|
-
export interface Project {
|
|
46
|
-
name: string;
|
|
47
|
-
/** Project type. */
|
|
48
|
-
projectType: 'application' | 'library';
|
|
49
|
-
/** Root of the project sourcefiles. */
|
|
50
|
-
root: string;
|
|
51
|
-
/** Tool options. */
|
|
52
|
-
cli?: {
|
|
53
|
-
/** Link to schema. */
|
|
54
|
-
$schema?: string;
|
|
55
|
-
[k: string]: any;
|
|
56
|
-
};
|
|
57
|
-
/** Tool options. */
|
|
58
|
-
schematics?: {
|
|
59
|
-
/** Link to schema. */
|
|
60
|
-
$schema?: string;
|
|
61
|
-
[k: string]: any;
|
|
62
|
-
};
|
|
63
|
-
/** Tool options. */
|
|
64
|
-
architect?: ProjectBuildOptions;
|
|
65
|
-
}
|
|
66
|
-
/** Architect options for an Angular CLI workspace. */
|
|
67
|
-
export interface ProjectBuildOptions {
|
|
68
|
-
/** Link to schema. */
|
|
69
|
-
$schema?: string;
|
|
70
|
-
[k: string]: any;
|
|
71
|
-
}
|
|
72
|
-
/** Gets the Angular CLI workspace config (angular.json) */
|
|
73
|
-
export declare function getWorkspace(host: Tree): Workspace;
|
|
74
|
-
/**
|
|
75
|
-
* Gets a project from the Angular CLI workspace. If no project name is given, the first project
|
|
76
|
-
* will be retrieved.
|
|
77
|
-
*/
|
|
78
|
-
export declare function getProjectFromWorkspace(config: Workspace, projectName?: string): Project;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
9
|
+
export declare const ANGULAR_CLI_WORKSPACE_PATH = "/angular.json";
|
|
10
|
+
/** An Angular CLI Workspacer config (angular.json) */
|
|
11
|
+
export interface Workspace {
|
|
12
|
+
/** Link to schema. */
|
|
13
|
+
$schema?: string;
|
|
14
|
+
/** Workspace Schema version. */
|
|
15
|
+
version: number;
|
|
16
|
+
/** New project root. */
|
|
17
|
+
newProjectRoot?: string;
|
|
18
|
+
/** Tool options. */
|
|
19
|
+
cli?: {
|
|
20
|
+
/** Link to schema. */
|
|
21
|
+
$schema?: string;
|
|
22
|
+
[k: string]: any;
|
|
23
|
+
};
|
|
24
|
+
/** Tool options. */
|
|
25
|
+
schematics?: {
|
|
26
|
+
/** Link to schema. */
|
|
27
|
+
$schema?: string;
|
|
28
|
+
[k: string]: any;
|
|
29
|
+
};
|
|
30
|
+
/** Tool options. */
|
|
31
|
+
architect?: {
|
|
32
|
+
/** Link to schema. */
|
|
33
|
+
$schema?: string;
|
|
34
|
+
[k: string]: any;
|
|
35
|
+
};
|
|
36
|
+
/** A map of project names to project options. */
|
|
37
|
+
projects: {
|
|
38
|
+
[k: string]: Project;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A project in an Angular CLI workspace (e.g. an app or a library). A single workspace
|
|
43
|
+
* can house multiple projects.
|
|
44
|
+
*/
|
|
45
|
+
export interface Project {
|
|
46
|
+
name: string;
|
|
47
|
+
/** Project type. */
|
|
48
|
+
projectType: 'application' | 'library';
|
|
49
|
+
/** Root of the project sourcefiles. */
|
|
50
|
+
root: string;
|
|
51
|
+
/** Tool options. */
|
|
52
|
+
cli?: {
|
|
53
|
+
/** Link to schema. */
|
|
54
|
+
$schema?: string;
|
|
55
|
+
[k: string]: any;
|
|
56
|
+
};
|
|
57
|
+
/** Tool options. */
|
|
58
|
+
schematics?: {
|
|
59
|
+
/** Link to schema. */
|
|
60
|
+
$schema?: string;
|
|
61
|
+
[k: string]: any;
|
|
62
|
+
};
|
|
63
|
+
/** Tool options. */
|
|
64
|
+
architect?: ProjectBuildOptions;
|
|
65
|
+
}
|
|
66
|
+
/** Architect options for an Angular CLI workspace. */
|
|
67
|
+
export interface ProjectBuildOptions {
|
|
68
|
+
/** Link to schema. */
|
|
69
|
+
$schema?: string;
|
|
70
|
+
[k: string]: any;
|
|
71
|
+
}
|
|
72
|
+
/** Gets the Angular CLI workspace config (angular.json) */
|
|
73
|
+
export declare function getWorkspace(host: Tree): Workspace;
|
|
74
|
+
/**
|
|
75
|
+
* Gets a project from the Angular CLI workspace. If no project name is given, the first project
|
|
76
|
+
* will be retrieved.
|
|
77
|
+
*/
|
|
78
|
+
export declare function getProjectFromWorkspace(config: Workspace, projectName?: string): Project;
|
|
@@ -1,53 +1,53 @@
|
|
|
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
|
-
// project
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ANGULAR_CLI_WORKSPACE_PATH = void 0;
|
|
4
|
+
exports.getWorkspace = getWorkspace;
|
|
5
|
+
exports.getProjectFromWorkspace = getProjectFromWorkspace;
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
9
|
+
*
|
|
10
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11
|
+
* found in the LICENSE file at https://angular.io/license
|
|
12
|
+
*/
|
|
13
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
14
|
+
exports.ANGULAR_CLI_WORKSPACE_PATH = '/angular.json';
|
|
15
|
+
/** Gets the Angular CLI workspace config (angular.json) */
|
|
16
|
+
function getWorkspace(host) {
|
|
17
|
+
const configBuffer = host.read(exports.ANGULAR_CLI_WORKSPACE_PATH);
|
|
18
|
+
if (configBuffer === null) {
|
|
19
|
+
throw new schematics_1.SchematicsException('Could not find angular.json');
|
|
20
|
+
}
|
|
21
|
+
return JSON.parse(configBuffer.toString());
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Gets a project from the Angular CLI workspace. If no project name is given, the first project
|
|
25
|
+
* will be retrieved.
|
|
26
|
+
*/
|
|
27
|
+
function getProjectFromWorkspace(config, projectName) {
|
|
28
|
+
if (config.projects) {
|
|
29
|
+
if (projectName) {
|
|
30
|
+
const project = config.projects[projectName];
|
|
31
|
+
if (!project) {
|
|
32
|
+
throw new schematics_1.SchematicsException(`No project named "${projectName}" exists.`);
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(project, 'name', { enumerable: false, value: projectName });
|
|
35
|
+
return project;
|
|
36
|
+
}
|
|
37
|
+
// If there is exactly one non-e2e project, use that. Otherwise, require that a specific
|
|
38
|
+
// project be specified.
|
|
39
|
+
const allProjectNames = Object.keys(config.projects).filter(p => !p.includes('e2e'));
|
|
40
|
+
if (allProjectNames.length === 1) {
|
|
41
|
+
const project = config.projects[allProjectNames[0]];
|
|
42
|
+
// Set a non-enumerable project name to the project. We need the name for schematics
|
|
43
|
+
// later on, but don't want to write it back out to the config file.
|
|
44
|
+
Object.defineProperty(project, 'name', { enumerable: false, value: projectName });
|
|
45
|
+
return project;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
throw new schematics_1.SchematicsException('Multiple projects are defined; please specify a project name');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
throw new schematics_1.SchematicsException('No projects are defined');
|
|
52
|
+
}
|
|
53
53
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["config.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["config.ts"],"names":[],"mappings":";;;AA+EA,oCAOC;AAMD,0DA2BC;AAvHD;;;;;;GAMG;AACH,2DAAqE;AAExD,QAAA,0BAA0B,GAAG,eAAe,CAAC;AAqE1D,2DAA2D;AAC3D,SAAgB,YAAY,CAAC,IAAU;IACrC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,kCAA0B,CAAC,CAAC;IAC3D,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QAC1B,MAAM,IAAI,gCAAmB,CAAC,6BAA6B,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,MAAiB,EAAE,WAAoB;IAC7E,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YAC7C,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,IAAI,gCAAmB,CAAC,qBAAqB,WAAW,WAAW,CAAC,CAAC;YAC7E,CAAC;YAED,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAC,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAC,CAAC,CAAC;YAChF,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,wFAAwF;QACxF,wBAAwB;QACxB,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACrF,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,oFAAoF;YACpF,oEAAoE;YACpE,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAC,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAC,CAAC,CAAC;YAChF,OAAO,OAAO,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,gCAAmB,CAAC,8DAA8D,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IAED,MAAM,IAAI,gCAAmB,CAAC,yBAAyB,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["/**\r\n * @license\r\n * Copyright Google Inc. All Rights Reserved.\r\n *\r\n * Use of this source code is governed by an MIT-style license that can be\r\n * found in the LICENSE file at https://angular.io/license\r\n */\r\nimport {SchematicsException, Tree} from '@angular-devkit/schematics';\r\n\r\nexport const ANGULAR_CLI_WORKSPACE_PATH = '/angular.json';\r\n\r\n\r\n/** An Angular CLI Workspacer config (angular.json) */\r\nexport interface Workspace {\r\n /** Link to schema. */\r\n $schema?: string;\r\n /** Workspace Schema version. */\r\n version: number;\r\n /** New project root. */\r\n newProjectRoot?: string;\r\n /** Tool options. */\r\n cli?: {\r\n /** Link to schema. */\r\n $schema?: string;\r\n [k: string]: any;\r\n };\r\n /** Tool options. */\r\n schematics?: {\r\n /** Link to schema. */\r\n $schema?: string;\r\n [k: string]: any;\r\n };\r\n /** Tool options. */\r\n architect?: {\r\n /** Link to schema. */\r\n $schema?: string;\r\n [k: string]: any;\r\n };\r\n /** A map of project names to project options. */\r\n projects: {\r\n [k: string]: Project;\r\n };\r\n}\r\n\r\n/**\r\n * A project in an Angular CLI workspace (e.g. an app or a library). A single workspace\r\n * can house multiple projects.\r\n */\r\nexport interface Project {\r\n name: string;\r\n\r\n /** Project type. */\r\n projectType: 'application' | 'library';\r\n /** Root of the project sourcefiles. */\r\n root: string;\r\n /** Tool options. */\r\n cli?: {\r\n /** Link to schema. */\r\n $schema?: string;\r\n [k: string]: any;\r\n };\r\n /** Tool options. */\r\n schematics?: {\r\n /** Link to schema. */\r\n $schema?: string;\r\n [k: string]: any;\r\n };\r\n /** Tool options. */\r\n architect?: ProjectBuildOptions;\r\n}\r\n\r\n/** Architect options for an Angular CLI workspace. */\r\nexport interface ProjectBuildOptions {\r\n /** Link to schema. */\r\n $schema?: string;\r\n [k: string]: any;\r\n}\r\n\r\n/** Gets the Angular CLI workspace config (angular.json) */\r\nexport function getWorkspace(host: Tree): Workspace {\r\n const configBuffer = host.read(ANGULAR_CLI_WORKSPACE_PATH);\r\n if (configBuffer === null) {\r\n throw new SchematicsException('Could not find angular.json');\r\n }\r\n\r\n return JSON.parse(configBuffer.toString());\r\n}\r\n\r\n/**\r\n * Gets a project from the Angular CLI workspace. If no project name is given, the first project\r\n * will be retrieved.\r\n */\r\nexport function getProjectFromWorkspace(config: Workspace, projectName?: string): Project {\r\n if (config.projects) {\r\n if (projectName) {\r\n const project = config.projects[projectName];\r\n if (!project) {\r\n throw new SchematicsException(`No project named \"${projectName}\" exists.`);\r\n }\r\n\r\n Object.defineProperty(project, 'name', {enumerable: false, value: projectName});\r\n return project;\r\n }\r\n\r\n // If there is exactly one non-e2e project, use that. Otherwise, require that a specific\r\n // project be specified.\r\n const allProjectNames = Object.keys(config.projects).filter(p => !p.includes('e2e'));\r\n if (allProjectNames.length === 1) {\r\n const project = config.projects[allProjectNames[0]];\r\n // Set a non-enumerable project name to the project. We need the name for schematics\r\n // later on, but don't want to write it back out to the config file.\r\n Object.defineProperty(project, 'name', {enumerable: false, value: projectName});\r\n return project;\r\n } else {\r\n throw new SchematicsException('Multiple projects are defined; please specify a project name');\r\n }\r\n }\r\n\r\n throw new SchematicsException('No projects are defined');\r\n}\r\n"]}
|
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import {SchematicsException, Tree} from '@angular-devkit/schematics';
|
|
9
|
-
|
|
10
|
-
export const ANGULAR_CLI_WORKSPACE_PATH = '/angular.json';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/** An Angular CLI Workspacer config (angular.json) */
|
|
14
|
-
export interface Workspace {
|
|
15
|
-
/** Link to schema. */
|
|
16
|
-
$schema?: string;
|
|
17
|
-
/** Workspace Schema version. */
|
|
18
|
-
version: number;
|
|
19
|
-
/** New project root. */
|
|
20
|
-
newProjectRoot?: string;
|
|
21
|
-
/** Tool options. */
|
|
22
|
-
cli?: {
|
|
23
|
-
/** Link to schema. */
|
|
24
|
-
$schema?: string;
|
|
25
|
-
[k: string]: any;
|
|
26
|
-
};
|
|
27
|
-
/** Tool options. */
|
|
28
|
-
schematics?: {
|
|
29
|
-
/** Link to schema. */
|
|
30
|
-
$schema?: string;
|
|
31
|
-
[k: string]: any;
|
|
32
|
-
};
|
|
33
|
-
/** Tool options. */
|
|
34
|
-
architect?: {
|
|
35
|
-
/** Link to schema. */
|
|
36
|
-
$schema?: string;
|
|
37
|
-
[k: string]: any;
|
|
38
|
-
};
|
|
39
|
-
/** A map of project names to project options. */
|
|
40
|
-
projects: {
|
|
41
|
-
[k: string]: Project;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* A project in an Angular CLI workspace (e.g. an app or a library). A single workspace
|
|
47
|
-
* can house multiple projects.
|
|
48
|
-
*/
|
|
49
|
-
export interface Project {
|
|
50
|
-
name: string;
|
|
51
|
-
|
|
52
|
-
/** Project type. */
|
|
53
|
-
projectType: 'application' | 'library';
|
|
54
|
-
/** Root of the project sourcefiles. */
|
|
55
|
-
root: string;
|
|
56
|
-
/** Tool options. */
|
|
57
|
-
cli?: {
|
|
58
|
-
/** Link to schema. */
|
|
59
|
-
$schema?: string;
|
|
60
|
-
[k: string]: any;
|
|
61
|
-
};
|
|
62
|
-
/** Tool options. */
|
|
63
|
-
schematics?: {
|
|
64
|
-
/** Link to schema. */
|
|
65
|
-
$schema?: string;
|
|
66
|
-
[k: string]: any;
|
|
67
|
-
};
|
|
68
|
-
/** Tool options. */
|
|
69
|
-
architect?: ProjectBuildOptions;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** Architect options for an Angular CLI workspace. */
|
|
73
|
-
export interface ProjectBuildOptions {
|
|
74
|
-
/** Link to schema. */
|
|
75
|
-
$schema?: string;
|
|
76
|
-
[k: string]: any;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/** Gets the Angular CLI workspace config (angular.json) */
|
|
80
|
-
export function getWorkspace(host: Tree): Workspace {
|
|
81
|
-
const configBuffer = host.read(ANGULAR_CLI_WORKSPACE_PATH);
|
|
82
|
-
if (configBuffer === null) {
|
|
83
|
-
throw new SchematicsException('Could not find angular.json');
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return JSON.parse(configBuffer.toString());
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Gets a project from the Angular CLI workspace. If no project name is given, the first project
|
|
91
|
-
* will be retrieved.
|
|
92
|
-
*/
|
|
93
|
-
export function getProjectFromWorkspace(config: Workspace, projectName?: string): Project {
|
|
94
|
-
if (config.projects) {
|
|
95
|
-
if (projectName) {
|
|
96
|
-
const project = config.projects[projectName];
|
|
97
|
-
if (!project) {
|
|
98
|
-
throw new SchematicsException(`No project named "${projectName}" exists.`);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
Object.defineProperty(project, 'name', {enumerable: false, value: projectName});
|
|
102
|
-
return project;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// If there is exactly one non-e2e project, use that. Otherwise, require that a specific
|
|
106
|
-
// project be specified.
|
|
107
|
-
const allProjectNames = Object.keys(config.projects).filter(p => !p.includes('e2e'));
|
|
108
|
-
if (allProjectNames.length === 1) {
|
|
109
|
-
const project = config.projects[allProjectNames[0]];
|
|
110
|
-
// Set a non-enumerable project name to the project. We need the name for schematics
|
|
111
|
-
// later on, but don't want to write it back out to the config file.
|
|
112
|
-
Object.defineProperty(project, 'name', {enumerable: false, value: projectName});
|
|
113
|
-
return project;
|
|
114
|
-
} else {
|
|
115
|
-
throw new SchematicsException('Multiple projects are defined; please specify a project name');
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
throw new SchematicsException('No projects are defined');
|
|
120
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import {SchematicsException, Tree} from '@angular-devkit/schematics';
|
|
9
|
+
|
|
10
|
+
export const ANGULAR_CLI_WORKSPACE_PATH = '/angular.json';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/** An Angular CLI Workspacer config (angular.json) */
|
|
14
|
+
export interface Workspace {
|
|
15
|
+
/** Link to schema. */
|
|
16
|
+
$schema?: string;
|
|
17
|
+
/** Workspace Schema version. */
|
|
18
|
+
version: number;
|
|
19
|
+
/** New project root. */
|
|
20
|
+
newProjectRoot?: string;
|
|
21
|
+
/** Tool options. */
|
|
22
|
+
cli?: {
|
|
23
|
+
/** Link to schema. */
|
|
24
|
+
$schema?: string;
|
|
25
|
+
[k: string]: any;
|
|
26
|
+
};
|
|
27
|
+
/** Tool options. */
|
|
28
|
+
schematics?: {
|
|
29
|
+
/** Link to schema. */
|
|
30
|
+
$schema?: string;
|
|
31
|
+
[k: string]: any;
|
|
32
|
+
};
|
|
33
|
+
/** Tool options. */
|
|
34
|
+
architect?: {
|
|
35
|
+
/** Link to schema. */
|
|
36
|
+
$schema?: string;
|
|
37
|
+
[k: string]: any;
|
|
38
|
+
};
|
|
39
|
+
/** A map of project names to project options. */
|
|
40
|
+
projects: {
|
|
41
|
+
[k: string]: Project;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A project in an Angular CLI workspace (e.g. an app or a library). A single workspace
|
|
47
|
+
* can house multiple projects.
|
|
48
|
+
*/
|
|
49
|
+
export interface Project {
|
|
50
|
+
name: string;
|
|
51
|
+
|
|
52
|
+
/** Project type. */
|
|
53
|
+
projectType: 'application' | 'library';
|
|
54
|
+
/** Root of the project sourcefiles. */
|
|
55
|
+
root: string;
|
|
56
|
+
/** Tool options. */
|
|
57
|
+
cli?: {
|
|
58
|
+
/** Link to schema. */
|
|
59
|
+
$schema?: string;
|
|
60
|
+
[k: string]: any;
|
|
61
|
+
};
|
|
62
|
+
/** Tool options. */
|
|
63
|
+
schematics?: {
|
|
64
|
+
/** Link to schema. */
|
|
65
|
+
$schema?: string;
|
|
66
|
+
[k: string]: any;
|
|
67
|
+
};
|
|
68
|
+
/** Tool options. */
|
|
69
|
+
architect?: ProjectBuildOptions;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Architect options for an Angular CLI workspace. */
|
|
73
|
+
export interface ProjectBuildOptions {
|
|
74
|
+
/** Link to schema. */
|
|
75
|
+
$schema?: string;
|
|
76
|
+
[k: string]: any;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Gets the Angular CLI workspace config (angular.json) */
|
|
80
|
+
export function getWorkspace(host: Tree): Workspace {
|
|
81
|
+
const configBuffer = host.read(ANGULAR_CLI_WORKSPACE_PATH);
|
|
82
|
+
if (configBuffer === null) {
|
|
83
|
+
throw new SchematicsException('Could not find angular.json');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return JSON.parse(configBuffer.toString());
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Gets a project from the Angular CLI workspace. If no project name is given, the first project
|
|
91
|
+
* will be retrieved.
|
|
92
|
+
*/
|
|
93
|
+
export function getProjectFromWorkspace(config: Workspace, projectName?: string): Project {
|
|
94
|
+
if (config.projects) {
|
|
95
|
+
if (projectName) {
|
|
96
|
+
const project = config.projects[projectName];
|
|
97
|
+
if (!project) {
|
|
98
|
+
throw new SchematicsException(`No project named "${projectName}" exists.`);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
Object.defineProperty(project, 'name', {enumerable: false, value: projectName});
|
|
102
|
+
return project;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// If there is exactly one non-e2e project, use that. Otherwise, require that a specific
|
|
106
|
+
// project be specified.
|
|
107
|
+
const allProjectNames = Object.keys(config.projects).filter(p => !p.includes('e2e'));
|
|
108
|
+
if (allProjectNames.length === 1) {
|
|
109
|
+
const project = config.projects[allProjectNames[0]];
|
|
110
|
+
// Set a non-enumerable project name to the project. We need the name for schematics
|
|
111
|
+
// later on, but don't want to write it back out to the config file.
|
|
112
|
+
Object.defineProperty(project, 'name', {enumerable: false, value: projectName});
|
|
113
|
+
return project;
|
|
114
|
+
} else {
|
|
115
|
+
throw new SchematicsException('Multiple projects are defined; please specify a project name');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
throw new SchematicsException('No projects are defined');
|
|
120
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Path } from '@angular-devkit/core';
|
|
9
|
-
import { Tree } from '@angular-devkit/schematics';
|
|
10
|
-
export interface ModuleOptions {
|
|
11
|
-
module?: string;
|
|
12
|
-
name: string;
|
|
13
|
-
flat?: boolean;
|
|
14
|
-
path?: string;
|
|
15
|
-
skipImport?: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Find the module referred by a set of options passed to the schematics.
|
|
19
|
-
*/
|
|
20
|
-
export declare function findModuleFromOptions(host: Tree, options: ModuleOptions): Path | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Function to find the "closest" module to a generated file's path.
|
|
23
|
-
*/
|
|
24
|
-
export declare function findModule(host: Tree, generateDir: string): Path;
|
|
25
|
-
/**
|
|
26
|
-
* Build a relative path from one file path to another file path.
|
|
27
|
-
*/
|
|
28
|
-
export declare function buildRelativePath(from: string, to: string): string;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import { Path } from '@angular-devkit/core';
|
|
9
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
10
|
+
export interface ModuleOptions {
|
|
11
|
+
module?: string;
|
|
12
|
+
name: string;
|
|
13
|
+
flat?: boolean;
|
|
14
|
+
path?: string;
|
|
15
|
+
skipImport?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Find the module referred by a set of options passed to the schematics.
|
|
19
|
+
*/
|
|
20
|
+
export declare function findModuleFromOptions(host: Tree, options: ModuleOptions): Path | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Function to find the "closest" module to a generated file's path.
|
|
23
|
+
*/
|
|
24
|
+
export declare function findModule(host: Tree, generateDir: string): Path;
|
|
25
|
+
/**
|
|
26
|
+
* Build a relative path from one file path to another file path.
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildRelativePath(from: string, to: string): string;
|