@@ -9,7 +9,8 @@ const {validate} = require("../validation/validator");
99
1010const log = require ( "@ui5/logger" ) . getLogger ( "graph:Module" ) ;
1111
12- const defaultConfigPath = "ui5.yaml" ;
12+ const DEFAULT_CONFIG_PATH = "ui5.yaml" ;
13+ const SAP_THEMES_NS_EXEMPTIONS = [ "themelib_sap_fiori_3" , "themelib_sap_bluecrystal" , "themelib_sap_belize" ] ;
1314
1415function clone ( obj ) {
1516 return JSON . parse ( JSON . stringify ( obj ) ) ;
@@ -36,7 +37,7 @@ class Module {
3637 * @param {@ui5/project.graph.ShimCollection } [parameters.shimCollection]
3738 * Collection of shims that might be relevant for this module
3839 */
39- constructor ( { id, version, modulePath, configPath = defaultConfigPath , configuration = [ ] , shimCollection} ) {
40+ constructor ( { id, version, modulePath, configPath = DEFAULT_CONFIG_PATH , configuration = [ ] , shimCollection} ) {
4041 if ( ! id ) {
4142 throw new Error ( `Could not create Module: Missing or empty parameter 'id'` ) ;
4243 }
@@ -127,6 +128,14 @@ class Module {
127128 } ) ;
128129 }
129130
131+ configs . forEach ( ( configuration ) => {
132+ if ( configuration . kind === "project" && configuration . type === "library" &&
133+ configuration . metadata && configuration . metadata . name &&
134+ SAP_THEMES_NS_EXEMPTIONS . includes ( configuration . metadata . name ) ) {
135+ configuration . type = "theme-library" ;
136+ }
137+ } ) ;
138+
130139 const specs = await Promise . all ( configs . map ( async ( configuration ) => {
131140 const spec = await Specification . create ( {
132141 id : this . getId ( ) ,
@@ -258,7 +267,7 @@ class Module {
258267 `${ this . getId ( ) } at "${ configPath } ". Error: ${ err . message } ` ) ;
259268 }
260269 if ( ! configResource ) {
261- if ( configPath !== defaultConfigPath ) {
270+ if ( configPath !== DEFAULT_CONFIG_PATH ) {
262271 throw new Error ( "Failed to read configuration for module " +
263272 `${ this . getId ( ) } : Could not find configuration file in module at path '${ configPath } '` ) ;
264273 }
0 commit comments