MCPcopy Create free account
hub / github.com/SAP/ui5-project / _getSpecifications

Method _getSpecifications

lib/graph/Module.js:123–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121 }
122
123 async _getSpecifications() {
124 // Retrieve all configurations available for this module
125 let configs = await this._getConfigurations();
126
127 // Edge case:
128 // Search for project-shims to check whether this module defines a collection for itself
129 const isCollection = configs.find((configuration) => {
130 if (configuration.kind === "extension" && configuration.type === "project-shim") {
131 // TODO create Specification instance and ask it for the configuration
132 if (configuration.shims && configuration.shims.collections &&
133 configuration.shims.collections[this.getId()]) {
134 return true;
135 }
136 }
137 });
138
139 if (isCollection) {
140 // This module is configured as a collection
141 // For compatibility reasons with the behavior of projectPreprocessor,
142 // the project contained in this module must be ignored
143 configs = configs.filter((configuration) => {
144 return configuration.kind !== "project";
145 });
146 } else {
147 // Patch configs
148 configs.forEach((configuration) => {
149 if (configuration.kind === "project" && configuration.type === "library" &&
150 configuration.metadata && configuration.metadata.name) {
151 const libraryName = configuration.metadata.name;
152 // Old theme-libraries where configured as type "library"
153 if (SAP_THEMES_NS_EXEMPTIONS.includes(libraryName)) {
154 configuration.type = "theme-library";
155 }
156 }
157 });
158 }
159
160 const specs = await Promise.all(configs.map(async (configuration) => {
161 const buildManifest = configuration._buildManifest;
162 if (configuration._buildManifest) {
163 delete configuration._buildManifest;
164 }
165 const spec = await Specification.create({
166 id: this.getId(),
167 version: this.getVersion(),
168 modulePath: this.getPath(),
169 configuration,
170 buildManifest
171 });
172
173 log.verbose(`Module ${this.getId()} contains ${spec.getKind()} ${spec.getName()}`);
174 return spec;
175 }));
176
177 const projects = specs.filter((spec) => {
178 return spec.getKind() === "project";
179 });
180

Callers 1

getSpecificationsMethod · 0.95

Calls 7

_getConfigurationsMethod · 0.95
getIdMethod · 0.95
getVersionMethod · 0.95
getPathMethod · 0.95
createMethod · 0.80
getKindMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected