From 8d82f22c830115cd428fd66e516f0cea5ab93034 Mon Sep 17 00:00:00 2001 From: Merlin Beutlberger Date: Mon, 24 Jun 2019 14:34:03 +0200 Subject: [PATCH] [FIX] manifestCreator: Only consider component files called Component.js In the past files called *Component.js where also considered as Components during manifest creation. --- lib/processors/manifestCreator.js | 2 +- .../dest/resources/library/h/components/Component-preload.js | 5 +++++ .../dest/resources/library/h/components/TodoComponent.js | 4 ++++ .../library.h/main/src/library/h/components/TodoComponent.js | 4 ++++ 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/TodoComponent.js create mode 100644 test/fixtures/library.h/main/src/library/h/components/TodoComponent.js diff --git a/lib/processors/manifestCreator.js b/lib/processors/manifestCreator.js index 94c0ac569..54ad7b094 100644 --- a/lib/processors/manifestCreator.js +++ b/lib/processors/manifestCreator.js @@ -159,7 +159,7 @@ async function createManifest(libraryResource, libBundle, descriptorVersion, _in function findComponentPaths() { const result = []; const prefix = libraryResource.getPath().slice(0, - ".library".length); - const components = libBundle.getResources(/(?:[^/]+\/)*Component\.js$/); + const components = libBundle.getResources(/(?:[^/]+\/)Component\.js$/); components.forEach((comp) => { const relativePath = comp.getPath().slice(prefix.length); if ( relativePath.lastIndexOf("/") >= 0 ) { diff --git a/test/expected/build/library.h/dest/resources/library/h/components/Component-preload.js b/test/expected/build/library.h/dest/resources/library/h/components/Component-preload.js index e9e309179..7b5db6460 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/Component-preload.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/Component-preload.js @@ -1,4 +1,9 @@ sap.ui.require.preload({ "library/h/components/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +}, + "library/h/components/TodoComponent.js":function(){/*! + * Some fancy copyright + */ +console.log(" File "); } }); diff --git a/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent.js b/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent.js new file mode 100644 index 000000000..bcf866e67 --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +console.log(" File "); \ No newline at end of file diff --git a/test/fixtures/library.h/main/src/library/h/components/TodoComponent.js b/test/fixtures/library.h/main/src/library/h/components/TodoComponent.js new file mode 100644 index 000000000..c38081004 --- /dev/null +++ b/test/fixtures/library.h/main/src/library/h/components/TodoComponent.js @@ -0,0 +1,4 @@ +/*! + * ${copyright} + */ +console.log(' File ');