@abp/ng.schematics 10.5.0 → 10.6.0-rc.1
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/commands/ai-config/index.d.ts +3 -3
- package/commands/ai-config/index.js +88 -88
- package/commands/ai-config/index.js.map +1 -1
- package/commands/ai-config/model.d.ts +10 -10
- package/commands/ai-config/model.js +2 -2
- package/commands/api/files-service/proxy/__namespace@dir__/__name@kebab__.service.ts.template +6 -4
- package/commands/api/index.d.ts +2 -2
- package/commands/api/index.js +139 -138
- package/commands/api/index.js.map +1 -1
- package/commands/change-theme/index.d.ts +28 -28
- package/commands/change-theme/index.js +474 -473
- package/commands/change-theme/index.js.map +1 -1
- package/commands/change-theme/model.d.ts +5 -5
- package/commands/change-theme/model.js +2 -2
- package/commands/change-theme/style-map.d.ts +16 -16
- package/commands/change-theme/style-map.js +424 -424
- package/commands/change-theme/theme-options.enum.d.ts +6 -6
- package/commands/change-theme/theme-options.enum.js +11 -11
- package/commands/change-theme/theme-options.enum.js.map +1 -1
- package/commands/create-lib/index.d.ts +13 -13
- package/commands/create-lib/index.js +298 -298
- package/commands/create-lib/index.js.map +1 -1
- package/commands/create-lib/models/generate-lib-schema.d.ts +20 -20
- package/commands/create-lib/models/generate-lib-schema.js +8 -8
- package/commands/create-lib/models/generate-lib-schema.js.map +1 -1
- package/commands/create-lib/models/index.d.ts +1 -1
- package/commands/create-lib/models/index.js +4 -17
- package/commands/create-lib/models/index.js.map +1 -1
- package/commands/proxy-add/index.d.ts +2 -2
- package/commands/proxy-add/index.js +41 -41
- package/commands/proxy-add/index.js.map +1 -1
- package/commands/proxy-index/index.d.ts +5 -5
- package/commands/proxy-index/index.js +14 -14
- package/commands/proxy-index/index.js.map +1 -1
- package/commands/proxy-refresh/index.d.ts +3 -3
- package/commands/proxy-refresh/index.js +27 -27
- package/commands/proxy-refresh/index.js.map +1 -1
- package/commands/proxy-remove/index.d.ts +3 -3
- package/commands/proxy-remove/index.js +33 -33
- package/commands/proxy-remove/index.js.map +1 -1
- package/commands/ssr-add/index.d.ts +11 -11
- package/commands/ssr-add/index.js +360 -361
- package/commands/ssr-add/index.js.map +1 -1
- package/commands/ssr-add/server/index.d.ts +10 -10
- package/commands/ssr-add/server/index.js +209 -205
- package/commands/ssr-add/server/index.js.map +1 -1
- package/commands/ssr-add/server/index.ts +6 -2
- package/constants/api.d.ts +1 -1
- package/constants/api.js +4 -4
- package/constants/index.d.ts +4 -4
- package/constants/index.js +7 -20
- package/constants/index.js.map +1 -1
- package/constants/proxy.d.ts +4 -4
- package/constants/proxy.js +7 -7
- package/constants/symbols.d.ts +1 -1
- package/constants/symbols.js +4 -4
- package/constants/system-types.d.ts +1 -1
- package/constants/system-types.js +29 -29
- package/constants/volo.d.ts +5 -5
- package/constants/volo.js +34 -34
- package/enums/binding-source-id.d.ts +8 -7
- package/enums/binding-source-id.js +12 -11
- package/enums/binding-source-id.js.map +1 -1
- package/enums/exception.d.ts +17 -17
- package/enums/exception.js +2 -2
- package/enums/import-keyword.d.ts +4 -4
- package/enums/import-keyword.js +8 -8
- package/enums/import-keyword.js.map +1 -1
- package/enums/index.d.ts +5 -5
- package/enums/index.js +8 -21
- package/enums/index.js.map +1 -1
- package/enums/method-modifier.d.ts +6 -6
- package/enums/method-modifier.js +10 -10
- package/enums/method-modifier.js.map +1 -1
- package/enums/service-types.d.ts +6 -6
- package/enums/service-types.js +10 -10
- package/enums/service-types.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +6 -19
- package/index.js.map +1 -1
- package/models/api-definition.d.ts +97 -93
- package/models/api-definition.js +2 -2
- package/models/generate-proxy-schema.d.ts +28 -28
- package/models/generate-proxy-schema.js +2 -2
- package/models/import.d.ts +11 -11
- package/models/import.js +13 -13
- package/models/index.d.ts +11 -11
- package/models/index.js +14 -27
- package/models/index.js.map +1 -1
- package/models/method.d.ts +36 -34
- package/models/method.js +73 -70
- package/models/method.js.map +1 -1
- package/models/model.d.ts +48 -48
- package/models/model.js +76 -76
- package/models/model.js.map +1 -1
- package/models/project.d.ts +5 -5
- package/models/project.js +2 -2
- package/models/proxy-config.d.ts +4 -4
- package/models/proxy-config.js +2 -2
- package/models/rule.d.ts +2 -2
- package/models/rule.js +2 -2
- package/models/service.d.ts +21 -21
- package/models/service.js +11 -11
- package/models/tree.d.ts +1 -1
- package/models/tree.js +2 -2
- package/models/util.d.ts +7 -7
- package/models/util.js +2 -2
- package/package.json +6 -6
- package/utils/angular/add-declaration-to-ng-module.d.ts +20 -20
- package/utils/angular/add-declaration-to-ng-module.js +45 -45
- package/utils/angular/add-declaration-to-ng-module.js.map +1 -1
- package/utils/angular/ast-utils.d.ts +106 -106
- package/utils/angular/ast-utils.js +518 -518
- package/utils/angular/ast-utils.js.map +1 -1
- package/utils/angular/change.d.ts +68 -68
- package/utils/angular/change.js +121 -121
- package/utils/angular/change.js.map +1 -1
- package/utils/angular/dependencies.d.ts +23 -23
- package/utils/angular/dependencies.js +56 -56
- package/utils/angular/dependencies.js.map +1 -1
- package/utils/angular/dependency.d.ts +96 -96
- package/utils/angular/dependency.js +123 -122
- package/utils/angular/dependency.js.map +1 -1
- package/utils/angular/eol.d.ts +8 -8
- package/utils/angular/eol.js +22 -23
- package/utils/angular/eol.js.map +1 -1
- package/utils/angular/find-module.d.ts +33 -33
- package/utils/angular/find-module.js +105 -105
- package/utils/angular/find-module.js.map +1 -1
- package/utils/angular/generate-from-files.d.ts +19 -19
- package/utils/angular/generate-from-files.js +48 -49
- package/utils/angular/generate-from-files.js.map +1 -1
- package/utils/angular/index.d.ts +15 -15
- package/utils/angular/index.js +18 -31
- package/utils/angular/index.js.map +1 -1
- package/utils/angular/json-file.d.ts +24 -24
- package/utils/angular/json-file.js +71 -71
- package/utils/angular/json-file.js.map +1 -1
- package/utils/angular/latest-versions/index.d.ts +28 -28
- package/utils/angular/latest-versions/index.js +31 -31
- package/utils/angular/ng-ast-utils.d.ts +12 -12
- package/utils/angular/ng-ast-utils.js +79 -79
- package/utils/angular/ng-ast-utils.js.map +1 -1
- package/utils/angular/parse-name.d.ts +13 -13
- package/utils/angular/parse-name.js +19 -20
- package/utils/angular/parse-name.js.map +1 -1
- package/utils/angular/paths.d.ts +8 -8
- package/utils/angular/paths.js +17 -18
- package/utils/angular/paths.js.map +1 -1
- package/utils/angular/project-targets.d.ts +11 -11
- package/utils/angular/project-targets.js +21 -22
- package/utils/angular/project-targets.js.map +1 -1
- package/utils/angular/standalone/app_component.d.ts +29 -29
- package/utils/angular/standalone/app_component.js +107 -107
- package/utils/angular/standalone/app_component.js.map +1 -1
- package/utils/angular/standalone/app_config.d.ts +23 -23
- package/utils/angular/standalone/app_config.js +89 -89
- package/utils/angular/standalone/app_config.js.map +1 -1
- package/utils/angular/standalone/code_block.d.ts +53 -53
- package/utils/angular/standalone/code_block.js +80 -79
- package/utils/angular/standalone/code_block.js.map +1 -1
- package/utils/angular/standalone/index.d.ts +9 -9
- package/utils/angular/standalone/index.js +13 -13
- package/utils/angular/standalone/rules.d.ts +45 -45
- package/utils/angular/standalone/rules.js +187 -188
- package/utils/angular/standalone/rules.js.map +1 -1
- package/utils/angular/standalone/util.d.ts +35 -35
- package/utils/angular/standalone/util.js +135 -135
- package/utils/angular/standalone/util.js.map +1 -1
- package/utils/angular/test/create-app-module.d.ts +9 -9
- package/utils/angular/test/create-app-module.js +14 -15
- package/utils/angular/test/create-app-module.js.map +1 -1
- package/utils/angular/test/get-file-content.d.ts +9 -9
- package/utils/angular/test/get-file-content.js +17 -18
- package/utils/angular/test/get-file-content.js.map +1 -1
- package/utils/angular/test/index.d.ts +9 -9
- package/utils/angular/test/index.js +12 -25
- package/utils/angular/test/index.js.map +1 -1
- package/utils/angular/validation.d.ts +10 -10
- package/utils/angular/validation.js +28 -28
- package/utils/angular/validation.js.map +1 -1
- package/utils/angular/workspace-models.d.ts +167 -167
- package/utils/angular/workspace-models.js +43 -43
- package/utils/angular/workspace-models.js.map +1 -1
- package/utils/angular/workspace.d.ts +65 -65
- package/utils/angular/workspace.js +135 -135
- package/utils/angular/workspace.js.map +1 -1
- package/utils/angular-schematic/generate-lib.d.ts +3 -3
- package/utils/angular-schematic/generate-lib.js +52 -53
- package/utils/angular-schematic/generate-lib.js.map +1 -1
- package/utils/angular-schematic/index.d.ts +1 -1
- package/utils/angular-schematic/index.js +4 -17
- package/utils/angular-schematic/index.js.map +1 -1
- package/utils/api.d.ts +2 -2
- package/utils/api.js +7 -8
- package/utils/api.js.map +1 -1
- package/utils/ast.d.ts +5 -5
- package/utils/ast.js +28 -28
- package/utils/ast.js.map +1 -1
- package/utils/barrel.d.ts +4 -4
- package/utils/barrel.js +86 -87
- package/utils/barrel.js.map +1 -1
- package/utils/common.d.ts +11 -11
- package/utils/common.js +78 -78
- package/utils/common.js.map +1 -1
- package/utils/enum.d.ts +18 -18
- package/utils/enum.js +39 -40
- package/utils/enum.js.map +1 -1
- package/utils/file.d.ts +2 -2
- package/utils/file.js +8 -9
- package/utils/file.js.map +1 -1
- package/utils/generics.d.ts +26 -26
- package/utils/generics.js +89 -89
- package/utils/generics.js.map +1 -1
- package/utils/import.d.ts +3 -3
- package/utils/import.js +10 -11
- package/utils/import.js.map +1 -1
- package/utils/index.d.ts +22 -22
- package/utils/index.js +25 -38
- package/utils/index.js.map +1 -1
- package/utils/methods.d.ts +4 -4
- package/utils/methods.js +31 -31
- package/utils/methods.js.map +1 -1
- package/utils/model.d.ts +14 -14
- package/utils/model.js +217 -211
- package/utils/model.js.map +1 -1
- package/utils/namespace.d.ts +1 -1
- package/utils/namespace.js +17 -18
- package/utils/namespace.js.map +1 -1
- package/utils/ng-module.d.ts +46 -46
- package/utils/ng-module.js +126 -125
- package/utils/ng-module.js.map +1 -1
- package/utils/path.d.ts +2 -2
- package/utils/path.js +35 -36
- package/utils/path.js.map +1 -1
- package/utils/rule.d.ts +4 -4
- package/utils/rule.js +32 -33
- package/utils/rule.js.map +1 -1
- package/utils/service.d.ts +8 -8
- package/utils/service.js +280 -171
- package/utils/service.js.map +1 -1
- package/utils/source.d.ts +13 -13
- package/utils/source.js +165 -165
- package/utils/source.js.map +1 -1
- package/utils/standalone.d.ts +59 -59
- package/utils/standalone.js +146 -145
- package/utils/standalone.js.map +1 -1
- package/utils/text.d.ts +10 -10
- package/utils/text.js +59 -59
- package/utils/text.js.map +1 -1
- package/utils/tree.d.ts +14 -14
- package/utils/tree.js +83 -83
- package/utils/tree.js.map +1 -1
- package/utils/type.d.ts +13 -13
- package/utils/type.js +112 -113
- package/utils/type.js.map +1 -1
- package/utils/workspace.d.ts +20 -20
- package/utils/workspace.js +113 -114
- package/utils/workspace.js.map +1 -1
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.readWorkspace = exports.
|
|
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
|
-
var workspace_1 = require("./workspace"); // for backwards compatibility
|
|
135
|
-
Object.defineProperty(exports, "readWorkspace", { enumerable: true, get: function () { return workspace_1.getWorkspace; } });
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.readWorkspace = exports.TreeWorkspaceHost = void 0;
|
|
11
|
+
exports.updateWorkspace = updateWorkspace;
|
|
12
|
+
exports.getWorkspace = getWorkspace;
|
|
13
|
+
exports.writeWorkspace = writeWorkspace;
|
|
14
|
+
exports.buildDefaultPath = buildDefaultPath;
|
|
15
|
+
exports.createDefaultPath = createDefaultPath;
|
|
16
|
+
exports.allWorkspaceTargets = allWorkspaceTargets;
|
|
17
|
+
exports.allTargetOptions = allTargetOptions;
|
|
18
|
+
const core_1 = require("@angular-devkit/core");
|
|
19
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
20
|
+
const workspace_models_1 = require("./workspace-models");
|
|
21
|
+
const DEFAULT_WORKSPACE_PATH = '/angular.json';
|
|
22
|
+
/**
|
|
23
|
+
* A {@link workspaces.WorkspaceHost} backed by a Schematics {@link Tree} instance.
|
|
24
|
+
*/
|
|
25
|
+
class TreeWorkspaceHost {
|
|
26
|
+
constructor(tree) {
|
|
27
|
+
this.tree = tree;
|
|
28
|
+
}
|
|
29
|
+
async readFile(path) {
|
|
30
|
+
return this.tree.readText(path);
|
|
31
|
+
}
|
|
32
|
+
async writeFile(path, data) {
|
|
33
|
+
if (this.tree.exists(path)) {
|
|
34
|
+
this.tree.overwrite(path, data);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.tree.create(path, data);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async isDirectory(path) {
|
|
41
|
+
// approximate a directory check
|
|
42
|
+
return !this.tree.exists(path) && this.tree.getDir(path).subfiles.length > 0;
|
|
43
|
+
}
|
|
44
|
+
async isFile(path) {
|
|
45
|
+
return this.tree.exists(path);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.TreeWorkspaceHost = TreeWorkspaceHost;
|
|
49
|
+
/**
|
|
50
|
+
* Updates the workspace file (`angular.json`) found within the root of the schematic's tree.
|
|
51
|
+
* The workspace object model can be directly modified within the provided updater function
|
|
52
|
+
* with changes being written to the workspace file after the updater function returns.
|
|
53
|
+
* The spacing and overall layout of the file (including comments) will be maintained where
|
|
54
|
+
* possible when updating the file.
|
|
55
|
+
*
|
|
56
|
+
* @param updater An update function that can be used to modify the object model for the
|
|
57
|
+
* workspace. A {@link WorkspaceDefinition} is provided as the first argument to the function.
|
|
58
|
+
*/
|
|
59
|
+
function updateWorkspace(updater) {
|
|
60
|
+
return async (host) => {
|
|
61
|
+
const workspace = await getWorkspace(host);
|
|
62
|
+
const result = await updater(workspace);
|
|
63
|
+
await core_1.workspaces.writeWorkspace(workspace, new TreeWorkspaceHost(host));
|
|
64
|
+
return result || schematics_1.noop;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
// TODO: This should be renamed `readWorkspace` once deep imports are restricted (already exported from `utility` with that name)
|
|
68
|
+
/**
|
|
69
|
+
* Reads a workspace file (`angular.json`) from the provided {@link Tree} instance.
|
|
70
|
+
*
|
|
71
|
+
* @param tree A schematics {@link Tree} instance used to access the workspace file.
|
|
72
|
+
* @param path The path where a workspace file should be found. If a file is specified, the file
|
|
73
|
+
* path will be used. If a directory is specified, the file `angular.json` will be used from
|
|
74
|
+
* within the specified directory. Defaults to `/angular.json`.
|
|
75
|
+
* @returns A {@link WorkspaceDefinition} representing the workspace found at the specified path.
|
|
76
|
+
*/
|
|
77
|
+
async function getWorkspace(tree, path = DEFAULT_WORKSPACE_PATH) {
|
|
78
|
+
const host = new TreeWorkspaceHost(tree);
|
|
79
|
+
const { workspace } = await core_1.workspaces.readWorkspace(path, host);
|
|
80
|
+
return workspace;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Writes a workspace file (`angular.json`) to the provided {@link Tree} instance.
|
|
84
|
+
* The spacing and overall layout of an exisitng file (including comments) will be maintained where
|
|
85
|
+
* possible when writing the file.
|
|
86
|
+
*
|
|
87
|
+
* @param tree A schematics {@link Tree} instance used to access the workspace file.
|
|
88
|
+
* @param workspace The {@link WorkspaceDefinition} to write.
|
|
89
|
+
* @param path The path where a workspace file should be written. If a file is specified, the file
|
|
90
|
+
* path will be used. If not provided, the definition's underlying file path stored during reading
|
|
91
|
+
* will be used.
|
|
92
|
+
*/
|
|
93
|
+
async function writeWorkspace(tree, workspace, path) {
|
|
94
|
+
const host = new TreeWorkspaceHost(tree);
|
|
95
|
+
return core_1.workspaces.writeWorkspace(workspace, host, path);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Build a default project path for generating.
|
|
99
|
+
* @param project The project which will have its default path generated.
|
|
100
|
+
*/
|
|
101
|
+
function buildDefaultPath(project) {
|
|
102
|
+
const root = project.sourceRoot ? `/${project.sourceRoot}/` : `/${project.root}/src/`;
|
|
103
|
+
const projectDirName = project.extensions['projectType'] === workspace_models_1.ProjectType.Application ? 'app' : 'lib';
|
|
104
|
+
return `${root}${projectDirName}`;
|
|
105
|
+
}
|
|
106
|
+
async function createDefaultPath(tree, projectName) {
|
|
107
|
+
const workspace = await getWorkspace(tree);
|
|
108
|
+
const project = workspace.projects.get(projectName);
|
|
109
|
+
if (!project) {
|
|
110
|
+
throw new Error(`Project "${projectName}" does not exist.`);
|
|
111
|
+
}
|
|
112
|
+
return buildDefaultPath(project);
|
|
113
|
+
}
|
|
114
|
+
function* allWorkspaceTargets(workspace) {
|
|
115
|
+
for (const [projectName, project] of workspace.projects) {
|
|
116
|
+
for (const [targetName, target] of project.targets) {
|
|
117
|
+
yield [targetName, target, projectName, project];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function* allTargetOptions(target, skipBaseOptions = false) {
|
|
122
|
+
if (!skipBaseOptions && target.options) {
|
|
123
|
+
yield [undefined, target.options];
|
|
124
|
+
}
|
|
125
|
+
if (!target.configurations) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
for (const [name, options] of Object.entries(target.configurations)) {
|
|
129
|
+
if (options !== undefined) {
|
|
130
|
+
yield [name, options];
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
var workspace_1 = require("./workspace"); // for backwards compatibility
|
|
135
|
+
Object.defineProperty(exports, "readWorkspace", { enumerable: true, get: function () { return workspace_1.getWorkspace; } });
|
|
136
136
|
//# sourceMappingURL=workspace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular/workspace.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular/workspace.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAmDH,0CAYC;AAYD,oCASC;AAaD,wCAQC;AAMD,4CAMC;AAED,8CAQC;AAED,kDAQC;AAED,4CAiBC;AA1JD,+CAAwD;AACxD,2DAA8D;AAC9D,yDAAiD;AAEjD,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAO/C;;GAEG;AACH,MAAa,iBAAiB;IAC5B,YAA6B,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;IAE3C,KAAK,CAAC,QAAQ,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAY,EAAE,IAAY;QACxC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,IAAY;QAC5B,gCAAgC;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C,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QAC3B,OAAO;IACT,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;QACpE,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;AACH,CAAC;AAED,yCAA4D,CAAC,8BAA8B;AAAlF,0GAAA,YAAY,OAAiB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Rule, Tree } from '@angular-devkit/schematics';
|
|
2
|
-
export declare function updateTsConfig(packageName: string, ...paths: string[]): (host: Tree) => import("@angular-devkit/schematics/src/tree/interface").Tree | undefined;
|
|
3
|
-
export declare function addLibToWorkspaceFile(projectRoot: string, projectName: string): Rule;
|
|
1
|
+
import { Rule, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
export declare function updateTsConfig(packageName: string, ...paths: string[]): (host: Tree) => import("@angular-devkit/schematics/src/tree/interface").Tree | undefined;
|
|
3
|
+
export declare function addLibToWorkspaceFile(projectRoot: string, projectName: string): Rule;
|
|
@@ -1,54 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
file.
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function addLibToWorkspaceFile(projectRoot, projectName) {
|
|
18
|
-
return (0, angular_1.updateWorkspace)(workspace => {
|
|
19
|
-
workspace.projects.add({
|
|
20
|
-
name: projectName,
|
|
21
|
-
root: projectRoot,
|
|
22
|
-
sourceRoot: `${projectRoot}/src`,
|
|
23
|
-
projectType: angular_1.ProjectType.Library,
|
|
24
|
-
prefix: 'lib',
|
|
25
|
-
targets: {
|
|
26
|
-
build: {
|
|
27
|
-
builder: angular_1.Builders.NgPackagr,
|
|
28
|
-
defaultConfiguration: 'production',
|
|
29
|
-
options: {
|
|
30
|
-
project: `${projectRoot}/ng-package.json`,
|
|
31
|
-
},
|
|
32
|
-
configurations: {
|
|
33
|
-
production: {
|
|
34
|
-
tsConfig: `${projectRoot}/tsconfig.lib.prod.json`,
|
|
35
|
-
},
|
|
36
|
-
development: {
|
|
37
|
-
tsConfig: `${projectRoot}/tsconfig.lib.json`,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
test: {
|
|
42
|
-
builder: angular_1.Builders.UnitTest,
|
|
43
|
-
options: {
|
|
44
|
-
tsConfig: `${projectRoot}/tsconfig.spec.json`,
|
|
45
|
-
buildTarget: `${projectName}:build`,
|
|
46
|
-
runner: 'vitest',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
exports.addLibToWorkspaceFile = addLibToWorkspaceFile;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateTsConfig = updateTsConfig;
|
|
4
|
+
exports.addLibToWorkspaceFile = addLibToWorkspaceFile;
|
|
5
|
+
const angular_1 = require("../angular");
|
|
6
|
+
function updateTsConfig(packageName, ...paths) {
|
|
7
|
+
return (host) => {
|
|
8
|
+
if (!host.exists('tsconfig.json')) {
|
|
9
|
+
return host;
|
|
10
|
+
}
|
|
11
|
+
const file = new angular_1.JSONFile(host, 'tsconfig.json');
|
|
12
|
+
const jsonPath = ['compilerOptions', 'paths', packageName];
|
|
13
|
+
const value = file.get(jsonPath);
|
|
14
|
+
file.modify(jsonPath, Array.isArray(value) ? [...value, ...paths] : paths);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function addLibToWorkspaceFile(projectRoot, projectName) {
|
|
18
|
+
return (0, angular_1.updateWorkspace)(workspace => {
|
|
19
|
+
workspace.projects.add({
|
|
20
|
+
name: projectName,
|
|
21
|
+
root: projectRoot,
|
|
22
|
+
sourceRoot: `${projectRoot}/src`,
|
|
23
|
+
projectType: angular_1.ProjectType.Library,
|
|
24
|
+
prefix: 'lib',
|
|
25
|
+
targets: {
|
|
26
|
+
build: {
|
|
27
|
+
builder: angular_1.Builders.NgPackagr,
|
|
28
|
+
defaultConfiguration: 'production',
|
|
29
|
+
options: {
|
|
30
|
+
project: `${projectRoot}/ng-package.json`,
|
|
31
|
+
},
|
|
32
|
+
configurations: {
|
|
33
|
+
production: {
|
|
34
|
+
tsConfig: `${projectRoot}/tsconfig.lib.prod.json`,
|
|
35
|
+
},
|
|
36
|
+
development: {
|
|
37
|
+
tsConfig: `${projectRoot}/tsconfig.lib.json`,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
test: {
|
|
42
|
+
builder: angular_1.Builders.UnitTest,
|
|
43
|
+
options: {
|
|
44
|
+
tsConfig: `${projectRoot}/tsconfig.spec.json`,
|
|
45
|
+
buildTarget: `${projectName}:build`,
|
|
46
|
+
runner: 'vitest',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
54
53
|
//# sourceMappingURL=generate-lib.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-lib.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular-schematic/generate-lib.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-lib.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular-schematic/generate-lib.ts"],"names":[],"mappings":";;AAGA,wCAWC;AAED,sDAmCC;AAlDD,wCAA8E;AAE9E,SAA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AAE;oBACJ,OAAO,EAAE,kBAAQ,CAAC,QAAQ;oBAC1B,OAAO,EAAE;wBACP,QAAQ,EAAE,GAAG,WAAW,qBAAqB;wBAC7C,WAAW,EAAE,GAAG,WAAW,QAAQ;wBACnC,MAAM,EAAE,QAAQ;qBACjB;iBACF;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './generate-lib';
|
|
1
|
+
export * from './generate-lib';
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./generate-lib"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./generate-lib"), exports);
|
|
18
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular-schematic/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular-schematic/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B"}
|
package/utils/api.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GenerateProxySchema } from '../models';
|
|
2
|
-
export declare function createApisGenerator(schema: GenerateProxySchema, generated: string[]): import("@angular-devkit/schematics").Rule;
|
|
1
|
+
import { GenerateProxySchema } from '../models';
|
|
2
|
+
export declare function createApisGenerator(schema: GenerateProxySchema, generated: string[]): import("@angular-devkit/schematics").Rule;
|
package/utils/api.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createApisGenerator =
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
function createApisGenerator(schema, generated) {
|
|
6
|
-
return (0, schematics_1.chain)(generated.map(m => (0, schematics_1.schematic)('api', { ...schema, module: m, entryPoint: schema.entryPoint || '__default' })));
|
|
7
|
-
}
|
|
8
|
-
exports.createApisGenerator = createApisGenerator;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createApisGenerator = createApisGenerator;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
function createApisGenerator(schema, generated) {
|
|
6
|
+
return (0, schematics_1.chain)(generated.map(m => (0, schematics_1.schematic)('api', { ...schema, module: m, entryPoint: schema.entryPoint || '__default' })));
|
|
7
|
+
}
|
|
9
8
|
//# sourceMappingURL=api.js.map
|
package/utils/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/api.ts"],"names":[],"mappings":";;AAGA,kDAMC;AATD,2DAA8D;AAG9D,SAAgB,mBAAmB,CAAC,MAA2B,EAAE,SAAmB;IAClF,OAAO,IAAA,kBAAK,EACV,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAChB,IAAA,sBAAS,EAAC,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,WAAW,EAAE,CAAC,CACzF,CACF,CAAC;AACJ,CAAC"}
|
package/utils/ast.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as ts from 'typescript';
|
|
2
|
-
export declare function findEnvironmentExpression(source: ts.SourceFile): ts.ObjectLiteralExpression | undefined;
|
|
3
|
-
export declare function getAssignedPropertyFromObjectliteral(expression: ts.ObjectLiteralExpression, variableSelector: string[]): string | undefined;
|
|
4
|
-
export declare function isBooleanStringOrNumberLiteral(node: ts.Node): node is ts.StringLiteral | ts.NumericLiteral | ts.BooleanLiteral;
|
|
5
|
-
export declare function removeEmptyElementsFromArrayLiteral(array: ts.ArrayLiteralExpression): ts.ArrayLiteralExpression;
|
|
1
|
+
import * as ts from 'typescript';
|
|
2
|
+
export declare function findEnvironmentExpression(source: ts.SourceFile): ts.ObjectLiteralExpression | undefined;
|
|
3
|
+
export declare function getAssignedPropertyFromObjectliteral(expression: ts.ObjectLiteralExpression, variableSelector: string[]): string | undefined;
|
|
4
|
+
export declare function isBooleanStringOrNumberLiteral(node: ts.Node): node is ts.StringLiteral | ts.NumericLiteral | ts.BooleanLiteral;
|
|
5
|
+
export declare function removeEmptyElementsFromArrayLiteral(array: ts.ArrayLiteralExpression): ts.ArrayLiteralExpression;
|
package/utils/ast.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findEnvironmentExpression = findEnvironmentExpression;
|
|
4
|
+
exports.getAssignedPropertyFromObjectliteral = getAssignedPropertyFromObjectliteral;
|
|
5
|
+
exports.isBooleanStringOrNumberLiteral = isBooleanStringOrNumberLiteral;
|
|
6
|
+
exports.removeEmptyElementsFromArrayLiteral = removeEmptyElementsFromArrayLiteral;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
const ts = tslib_1.__importStar(require("typescript"));
|
|
9
|
+
const ast_utils_1 = require("./angular/ast-utils");
|
|
10
|
+
function findEnvironmentExpression(source) {
|
|
11
|
+
const expressions = (0, ast_utils_1.findNodes)(source, ts.isObjectLiteralExpression);
|
|
12
|
+
return expressions.find(expr => expr.getText().includes('production'));
|
|
13
|
+
}
|
|
14
|
+
function getAssignedPropertyFromObjectliteral(expression, variableSelector) {
|
|
15
|
+
const expressions = (0, ast_utils_1.findNodes)(expression, isBooleanStringOrNumberLiteral);
|
|
16
|
+
const literal = expressions.find(node => Boolean(variableSelector.reduceRight((acc, key) => acc?.name?.getText() === key ? acc.parent.parent : undefined, node.parent)));
|
|
17
|
+
return literal ? literal.getText() : undefined;
|
|
18
|
+
}
|
|
19
|
+
function isBooleanStringOrNumberLiteral(node) {
|
|
20
|
+
return (ts.isStringLiteral(node) ||
|
|
21
|
+
ts.isNumericLiteral(node) ||
|
|
22
|
+
node.kind === ts.SyntaxKind.TrueKeyword ||
|
|
23
|
+
node.kind === ts.SyntaxKind.FalseKeyword);
|
|
24
|
+
}
|
|
25
|
+
function removeEmptyElementsFromArrayLiteral(array) {
|
|
26
|
+
const cleaned = array.elements.filter(el => el.kind !== ts.SyntaxKind.OmittedExpression);
|
|
27
|
+
return ts.factory.updateArrayLiteralExpression(array, ts.factory.createNodeArray(cleaned));
|
|
28
|
+
}
|
|
29
29
|
//# sourceMappingURL=ast.js.map
|
package/utils/ast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/ast.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/ast.ts"],"names":[],"mappings":";;AAGA,8DAGC;AAED,oFAiBC;AAED,wEASC;AAED,kFAKC;;AA3CD,uDAAiC;AACjC,mDAAgD;AAEhD,SAAgB,yBAAyB,CAAC,MAAqB;IAC7D,MAAM,WAAW,GAAG,IAAA,qBAAS,EAAC,MAAM,EAAE,EAAE,CAAC,yBAAyB,CAAC,CAAC;IACpE,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,SAAgB,oCAAoC,CAClD,UAAsC,EACtC,gBAA0B;IAE1B,MAAM,WAAW,GAAG,IAAA,qBAAS,EAAC,UAAU,EAAE,8BAA8B,CAAC,CAAC;IAE1E,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACtC,OAAO,CACL,gBAAgB,CAAC,WAAW,CAC1B,CAAC,GAA0B,EAAE,GAAG,EAAE,EAAE,CAClC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC9D,IAAI,CAAC,MAAM,CACZ,CACF,CACF,CAAC;IAEF,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACjD,CAAC;AAED,SAAgB,8BAA8B,CAC5C,IAAa;IAEb,OAAO,CACL,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;QACxB,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,WAAW;QACvC,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,YAAY,CACzC,CAAC;AACJ,CAAC;AAED,SAAgB,mCAAmC,CACjD,KAAgC;IAEhC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;IACzF,OAAO,EAAE,CAAC,OAAO,CAAC,4BAA4B,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7F,CAAC"}
|
package/utils/barrel.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
-
export declare function createProxyIndexGenerator(targetPath: string): (tree:
|
|
3
|
-
export declare function createBarrelsGenerator(rootPath: string): (tree: Tree) => import("@angular-devkit/schematics/src/tree/interface").Tree;
|
|
4
|
-
export declare function generateBarrelFromPath(tree: Tree, indexPath: string): void;
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
export declare function createProxyIndexGenerator(targetPath: string): (tree: Tree) => import("@angular-devkit/schematics/src/tree/interface").Tree;
|
|
3
|
+
export declare function createBarrelsGenerator(rootPath: string): (tree: Tree) => import("@angular-devkit/schematics/src/tree/interface").Tree;
|
|
4
|
+
export declare function generateBarrelFromPath(tree: Tree, indexPath: string): void;
|