diff --git a/packages/builder/lib/processors/manifestCreator.js b/packages/builder/lib/processors/manifestCreator.js index 6260a6f3c60..44b4a2a2516 100644 --- a/packages/builder/lib/processors/manifestCreator.js +++ b/packages/builder/lib/processors/manifestCreator.js @@ -352,42 +352,12 @@ async function createManifest( } } - function collectThemes() { - const themes = Object.create(null); - - // find theme resources and determine theme names from their paths - libBundle.getResources(/(?:[^/]+\/)*themes\//).forEach((res) => { - if ( !res.getPath().startsWith(libraryPathPrefix + "themes/") ) { - // only consider themes within direct "themes" sub-directory - return; - } - const match = /\/themes\/([^/]+)\//.exec(res.getPath()); - if ( match ) { - themes[match[1]] = true; - } - }); - - // merge with supportedTheme info from .library file - const elems = findChildren(manifestAppData, "supportedTheme"); - if ( elems ) { - elems.forEach((elem) => { - if ( elem._ ) { - themes[elem._]; - } - }); - } - return Object.keys(themes).sort(); - } - const sapUi = { _version: sectionVersion(APP_DESCRIPTOR_V3_OTHER_SECTIONS), technology: "UI5", - deviceTypes: deviceTypes(), - supportedThemes: collectThemes() + deviceTypes: deviceTypes() }; - log.verbose(` sap.ui/supportedThemes determined from resources: '${sapUi.supportedThemes.join(", ")}'`); - return sapUi; } diff --git a/packages/builder/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js b/packages/builder/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js index 0fcd9347c49..e178b04cecb 100644 --- a/packages/builder/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js +++ b/packages/builder/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js @@ -10,6 +10,6 @@ sap.ui.predefine("library/d/library", ["sap/ui/core/Lib","sap/ui/core/library"], sap.ui.predefine("library/d/some", ["./library"],l=>{var o="World";console.log("Hello "+o)}); sap.ui.require.preload({ "id1/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"id1","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"},"sap.ui5":{"flexBundle":false}}', - "library/d/manifest.json":'{"_version":"1.21.0","sap.app":{"id":"library.d","type":"library","embeds":[],"applicationVersion":{"version":"1.0.0"},"title":"Library D","description":"Library D","resources":"resources.json","offline":true},"sap.ui":{"technology":"UI5","supportedThemes":[]},"sap.ui5":{"dependencies":{"minUI5Version":"1.0","libs":{}},"library":{"i18n":false,"css":false,"content":{"controls":[],"elements":[],"types":[],"interfaces":[]}}}}' + "library/d/manifest.json":'{"_version":"1.21.0","sap.app":{"id":"library.d","type":"library","embeds":[],"applicationVersion":{"version":"1.0.0"},"title":"Library D","description":"Library D","resources":"resources.json","offline":true},"sap.ui":{"technology":"UI5"},"sap.ui5":{"dependencies":{"minUI5Version":"1.0","libs":{}},"library":{"i18n":false,"css":false,"content":{"controls":[],"elements":[],"types":[],"interfaces":[]}}}}' }); //# sourceMappingURL=sap-ui-custom.js.map diff --git a/packages/builder/test/expected/build/library.d/dest/resources/library/d/manifest.json b/packages/builder/test/expected/build/library.d/dest/resources/library/d/manifest.json index facbd7f7dee..56142089680 100644 --- a/packages/builder/test/expected/build/library.d/dest/resources/library/d/manifest.json +++ b/packages/builder/test/expected/build/library.d/dest/resources/library/d/manifest.json @@ -13,8 +13,7 @@ "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { diff --git a/packages/builder/test/expected/build/library.h/dest-resources-json/resources/library/h/manifest.json b/packages/builder/test/expected/build/library.h/dest-resources-json/resources/library/h/manifest.json index 808d3df9064..7eec9372051 100644 --- a/packages/builder/test/expected/build/library.h/dest-resources-json/resources/library/h/manifest.json +++ b/packages/builder/test/expected/build/library.h/dest-resources-json/resources/library/h/manifest.json @@ -13,8 +13,7 @@ "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { diff --git a/packages/builder/test/expected/build/library.h/dest-resources-json/resources/library/h/resources.json b/packages/builder/test/expected/build/library.h/dest-resources-json/resources/library/h/resources.json index 5895e04d4d9..8c84c5ebd44 100644 --- a/packages/builder/test/expected/build/library.h/dest-resources-json/resources/library/h/resources.json +++ b/packages/builder/test/expected/build/library.h/dest-resources-json/resources/library/h/resources.json @@ -311,7 +311,7 @@ { "name": "manifest.json", "module": "library/h/manifest.json", - "size": 614 + "size": 587 }, { "name": "not-dbg.js", diff --git a/packages/builder/test/expected/build/library.h/dest/resources/library/h/manifest.json b/packages/builder/test/expected/build/library.h/dest/resources/library/h/manifest.json index 808d3df9064..7eec9372051 100644 --- a/packages/builder/test/expected/build/library.h/dest/resources/library/h/manifest.json +++ b/packages/builder/test/expected/build/library.h/dest/resources/library/h/manifest.json @@ -13,8 +13,7 @@ "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { diff --git a/packages/builder/test/expected/build/library.h/no-minify/resources/library/h/manifest.json b/packages/builder/test/expected/build/library.h/no-minify/resources/library/h/manifest.json index 808d3df9064..7eec9372051 100644 --- a/packages/builder/test/expected/build/library.h/no-minify/resources/library/h/manifest.json +++ b/packages/builder/test/expected/build/library.h/no-minify/resources/library/h/manifest.json @@ -13,8 +13,7 @@ "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { diff --git a/packages/builder/test/expected/build/library.i/bundle-library.h-build-manifest/resources/library/i/library-preload.js b/packages/builder/test/expected/build/library.i/bundle-library.h-build-manifest/resources/library/i/library-preload.js index 793378555eb..d30e277b966 100644 --- a/packages/builder/test/expected/build/library.i/bundle-library.h-build-manifest/resources/library/i/library-preload.js +++ b/packages/builder/test/expected/build/library.i/bundle-library.h-build-manifest/resources/library/i/library-preload.js @@ -4,6 +4,6 @@ */ sap.ui.predefine("library/i/library", ["sap/ui/core/Core"],function(i){"use strict";sap.ui.getCore().initLibrary({name:"library.i",version:"1.0.0",dependencies:["sap.ui.core"],types:["library.i.ButtonType","library.i.DialogType"],interfaces:["library.i.IContent"],controls:["library.i.Button","library.i.CheckBox","library.i.Dialog","library.i.Input","library.i.Label","library.i.Link","library.i.Menu","library.i.Text"],elements:["library.i.MenuItem"]});return thisLib}); sap.ui.require.preload({ - "library/i/manifest.json":'{"_version":"1.21.0","sap.app":{"id":"library.i","type":"library","embeds":[],"i18n":{"bundleUrl":"i18nf/custommessagebundle.properties","supportedLocales":[""],"fallbackLocale":""},"applicationVersion":{"version":"1.0.0"},"title":"{{title}}","description":"{{description}}","ach":"NOT-ME","resources":"resources.json","offline":false,"openSourceComponents":[{"name":"D3.js","packagedWithMySelf":false},{"name":"Hammer.js","packagedWithMySelf":true,"version":"2.0.4"}]},"sap.ui":{"technology":"UI5","deviceTypes":{"desktop":true,"tablet":true,"phone":true},"supportedThemes":[]},"sap.ui5":{"dependencies":{"minUI5Version":"1.0","libs":{"sap.ui.core":{"minVersion":"1.0.0"},"library.d":{"lazy":true}}},"contentDensities":{"cozy":true,"compact":false},"library":{"i18n":false,"content":{"controls":["library.i.Button","library.i.CheckBox","library.i.Dialog","library.i.Input","library.i.Label","library.i.Link","library.i.Menu","library.i.Text"],"elements":["library.i.MenuItem"],"types":["library.i.ButtonType","library.i.DialogType"],"interfaces":["library.i.IContent"]}}},"sap.fiori":{"registrationIds":["F0042"],"archeType":"fancycomponent"}}' + "library/i/manifest.json":'{"_version":"1.21.0","sap.app":{"id":"library.i","type":"library","embeds":[],"i18n":{"bundleUrl":"i18nf/custommessagebundle.properties","supportedLocales":[""],"fallbackLocale":""},"applicationVersion":{"version":"1.0.0"},"title":"{{title}}","description":"{{description}}","ach":"NOT-ME","resources":"resources.json","offline":false,"openSourceComponents":[{"name":"D3.js","packagedWithMySelf":false},{"name":"Hammer.js","packagedWithMySelf":true,"version":"2.0.4"}]},"sap.ui":{"technology":"UI5","deviceTypes":{"desktop":true,"tablet":true,"phone":true}},"sap.ui5":{"dependencies":{"minUI5Version":"1.0","libs":{"sap.ui.core":{"minVersion":"1.0.0"},"library.d":{"lazy":true}}},"contentDensities":{"cozy":true,"compact":false},"library":{"i18n":false,"content":{"controls":["library.i.Button","library.i.CheckBox","library.i.Dialog","library.i.Input","library.i.Label","library.i.Link","library.i.Menu","library.i.Text"],"elements":["library.i.MenuItem"],"types":["library.i.ButtonType","library.i.DialogType"],"interfaces":["library.i.IContent"]}}},"sap.fiori":{"registrationIds":["F0042"],"archeType":"fancycomponent"}}' }); //# sourceMappingURL=library-preload.js.map diff --git a/packages/builder/test/expected/build/library.i/bundle-library.h-build-manifest/resources/library/i/manifest.json b/packages/builder/test/expected/build/library.i/bundle-library.h-build-manifest/resources/library/i/manifest.json index 0179cfc90e6..bc327051913 100644 --- a/packages/builder/test/expected/build/library.i/bundle-library.h-build-manifest/resources/library/i/manifest.json +++ b/packages/builder/test/expected/build/library.i/bundle-library.h-build-manifest/resources/library/i/manifest.json @@ -37,8 +37,7 @@ "desktop": true, "tablet": true, "phone": true - }, - "supportedThemes": [] + } }, "sap.ui5": { "dependencies": { diff --git a/packages/builder/test/expected/build/library.i/bundle-library.h/resources/library/i/manifest.json b/packages/builder/test/expected/build/library.i/bundle-library.h/resources/library/i/manifest.json index 0179cfc90e6..bc327051913 100644 --- a/packages/builder/test/expected/build/library.i/bundle-library.h/resources/library/i/manifest.json +++ b/packages/builder/test/expected/build/library.i/bundle-library.h/resources/library/i/manifest.json @@ -37,8 +37,7 @@ "desktop": true, "tablet": true, "phone": true - }, - "supportedThemes": [] + } }, "sap.ui5": { "dependencies": { diff --git a/packages/builder/test/expected/build/library.i/dest/resources/library/i/manifest.json b/packages/builder/test/expected/build/library.i/dest/resources/library/i/manifest.json index 7a3ad6ed789..638515e85f7 100644 --- a/packages/builder/test/expected/build/library.i/dest/resources/library/i/manifest.json +++ b/packages/builder/test/expected/build/library.i/dest/resources/library/i/manifest.json @@ -37,8 +37,7 @@ "desktop": true, "tablet": true, "phone": true - }, - "supportedThemes": [] + } }, "sap.ui5": { "dependencies": { diff --git "a/packages/builder/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js" "b/packages/builder/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js" index 0a38dc7b093..59b904a1249 100644 --- "a/packages/builder/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js" +++ "b/packages/builder/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js" @@ -1,6 +1,6 @@ //@ui5-bundle library/ø/library-preload.js sap.ui.require.preload({ - "library/ø/manifest.json":'{"_version":"1.21.0","sap.app":{"id":"library.ø","type":"library","embeds":[],"applicationVersion":{"version":"1.0.0"},"title":"Library Ø","description":"Library Ø","resources":"resources.json","offline":true},"sap.ui":{"technology":"UI5","supportedThemes":["цветя"]},"sap.ui5":{"dependencies":{"minUI5Version":"1.0","libs":{}},"library":{"i18n":false}}}', + "library/ø/manifest.json":'{"_version":"1.21.0","sap.app":{"id":"library.ø","type":"library","embeds":[],"applicationVersion":{"version":"1.0.0"},"title":"Library Ø","description":"Library Ø","resources":"resources.json","offline":true},"sap.ui":{"technology":"UI5"},"sap.ui5":{"dependencies":{"minUI5Version":"1.0","libs":{}},"library":{"i18n":false}}}', "library/ø/some.js":function(){ /*! * Some fancy copyright diff --git "a/packages/builder/test/expected/build/library.\303\270/dest/resources/library/\303\270/manifest.json" "b/packages/builder/test/expected/build/library.\303\270/dest/resources/library/\303\270/manifest.json" index e242222ee0f..2cf31692a7e 100644 --- "a/packages/builder/test/expected/build/library.\303\270/dest/resources/library/\303\270/manifest.json" +++ "b/packages/builder/test/expected/build/library.\303\270/dest/resources/library/\303\270/manifest.json" @@ -13,10 +13,7 @@ "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [ - "цветя" - ] + "technology": "UI5" }, "sap.ui5": { "dependencies": { diff --git a/packages/builder/test/lib/processors/manifestCreator.js b/packages/builder/test/lib/processors/manifestCreator.js index 7fc0de3a244..ef586a64ecf 100644 --- a/packages/builder/test/lib/processors/manifestCreator.js +++ b/packages/builder/test/lib/processors/manifestCreator.js @@ -68,8 +68,7 @@ const expectedManifestContentObject = () => { "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { @@ -385,8 +384,7 @@ test.serial("manifest creation omitMinVersions=true", async (t) => { "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { @@ -520,8 +518,8 @@ test.serial("default manifest creation with special characters very small app de t.is(errorLogStub.callCount, 0); }); -test.serial("manifest creation with themes", async (t) => { - const {manifestCreator, errorLogStub, verboseLogStub, getProjectVersion} = t.context; +test.serial("manifest creation does not emit supportedThemes for theme resources", async (t) => { + const {manifestCreator, errorLogStub, getProjectVersion} = t.context; const prefix = "/resources/sap/ui/test/"; @@ -539,10 +537,7 @@ test.serial("manifest creation with themes", async (t) => { "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [ - "base", "sap_foo" - ] + "technology": "UI5" }, "sap.ui5": { "dependencies": { @@ -595,9 +590,6 @@ test.serial("manifest creation with themes", async (t) => { t.is(await result.getString(), expectedManifestContent, "Correct result returned"); t.is(errorLogStub.callCount, 0); - t.is(verboseLogStub.callCount, 7); - t.is(verboseLogStub.getCall(4).args[0], - " sap.ui/supportedThemes determined from resources: 'base, sap_foo'"); }); test.serial("manifest creation for sap/apf", async (t) => { @@ -637,7 +629,7 @@ test.serial("manifest creation for sap/apf", async (t) => { t.is(errorLogStub.callCount, 0); - t.is(verboseLogStub.callCount, 10); + t.is(verboseLogStub.callCount, 9); t.is(verboseLogStub.getCall(0).args[0], "sap.app/i18n taken from .library appData: 'i18n/i18n.properties'"); t.is(verboseLogStub.getCall(1).args[0], "Checking component at /resources/sap/apf"); @@ -663,8 +655,7 @@ test.serial("manifest creation for sap/ui/core", async (t) => { "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { @@ -705,7 +696,7 @@ test.serial("manifest creation for sap/ui/core", async (t) => { t.is(errorLogStub.callCount, 0); - t.is(verboseLogStub.callCount, 8); + t.is(verboseLogStub.callCount, 7); t.is(verboseLogStub.getCall(1).args[0], " sap.app/id taken from .library: 'sap.ui.core'"); }); @@ -727,8 +718,7 @@ test.serial("manifest creation with .library / Component.js at same namespace", "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { @@ -773,7 +763,7 @@ test.serial("manifest creation with .library / Component.js at same namespace", "This is not supported by manifests, therefore the component won't be " + "listed in the library's manifest."); - t.is(verboseLogStub.callCount, 8); + t.is(verboseLogStub.callCount, 7); t.is(verboseLogStub.getCall(1).args[0], " sap.app/id taken from .library: 'sap.lib1'"); }); @@ -797,8 +787,7 @@ test.serial("manifest creation with embedded component", async (t) => { "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { @@ -879,8 +868,7 @@ test.serial("manifest creation with embedded component (Missing 'embeddedBy')", "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { @@ -957,8 +945,7 @@ test.serial("manifest creation with embedded component ('embeddedBy' doesn't poi "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { @@ -1039,8 +1026,7 @@ test.serial("manifest creation with embedded component ('embeddedBy' absolute pa "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { @@ -1121,8 +1107,7 @@ test.serial("manifest creation with embedded component ('embeddedBy' empty strin "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { @@ -1197,8 +1182,7 @@ test.serial("manifest creation with embedded component ('embeddedBy' object)", a "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { @@ -1273,8 +1257,7 @@ test.serial("manifest creation with embedded component (no manifest.json)", asyn "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { @@ -1342,8 +1325,7 @@ test.serial("manifest creation with embedded component (invalid manifest.json)", "offline": true }, "sap.ui": { - "technology": "UI5", - "supportedThemes": [] + "technology": "UI5" }, "sap.ui5": { "dependencies": { diff --git a/packages/builder/test/lib/tasks/generateLibraryManifest.js b/packages/builder/test/lib/tasks/generateLibraryManifest.js index a4a83033427..bcb6a355d1e 100644 --- a/packages/builder/test/lib/tasks/generateLibraryManifest.js +++ b/packages/builder/test/lib/tasks/generateLibraryManifest.js @@ -77,7 +77,6 @@ test("integration: Library without i18n bundle file", async (t) => { type: "library", }, "sap.ui": { - supportedThemes: [], technology: "UI5", }, "sap.ui5": { @@ -134,7 +133,6 @@ test("integration: Library with i18n bundle file (messagebundle.properties)", as type: "library", }, "sap.ui": { - supportedThemes: [], technology: "UI5", }, "sap.ui5": { @@ -204,7 +202,6 @@ test("integration: Library with i18n=true declared in .library", async (t) => { type: "library", }, "sap.ui": { - supportedThemes: [], technology: "UI5", }, "sap.ui5": { @@ -280,7 +277,6 @@ test("integration: Library with i18n=true declared in .library and multiple loca type: "library", }, "sap.ui": { - supportedThemes: [], technology: "UI5", }, "sap.ui5": { @@ -350,7 +346,6 @@ test("integration: Library with i18n=true declared in .library and single locale type: "library", }, "sap.ui": { - supportedThemes: [], technology: "UI5", }, "sap.ui5": { @@ -416,7 +411,6 @@ test("integration: Library with i18n=false declared in .library", async (t) => { type: "library", }, "sap.ui": { - supportedThemes: [], technology: "UI5", }, "sap.ui5": { @@ -482,7 +476,6 @@ test("integration: Library with i18n=foo.properties declared in .library", async type: "library", }, "sap.ui": { - supportedThemes: [], technology: "UI5", }, "sap.ui5": { @@ -548,7 +541,6 @@ test("integration: Library with css=true declared in .library", async (t) => { type: "library", }, "sap.ui": { - supportedThemes: [], technology: "UI5", }, "sap.ui5": { @@ -610,7 +602,6 @@ test("integration: Library with css=false declared in .library", async (t) => { type: "library", }, "sap.ui": { - supportedThemes: [], technology: "UI5", }, "sap.ui5": { diff --git a/packages/server/test/lib/server/middleware/helper/generateLibraryManifest.js b/packages/server/test/lib/server/middleware/helper/generateLibraryManifest.js index 773e4728f9c..65b24463f63 100644 --- a/packages/server/test/lib/server/middleware/helper/generateLibraryManifest.js +++ b/packages/server/test/lib/server/middleware/helper/generateLibraryManifest.js @@ -53,9 +53,7 @@ test("Generate library manifest", async (t) => { }, "sap.ui": { - "technology": "UI5", - "supportedThemes": - [] + "technology": "UI5" }, "sap.ui5": {