From a3af604ff0a12fb9241dcd105cf0aec8d718a299 Mon Sep 17 00:00:00 2001 From: Merlin Beutlberger Date: Mon, 17 Jan 2022 10:41:01 +0100 Subject: [PATCH] [FEATURE] Add minify task and processor (#666) Combines debug-file creation, source-map generation and minification. Replaces existing tasks/processors 'uglify' and 'createDebugFiles'. Also introduce new global tags `IsDebugVariant` and `HasDebugVariant`. BREAKING CHANGE: The following tasks have been removed: - createDebugFiles - uglify The following processors have been removed: - debugFileCreator - resourceCopier - uglifier As a replacement, the new 'minify' task and 'minifier' processor can be used. Note: The minify task is executed earlier, before the bundling process takes place. Existing 'beforeTask' and 'afterTask' configuration of custom tasks might need to be adapted to cater for this change. --- index.js | 20 +- lib/builder/BuildContext.js | 17 + lib/builder/ProjectBuildContext.js | 16 +- lib/builder/builder.js | 3 +- lib/lbt/bundle/Builder.js | 54 +-- lib/lbt/resources/LocatorResource.js | 2 - lib/lbt/resources/Resource.js | 7 + lib/processors/debugFileCreator.js | 52 --- lib/processors/minifier.js | 84 ++++ lib/processors/resourceCopier.js | 24 - lib/processors/uglifier.js | 45 -- lib/tasks/TaskUtil.js | 18 +- lib/tasks/bundlers/generateBundle.js | 28 +- .../bundlers/generateComponentPreload.js | 9 +- lib/tasks/bundlers/generateLibraryPreload.js | 37 +- .../bundlers/generateStandaloneAppBundle.js | 19 +- lib/tasks/createDebugFiles.js | 30 -- lib/tasks/minify.js | 30 ++ lib/tasks/taskRepository.js | 8 +- lib/tasks/uglify.js | 33 -- lib/types/application/ApplicationBuilder.js | 52 +-- lib/types/library/LibraryBuilder.js | 47 +- .../dest-clean/fileWithoutExtension | 1 + .../build/application.a/dest-clean/index.html | 11 + .../build/application.a/dest-clean/test.js | 9 + .../application.a/dest-deps-excl/test.js | 3 +- .../application.a/dest-deps-excl/test.js.map | 1 + .../dest-deps-incl/fileWithoutExtension | 1 + .../application.a/dest-deps-incl/index.html | 11 + .../resources/library/a/.library | 17 + .../library/a/themes/base/library-RTL.css | 3 + .../a/themes/base/library-parameters.json | 1 + .../library/a/themes/base/library.css | 3 + .../library/a/themes/base/library.source.less | 6 + .../resources/library/b/.library | 17 + .../resources/library/c/.library | 17 + .../resources/library/d/.library | 11 + .../resources/library/d/some-dbg.js | 7 + .../resources/library/d/some.js | 5 + .../resources/library/d/some.js.map | 1 + .../dest-deps-incl/resources/ui5loader-dbg.js | 1 + .../dest-deps-incl/resources/ui5loader.js | 2 + .../dest-deps-incl/resources/ui5loader.js.map | 1 + .../application.a/dest-deps-incl/test-dbg.js | 9 + .../test-resources/LibraryC/Test.html | 0 .../test-resources/library/a/Test.html | 0 .../test-resources/library/b/Test.html | 0 .../test-resources/library/d/Test.html | 0 .../application.a/dest-deps-incl/test.js | 2 + .../application.a/dest-deps-incl/test.js.map | 1 + .../dest-deps/resources/library/d/some.js | 3 +- .../dest-deps/resources/library/d/some.js.map | 1 + .../dest-deps/resources/ui5loader.js | 2 + .../dest-deps/resources/ui5loader.js.map | 1 + .../build/application.a/dest-deps/test.js | 3 +- .../build/application.a/dest-deps/test.js.map | 1 + .../dest-depself/resources/library/d/some.js | 3 +- .../resources/library/d/some.js.map | 1 + .../dest-depself/resources/sap-ui-custom.js | 2 + .../dest-depself/resources/ui5loader.js | 2 + .../dest-depself/resources/ui5loader.js.map | 1 + .../build/application.a/dest-depself/test.js | 3 +- .../application.a/dest-depself/test.js.map | 1 + .../dest-self/resources/sap-ui-custom.js | 6 +- .../build/application.a/dest-self/test.js | 3 +- .../build/application.a/dest-self/test.js.map | 1 + .../expected/build/application.a/dest/test.js | 3 +- .../build/application.a/dest/test.js.map | 1 + .../standalone/resources/sap-ui-custom-dbg.js | 5 + .../standalone/resources/sap-ui-custom.js | 16 +- .../cachebuster/Component-preload.js | 3 + .../application.g/cachebuster/Component.js | 3 +- .../cachebuster/Component.js.map | 1 + .../cachebuster/sap-ui-cachebuster-info.json | 25 +- .../cachebuster/subcomponentA/Component.js | 3 +- .../subcomponentA/Component.js.map | 1 + .../cachebuster/subcomponentB/Component.js | 3 +- .../subcomponentB/Component.js.map | 1 + .../cachebuster_hash/Component-dbg.js | 8 + .../cachebuster_hash/Component-preload.js | 17 + .../cachebuster_hash/Component.js | 2 + .../cachebuster_hash/Component.js.map | 1 + .../cachebuster_hash/manifest.json | 14 + .../sap-ui-cachebuster-info.json | 15 + .../subcomponentA/Component-dbg.js | 8 + .../subcomponentA/Component.js | 2 + .../subcomponentA/Component.js.map | 1 + .../subcomponentA/manifest.json | 13 + .../subcomponentB/Component-dbg.js | 8 + .../subcomponentB/Component.js | 2 + .../subcomponentB/Component.js.map | 1 + .../subcomponentB/manifest.json | 13 + .../application.g/dest/Component-preload.js | 1 + .../build/application.g/dest/Component.js | 3 +- .../build/application.g/dest/Component.js.map | 1 + .../dest/subcomponentA/Component-preload.js | 1 + .../dest/subcomponentA/Component.js | 3 +- .../dest/subcomponentA/Component.js.map | 1 + .../dest/subcomponentB/Component-preload.js | 1 + .../dest/subcomponentB/Component.js | 3 +- .../dest/subcomponentB/Component.js.map | 1 + .../application.g/dest2/Component-dbg.js | 8 + .../application.g/dest2/Component-preload.js | 9 + .../build/application.g/dest2/Component.js | 2 + .../application.g/dest2/Component.js.map | 1 + .../build/application.g/dest2/manifest.json | 14 + .../dest2/subcomponentA/Component-dbg.js | 8 + .../dest2/subcomponentA/Component-preload.js | 9 + .../dest2/subcomponentA/Component.js | 2 + .../dest2/subcomponentA/Component.js.map | 1 + .../dest2/subcomponentA/manifest.json | 13 + .../dest2/subcomponentB/Component-dbg.js | 8 + .../dest2/subcomponentB/Component-preload.js | 9 + .../dest2/subcomponentB/Component.js | 2 + .../dest2/subcomponentB/Component.js.map | 1 + .../dest2/subcomponentB/manifest.json | 13 + .../build/application.h/dest/Component-dbg.js | 8 + .../build/application.h/dest/Component.js | 3 +- .../build/application.h/dest/Component.js.map | 1 + .../dest/sectionsA/customBundle.js | 2 + .../dest/sectionsA/section1-dbg.js | 3 + .../application.h/dest/sectionsA/section1.js | 3 +- .../dest/sectionsA/section1.js.map | 1 + .../dest/sectionsA/section2-dbg.js | 3 + .../application.h/dest/sectionsA/section2.js | 3 +- .../dest/sectionsA/section2.js.map | 1 + .../dest/sectionsA/section3-dbg.js | 3 + .../application.h/dest/sectionsA/section3.js | 3 +- .../dest/sectionsA/section3.js.map | 1 + .../dest/sectionsB/customBundle.js | 12 +- .../dest/sectionsB/section1-dbg.js | 3 + .../application.h/dest/sectionsB/section1.js | 3 +- .../dest/sectionsB/section1.js.map | 1 + .../dest/sectionsB/section2-dbg.js | 3 + .../application.h/dest/sectionsB/section2.js | 3 +- .../dest/sectionsB/section2.js.map | 1 + .../dest/sectionsB/section3-dbg.js | 3 + .../application.h/dest/sectionsB/section3.js | 3 +- .../dest/sectionsB/section3.js.map | 1 + .../application.h/no-minify/Component.js | 8 + .../application.h/no-minify/manifest.json | 13 + .../no-minify/sectionsA/customBundle.js | 13 + .../no-minify/sectionsA/section1.js | 3 + .../no-minify/sectionsA/section2.js | 3 + .../no-minify/sectionsA/section3.js | 3 + .../no-minify/sectionsB/customBundle.js | 17 + .../no-minify/sectionsB/section1.js | 3 + .../no-minify/sectionsB/section2.js | 3 + .../no-minify/sectionsB/section3.js | 3 + .../build/application.i/dest/Component-dbg.js | 8 + .../application.i/dest/Component-preload.js | 2 + .../build/application.i/dest/Component.js | 3 +- .../build/application.i/dest/Component.js.map | 1 + .../dest/changes/coding/MyExtension-dbg.js | 3 + .../dest/changes/coding/MyExtension.js | 3 +- .../dest/changes/coding/MyExtension.js.map | 1 + .../dest-resources-json/Component-dbg.js | 8 + .../dest-resources-json/Component-preload.js | 2 + .../dest-resources-json/Component.js | 3 +- .../dest-resources-json/Component.js.map | 1 + .../changes/coding/MyExtension-dbg.js | 3 + .../changes/coding/MyExtension.js | 3 +- .../changes/coding/MyExtension.js.map | 1 + .../dest-resources-json/resources.json | 37 +- .../build/application.j/dest/Component-dbg.js | 8 + .../application.j/dest/Component-preload.js | 2 + .../build/application.j/dest/Component.js | 3 +- .../build/application.j/dest/Component.js.map | 1 + .../dest/changes/coding/MyExtension-dbg.js | 3 + .../dest/changes/coding/MyExtension.js | 3 +- .../dest/changes/coding/MyExtension.js.map | 1 + .../Component-preload.js | 27 +- .../application.k/dest/Component-preload.js | 9 +- .../dest/subcomponentA/Component-preload.js | 9 +- .../dest/subcomponentB/Component-preload.js | 9 +- .../build/application.l/dest/subdir/index.js | 3 +- .../application.l/dest/subdir/index.js.map | 1 + .../dest/subdir/thirdparty/File1.js | 3 +- .../dest/subdir/thirdparty/File1.js.map | 1 + .../expected/build/application.l/dest/test.js | 3 +- .../build/application.l/dest/test.js.map | 1 + .../dest/Component-preload.js" | 1 + .../application.\303\270/dest/Component.js" | 3 +- .../dest/Component.js.map" | 1 + .../expected/build/build/fileWithoutExtension | 1 + test/expected/build/build/index.html | 11 + test/expected/build/build/test.js | 9 + .../build/cleanup/fileWithoutExtension | 1 + test/expected/build/cleanup/index.html | 11 + test/expected/build/cleanup/test.js | 9 + .../dest/resources/sap-ui-core-dbg.js | 0 .../dest/resources/sap-ui-core.js | 2 + .../dest/resources/sap-ui-core.js.map | 1 + .../dest/resources/sap/ui/Global-dbg.js | 5 + .../dest/resources/sap/ui/Global.js | 5 + .../dest/resources/sap/ui/Global.js.map | 1 + .../dest/resources/sap/ui/core/.library | 20 + .../dest/resources/sap/ui/core/Core-dbg.js | 5 + .../dest/resources/sap/ui/core/Core.js | 5 + .../dest/resources/sap/ui/core/Core.js.map | 1 + .../dest/resources/library/d/some.js | 3 +- .../dest/resources/library/d/some.js.map | 1 + .../resources/library/d/library-preload.js | 5 +- .../dest/resources/library/e/library.js | 3 +- .../dest/resources/library/e/library.js.map | 1 + .../dest/resources/library/e/some.js | 3 +- .../dest/resources/library/e/some.js.map | 1 + .../library/h/components/Component-dbg.js | 5 + .../library/h/components/Component-preload.js | 2 + .../library/h/components/Component.js | 3 +- .../library/h/components/Component.js.map | 1 + .../library/h/components/TodoComponent-dbg.js | 4 + .../library/h/components/TodoComponent.js | 3 +- .../library/h/components/TodoComponent.js.map | 1 + .../library/h/components/resources.json | 88 +++- .../components/subcomponent1/Component-dbg.js | 5 + .../subcomponent1/Component-preload.js | 1 + .../h/components/subcomponent1/Component.js | 3 +- .../components/subcomponent1/Component.js.map | 1 + .../h/components/subcomponent1/resources.json | 20 +- .../components/subcomponent2/Component-dbg.js | 5 + .../subcomponent2/Component-preload.js | 1 + .../h/components/subcomponent2/Component.js | 3 +- .../components/subcomponent2/Component.js.map | 1 + .../h/components/subcomponent2/resources.json | 20 +- .../components/subcomponent3/Component-dbg.js | 5 + .../subcomponent3/Component-preload.js | 1 + .../h/components/subcomponent3/Component.js | 3 +- .../components/subcomponent3/Component.js.map | 1 + .../h/components/subcomponent3/resources.json | 20 +- .../resources/library/h/customBundle-dbg.js | 24 + .../resources/library/h/customBundle.js | 6 +- .../h/designtime/library-dbg.designtime.js | 14 + .../h/designtime/library.designtime.js | 3 +- .../h/designtime/library.designtime.js.map | 1 + .../resources/library/h/file-dbg.js | 4 + .../resources/library/h/file.js | 3 +- .../resources/library/h/file.js.map | 1 + .../resources/library/h/library-dbg.js | 4 + .../resources/library/h/library.js | 3 +- .../resources/library/h/library.js.map | 1 + .../resources/library/h/not-dbg.js | 4 + .../resources/library/h/not.js | 3 +- .../resources/library/h/not.js.map | 1 + .../resources/library/h/resources.json | 184 +++++++- .../resources/library/h/some-dbg.js | 5 + .../resources/library/h/some.js | 3 +- .../resources/library/h/some.js.map | 1 + .../library/h/components/Component-dbg.js | 5 + .../library/h/components/Component-preload.js | 2 + .../library/h/components/Component.js | 3 +- .../library/h/components/Component.js.map | 1 + .../library/h/components/TodoComponent-dbg.js | 4 + .../library/h/components/TodoComponent.js | 3 +- .../library/h/components/TodoComponent.js.map | 1 + .../components/subcomponent1/Component-dbg.js | 5 + .../subcomponent1/Component-preload.js | 1 + .../h/components/subcomponent1/Component.js | 3 +- .../components/subcomponent1/Component.js.map | 1 + .../components/subcomponent2/Component-dbg.js | 5 + .../subcomponent2/Component-preload.js | 1 + .../h/components/subcomponent2/Component.js | 3 +- .../components/subcomponent2/Component.js.map | 1 + .../components/subcomponent3/Component-dbg.js | 5 + .../subcomponent3/Component-preload.js | 1 + .../h/components/subcomponent3/Component.js | 3 +- .../components/subcomponent3/Component.js.map | 1 + .../resources/library/h/customBundle-dbg.js | 24 + .../dest/resources/library/h/customBundle.js | 6 +- .../h/designtime/library-dbg.designtime.js | 14 + .../h/designtime/library.designtime.js | 3 +- .../h/designtime/library.designtime.js.map | 1 + .../dest/resources/library/h/file-dbg.js | 4 + .../dest/resources/library/h/file.js | 3 +- .../dest/resources/library/h/file.js.map | 1 + .../dest/resources/library/h/library-dbg.js | 4 + .../dest/resources/library/h/library.js | 3 +- .../dest/resources/library/h/library.js.map | 1 + .../dest/resources/library/h/not-dbg.js | 4 + .../library.h/dest/resources/library/h/not.js | 3 +- .../dest/resources/library/h/not.js.map | 1 + .../dest/resources/library/h/some-dbg.js | 5 + .../dest/resources/library/h/some.js | 3 +- .../dest/resources/library/h/some.js.map | 1 + .../no-minify/resources/library/h/.library | 19 + .../library/h/components/Component-preload.js | 14 + .../library/h/components/Component.js | 5 + .../library/h/components/TodoComponent.js | 4 + .../subcomponent1/Component-preload.js | 9 + .../h/components/subcomponent1/Component.js | 5 + .../subcomponent2/Component-preload.js | 9 + .../h/components/subcomponent2/Component.js | 5 + .../subcomponent3/Component-preload.js | 9 + .../h/components/subcomponent3/Component.js | 5 + .../resources/library/h/customBundle-dbg.js | 24 + .../resources/library/h/customBundle.js | 24 + .../h/designtime/library.designtime.js | 14 + .../no-minify/resources/library/h/file.js | 4 + .../library/h/i18n/messagebundle.properties | 1 + .../h/i18n/messagebundle_en.properties | 1 + .../no-minify/resources/library/h/library.js | 4 + .../resources/library/h/manifest.json | 34 ++ .../no-minify/resources/library/h/not.js | 4 + .../no-minify/resources/library/h/some.js | 5 + .../test-resources/library/d/Test.html | 0 .../dest/resources/library/l/some.js | 3 +- .../dest/resources/library/l/some.js.map | 1 + .../dest/resources/library/l/subdir/index.js | 3 +- .../resources/library/l/subdir/index.js.map | 1 + .../library/l/subdir/thirdparty/File1.js | 3 +- .../library/l/subdir/thirdparty/File1.js.map | 1 + .../library/\303\270/library-preload.js" | 1 + .../\303\270/library-preload.support.js" | 37 ++ .../\303\270/rules/MyControl.support.js" | 36 ++ .../dest/resources/library/\303\270/some.js" | 3 +- .../resources/library/\303\270/some.js.map" | 1 + .../dest/resources/sap-ui-core.js | 2 + .../dest/resources/sap-ui-core.js.map | 1 + .../dest/resources/sap/ui/Global.js | 3 +- .../dest/resources/sap/ui/Global.js.map | 1 + .../dest/resources/sap/ui/core/Core.js | 3 +- .../dest/resources/sap/ui/core/Core.js.map | 1 + .../preload/resources/sap-ui-core-dbg.js | 5 + .../resources/sap-ui-core-nojQuery-dbg.js | 5 + .../preload/resources/sap-ui-core-nojQuery.js | 17 +- .../preload/resources/sap-ui-core.js | 17 +- .../preload/resources/sap-ui-core.js.map | 1 + .../preload/resources/sap/ui/core/Core-dbg.js | 4 + .../preload/resources/sap/ui/core/Core.js | 2 + .../preload/resources/sap/ui/core/Core.js.map | 1 + .../resources/sap/ui/core/library-preload.js | 11 +- .../preload/resources/sap/ui/core/one-dbg.js | 3 + .../preload/resources/sap/ui/core/one.js | 5 +- .../preload/resources/sap/ui/core/one.js.map | 1 + .../preload/resources/sap/ui/core/some-dbg.js | 14 + .../preload/resources/sap/ui/core/some.js | 13 +- .../preload/resources/sap/ui/core/some.js.map | 1 + .../resources/ui5loader-autoconfig-dbg.js | 4 + .../preload/resources/ui5loader-autoconfig.js | 2 + .../resources/ui5loader-autoconfig.js.map | 1 + .../preload/resources/ui5loader-dbg.js | 4 + .../preload/resources/ui5loader.js | 2 + .../preload/resources/ui5loader.js.map | 1 + .../\303\270/rules/MyControl.support.js" | 36 ++ .../sap.ui.core/main/src/sap-ui-core.js | 4 + .../sap.ui.core/main/src/sap/ui/core/Core.js | 4 + .../main/src/ui5loader-autoconfig.js | 4 + .../sap.ui.core/main/src/ui5loader.js | 4 + test/lib/builder/BuildContext.js | 31 +- test/lib/builder/ProjectBuildContext.js | 46 +- test/lib/builder/builder-composeTaskList.js | 18 +- test/lib/builder/builder.js | 93 +++- test/lib/index.js | 7 +- test/lib/lbt/bundle/Builder.js | 139 +++++- test/lib/lbt/resources/Resource.js | 24 +- test/lib/processors/minifier.js | 225 ++++++++++ .../generateLibraryPreload.integration.js | 4 +- ...generateStandaloneAppBundle.integration.js | 2 +- .../bundlers/generateStandaloneAppBundle.js | 35 +- test/lib/tasks/createDebugFiles.js | 419 ------------------ test/lib/tasks/minify.js | 77 ++++ test/lib/tasks/taskRepository.js | 18 + test/lib/tasks/uglify.js | 219 --------- test/lib/types/AbstractBuilder.js | 4 +- .../types/application/ApplicationBuilder.js | 20 +- test/lib/types/library/LibraryBuilder.js | 3 +- 366 files changed, 2730 insertions(+), 1219 deletions(-) delete mode 100644 lib/processors/debugFileCreator.js create mode 100644 lib/processors/minifier.js delete mode 100644 lib/processors/resourceCopier.js delete mode 100644 lib/processors/uglifier.js delete mode 100644 lib/tasks/createDebugFiles.js create mode 100644 lib/tasks/minify.js delete mode 100644 lib/tasks/uglify.js create mode 100644 test/expected/build/application.a/dest-clean/fileWithoutExtension create mode 100644 test/expected/build/application.a/dest-clean/index.html create mode 100644 test/expected/build/application.a/dest-clean/test.js create mode 100644 test/expected/build/application.a/dest-deps-excl/test.js.map create mode 100644 test/expected/build/application.a/dest-deps-incl/fileWithoutExtension create mode 100644 test/expected/build/application.a/dest-deps-incl/index.html create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/library/a/.library create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library-RTL.css create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library-parameters.json create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library.css create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library.source.less create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/library/b/.library create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/library/c/.library create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/library/d/.library create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/library/d/some-dbg.js create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/library/d/some.js create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/library/d/some.js.map create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/ui5loader-dbg.js create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/ui5loader.js create mode 100644 test/expected/build/application.a/dest-deps-incl/resources/ui5loader.js.map create mode 100644 test/expected/build/application.a/dest-deps-incl/test-dbg.js create mode 100644 test/expected/build/application.a/dest-deps-incl/test-resources/LibraryC/Test.html create mode 100644 test/expected/build/application.a/dest-deps-incl/test-resources/library/a/Test.html create mode 100644 test/expected/build/application.a/dest-deps-incl/test-resources/library/b/Test.html create mode 100644 test/expected/build/application.a/dest-deps-incl/test-resources/library/d/Test.html create mode 100644 test/expected/build/application.a/dest-deps-incl/test.js create mode 100644 test/expected/build/application.a/dest-deps-incl/test.js.map create mode 100644 test/expected/build/application.a/dest-deps/resources/library/d/some.js.map create mode 100644 test/expected/build/application.a/dest-deps/resources/ui5loader.js.map create mode 100644 test/expected/build/application.a/dest-deps/test.js.map create mode 100644 test/expected/build/application.a/dest-depself/resources/library/d/some.js.map create mode 100644 test/expected/build/application.a/dest-depself/resources/ui5loader.js.map create mode 100644 test/expected/build/application.a/dest-depself/test.js.map create mode 100644 test/expected/build/application.a/dest-self/test.js.map create mode 100644 test/expected/build/application.a/dest/test.js.map create mode 100644 test/expected/build/application.g/cachebuster/Component.js.map create mode 100644 test/expected/build/application.g/cachebuster/subcomponentA/Component.js.map create mode 100644 test/expected/build/application.g/cachebuster/subcomponentB/Component.js.map create mode 100644 test/expected/build/application.g/cachebuster_hash/Component-dbg.js create mode 100644 test/expected/build/application.g/cachebuster_hash/Component-preload.js create mode 100644 test/expected/build/application.g/cachebuster_hash/Component.js create mode 100644 test/expected/build/application.g/cachebuster_hash/Component.js.map create mode 100644 test/expected/build/application.g/cachebuster_hash/manifest.json create mode 100644 test/expected/build/application.g/cachebuster_hash/sap-ui-cachebuster-info.json create mode 100644 test/expected/build/application.g/cachebuster_hash/subcomponentA/Component-dbg.js create mode 100644 test/expected/build/application.g/cachebuster_hash/subcomponentA/Component.js create mode 100644 test/expected/build/application.g/cachebuster_hash/subcomponentA/Component.js.map create mode 100644 test/expected/build/application.g/cachebuster_hash/subcomponentA/manifest.json create mode 100644 test/expected/build/application.g/cachebuster_hash/subcomponentB/Component-dbg.js create mode 100644 test/expected/build/application.g/cachebuster_hash/subcomponentB/Component.js create mode 100644 test/expected/build/application.g/cachebuster_hash/subcomponentB/Component.js.map create mode 100644 test/expected/build/application.g/cachebuster_hash/subcomponentB/manifest.json create mode 100644 test/expected/build/application.g/dest/Component.js.map create mode 100644 test/expected/build/application.g/dest/subcomponentA/Component.js.map create mode 100644 test/expected/build/application.g/dest/subcomponentB/Component.js.map create mode 100644 test/expected/build/application.g/dest2/Component-dbg.js create mode 100644 test/expected/build/application.g/dest2/Component-preload.js create mode 100644 test/expected/build/application.g/dest2/Component.js create mode 100644 test/expected/build/application.g/dest2/Component.js.map create mode 100644 test/expected/build/application.g/dest2/manifest.json create mode 100644 test/expected/build/application.g/dest2/subcomponentA/Component-dbg.js create mode 100644 test/expected/build/application.g/dest2/subcomponentA/Component-preload.js create mode 100644 test/expected/build/application.g/dest2/subcomponentA/Component.js create mode 100644 test/expected/build/application.g/dest2/subcomponentA/Component.js.map create mode 100644 test/expected/build/application.g/dest2/subcomponentA/manifest.json create mode 100644 test/expected/build/application.g/dest2/subcomponentB/Component-dbg.js create mode 100644 test/expected/build/application.g/dest2/subcomponentB/Component-preload.js create mode 100644 test/expected/build/application.g/dest2/subcomponentB/Component.js create mode 100644 test/expected/build/application.g/dest2/subcomponentB/Component.js.map create mode 100644 test/expected/build/application.g/dest2/subcomponentB/manifest.json create mode 100644 test/expected/build/application.h/dest/Component-dbg.js create mode 100644 test/expected/build/application.h/dest/Component.js.map create mode 100644 test/expected/build/application.h/dest/sectionsA/section1-dbg.js create mode 100644 test/expected/build/application.h/dest/sectionsA/section1.js.map create mode 100644 test/expected/build/application.h/dest/sectionsA/section2-dbg.js create mode 100644 test/expected/build/application.h/dest/sectionsA/section2.js.map create mode 100644 test/expected/build/application.h/dest/sectionsA/section3-dbg.js create mode 100644 test/expected/build/application.h/dest/sectionsA/section3.js.map create mode 100644 test/expected/build/application.h/dest/sectionsB/section1-dbg.js create mode 100644 test/expected/build/application.h/dest/sectionsB/section1.js.map create mode 100644 test/expected/build/application.h/dest/sectionsB/section2-dbg.js create mode 100644 test/expected/build/application.h/dest/sectionsB/section2.js.map create mode 100644 test/expected/build/application.h/dest/sectionsB/section3-dbg.js create mode 100644 test/expected/build/application.h/dest/sectionsB/section3.js.map create mode 100644 test/expected/build/application.h/no-minify/Component.js create mode 100644 test/expected/build/application.h/no-minify/manifest.json create mode 100644 test/expected/build/application.h/no-minify/sectionsA/customBundle.js create mode 100644 test/expected/build/application.h/no-minify/sectionsA/section1.js create mode 100644 test/expected/build/application.h/no-minify/sectionsA/section2.js create mode 100644 test/expected/build/application.h/no-minify/sectionsA/section3.js create mode 100644 test/expected/build/application.h/no-minify/sectionsB/customBundle.js create mode 100644 test/expected/build/application.h/no-minify/sectionsB/section1.js create mode 100644 test/expected/build/application.h/no-minify/sectionsB/section2.js create mode 100644 test/expected/build/application.h/no-minify/sectionsB/section3.js create mode 100644 test/expected/build/application.i/dest/Component-dbg.js create mode 100644 test/expected/build/application.i/dest/Component.js.map create mode 100644 test/expected/build/application.i/dest/changes/coding/MyExtension-dbg.js create mode 100644 test/expected/build/application.i/dest/changes/coding/MyExtension.js.map create mode 100644 test/expected/build/application.j/dest-resources-json/Component-dbg.js create mode 100644 test/expected/build/application.j/dest-resources-json/Component.js.map create mode 100644 test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension-dbg.js create mode 100644 test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension.js.map create mode 100644 test/expected/build/application.j/dest/Component-dbg.js create mode 100644 test/expected/build/application.j/dest/Component.js.map create mode 100644 test/expected/build/application.j/dest/changes/coding/MyExtension-dbg.js create mode 100644 test/expected/build/application.j/dest/changes/coding/MyExtension.js.map create mode 100644 test/expected/build/application.l/dest/subdir/index.js.map create mode 100644 test/expected/build/application.l/dest/subdir/thirdparty/File1.js.map create mode 100644 test/expected/build/application.l/dest/test.js.map create mode 100644 "test/expected/build/application.\303\270/dest/Component.js.map" create mode 100644 test/expected/build/build/fileWithoutExtension create mode 100644 test/expected/build/build/index.html create mode 100644 test/expected/build/build/test.js create mode 100644 test/expected/build/cleanup/fileWithoutExtension create mode 100644 test/expected/build/cleanup/index.html create mode 100644 test/expected/build/cleanup/test.js create mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core-dbg.js create mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core.js create mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core.js.map create mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global-dbg.js create mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global.js create mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global.js.map create mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/.library create mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core-dbg.js create mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core.js create mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core.js.map create mode 100644 test/expected/build/library.d/dest/resources/library/d/some.js.map create mode 100644 test/expected/build/library.e/dest/resources/library/e/library.js.map create mode 100644 test/expected/build/library.e/dest/resources/library/e/some.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-dbg.js create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent-dbg.js create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-dbg.js create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-dbg.js create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-dbg.js create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle-dbg.js create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library-dbg.designtime.js create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library.designtime.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/file-dbg.js create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/file.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/library-dbg.js create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/library.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/not-dbg.js create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/not.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/some-dbg.js create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/some.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/Component-dbg.js create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/Component.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/TodoComponent-dbg.js create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/TodoComponent.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-dbg.js create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-dbg.js create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-dbg.js create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/customBundle-dbg.js create mode 100644 test/expected/build/library.h/dest/resources/library/h/designtime/library-dbg.designtime.js create mode 100644 test/expected/build/library.h/dest/resources/library/h/designtime/library.designtime.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/file-dbg.js create mode 100644 test/expected/build/library.h/dest/resources/library/h/file.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/library-dbg.js create mode 100644 test/expected/build/library.h/dest/resources/library/h/library.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/not-dbg.js create mode 100644 test/expected/build/library.h/dest/resources/library/h/not.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/some-dbg.js create mode 100644 test/expected/build/library.h/dest/resources/library/h/some.js.map create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/.library create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/Component-preload.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/Component.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/TodoComponent.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component-preload.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component-preload.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component-preload.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/customBundle-dbg.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/customBundle.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/designtime/library.designtime.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/file.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/i18n/messagebundle.properties create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/i18n/messagebundle_en.properties create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/library.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/manifest.json create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/not.js create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/some.js create mode 100644 test/expected/build/library.h/no-minify/test-resources/library/d/Test.html create mode 100644 test/expected/build/library.l/dest/resources/library/l/some.js.map create mode 100644 test/expected/build/library.l/dest/resources/library/l/subdir/index.js.map create mode 100644 test/expected/build/library.l/dest/resources/library/l/subdir/thirdparty/File1.js.map create mode 100644 "test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.support.js" create mode 100644 "test/expected/build/library.\303\270/dest/resources/library/\303\270/rules/MyControl.support.js" create mode 100644 "test/expected/build/library.\303\270/dest/resources/library/\303\270/some.js.map" create mode 100644 test/expected/build/sap.ui.core-buildtime/dest/resources/sap-ui-core.js.map create mode 100644 test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/Global.js.map create mode 100644 test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/core/Core.js.map create mode 100644 test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js.map create mode 100644 test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core-dbg.js create mode 100644 test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core.js.map create mode 100644 test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one-dbg.js create mode 100644 test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one.js.map create mode 100644 test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some-dbg.js create mode 100644 test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some.js.map create mode 100644 test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig-dbg.js create mode 100644 test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig.js create mode 100644 test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig.js.map create mode 100644 test/expected/build/sap.ui.core/preload/resources/ui5loader-dbg.js create mode 100644 test/expected/build/sap.ui.core/preload/resources/ui5loader.js create mode 100644 test/expected/build/sap.ui.core/preload/resources/ui5loader.js.map create mode 100644 "test/fixtures/library.\303\270/m\303\241in/\303\237rc/library/\303\270/rules/MyControl.support.js" create mode 100644 test/fixtures/sap.ui.core/main/src/ui5loader-autoconfig.js create mode 100644 test/fixtures/sap.ui.core/main/src/ui5loader.js create mode 100644 test/lib/processors/minifier.js delete mode 100644 test/lib/tasks/createDebugFiles.js create mode 100644 test/lib/tasks/minify.js delete mode 100644 test/lib/tasks/uglify.js diff --git a/index.js b/index.js index a9f0c58fe..14341491d 100644 --- a/index.js +++ b/index.js @@ -42,9 +42,9 @@ module.exports = { */ bootstrapHtmlTransformer: "./lib/processors/bootstrapHtmlTransformer", /** - * @type {import('./lib/processors/debugFileCreator')} + * @type {import('./lib/processors/minifier')} */ - debugFileCreator: "./lib/processors/debugFileCreator", + minifier: "./lib/processors/minifier", /** * @type {import('./lib/processors/libraryLessGenerator')} */ @@ -53,10 +53,6 @@ module.exports = { * @type {import('./lib/processors/manifestCreator')} */ manifestCreator: "./lib/processors/manifestCreator", - /** - * @type {import('./lib/processors/resourceCopier')} - */ - resourceCopier: "./lib/processors/resourceCopier", /** * @type {import('./lib/processors/nonAsciiEscaper')} */ @@ -69,10 +65,6 @@ module.exports = { * @type {import('./lib/processors/themeBuilder')} */ themeBuilder: "./lib/processors/themeBuilder", - /** - * @type {import('./lib/processors/uglifier')} - */ - uglifier: "./lib/processors/uglifier", /** * @type {import('./lib/processors/versionInfoGenerator')} */ @@ -121,9 +113,9 @@ module.exports = { */ buildThemes: "./lib/tasks/buildThemes", /** - * @type {import('./lib/tasks/createDebugFiles')} + * @type {import('./lib/tasks/minify')} */ - createDebugFiles: "./lib/tasks/createDebugFiles", + minify: "./lib/tasks/minify", /** * @type {import('./lib/tasks/jsdoc/executeJsdocSdkTransformation')} */ @@ -160,10 +152,6 @@ module.exports = { * @type {import('./lib/tasks/transformBootstrapHtml')} */ transformBootstrapHtml: "./lib/tasks/transformBootstrapHtml", - /** - * @type {import('./lib/tasks/uglify')} - */ - uglify: "./lib/tasks/uglify", /** * @type {import('./lib/tasks/taskRepository')} */ diff --git a/lib/builder/BuildContext.js b/lib/builder/BuildContext.js index 0f61271a7..e445602dc 100644 --- a/lib/builder/BuildContext.js +++ b/lib/builder/BuildContext.js @@ -1,5 +1,13 @@ +const ResourceTagCollection = require("@ui5/fs").ResourceTagCollection; const ProjectBuildContext = require("./ProjectBuildContext"); +// Note: When adding standard tags, always update the public documentation in TaskUtil +// (Type "module:@ui5/builder.tasks.TaskUtil~StandardBuildTags") +const GLOBAL_TAGS = Object.freeze({ + IsDebugVariant: "ui5:IsDebugVariant", + HasDebugVariant: "ui5:HasDebugVariant", +}); + /** * Context of a build process * @@ -13,6 +21,10 @@ class BuildContext { } this.rootProject = rootProject; this.projectBuildContexts = []; + + this._resourceTagCollection = new ResourceTagCollection({ + allowedTags: Object.values(GLOBAL_TAGS) + }); } getRootProject() { @@ -22,6 +34,7 @@ class BuildContext { createProjectContext({project, resources}) { const projectBuildContext = new ProjectBuildContext({ buildContext: this, + globalTags: GLOBAL_TAGS, project, resources }); @@ -34,6 +47,10 @@ class BuildContext { return ctx.executeCleanupTasks(); })); } + + getResourceTagCollection() { + return this._resourceTagCollection; + } } module.exports = BuildContext; diff --git a/lib/builder/ProjectBuildContext.js b/lib/builder/ProjectBuildContext.js index a9dbf9c54..fc1a1c426 100644 --- a/lib/builder/ProjectBuildContext.js +++ b/lib/builder/ProjectBuildContext.js @@ -2,10 +2,10 @@ const ResourceTagCollection = require("@ui5/fs").ResourceTagCollection; // Note: When adding standard tags, always update the public documentation in TaskUtil // (Type "module:@ui5/builder.tasks.TaskUtil~StandardBuildTags") -const STANDARD_TAGS = Object.freeze({ +const STANDARD_TAGS = { OmitFromBuildResult: "ui5:OmitFromBuildResult", - IsBundle: "ui5:IsBundle" -}); + IsBundle: "ui5:IsBundle", +}; /** * Build context of a single project. Always part of an overall @@ -15,8 +15,8 @@ const STANDARD_TAGS = Object.freeze({ * @memberof module:@ui5/builder.builder */ class ProjectBuildContext { - constructor({buildContext, project, resources}) { - if (!buildContext || !project || !resources) { + constructor({buildContext, globalTags, project, resources}) { + if (!buildContext || !globalTags || !project || !resources) { throw new Error(`One or more mandatory parameters are missing`); } this._buildContext = buildContext; @@ -26,10 +26,12 @@ class ProjectBuildContext { cleanup: [] }; - this.STANDARD_TAGS = STANDARD_TAGS; + this.STANDARD_TAGS = Object.assign({}, STANDARD_TAGS, globalTags); + Object.freeze(this.STANDARD_TAGS); this._resourceTagCollection = new ResourceTagCollection({ - allowedTags: Object.values(this.STANDARD_TAGS) + allowedTags: Object.values(this.STANDARD_TAGS), + superCollection: this._buildContext.getResourceTagCollection() }); } diff --git a/lib/builder/builder.js b/lib/builder/builder.js index cb81de584..d48d9f527 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -94,8 +94,7 @@ function composeTaskList({dev, selfContained, jsdoc, includedTasks, excludedTask selectedTasks.generateComponentPreload = false; selectedTasks.generateLibraryPreload = false; selectedTasks.generateLibraryManifest = false; - selectedTasks.createDebugFiles = false; - selectedTasks.uglify = false; + selectedTasks.minify = false; selectedTasks.generateFlexChangesBundle = false; selectedTasks.generateManifestBundle = false; } diff --git a/lib/lbt/bundle/Builder.js b/lib/lbt/bundle/Builder.js index a89a62e58..01dc34ae3 100644 --- a/lib/lbt/bundle/Builder.js +++ b/lib/lbt/bundle/Builder.js @@ -3,7 +3,6 @@ "use strict"; const path = require("path"); -const terser = require("terser"); const {pd} = require("pretty-data"); const {parseJS, Syntax} = require("../utils/parseUtils"); // const MOZ_SourceMap = require("source-map"); @@ -19,7 +18,6 @@ const {SectionType} = require("./BundleDefinition"); const BundleWriter = require("./BundleWriter"); const log = require("@ui5/logger").getLogger("lbt:bundle:Builder"); -const copyrightCommentsPattern = /copyright|\(c\)(?:[0-9]+|\s+[0-9A-za-z])|released under|license|\u00a9|^@ui5-bundle-raw-include |^@ui5-bundle /i; const xmlHtmlPrePattern = /<(?:\w+:)?pre\b/; const strReplacements = { @@ -282,12 +280,9 @@ class BundleBuilder { } async writeRawModule(module, resource) { - let fileContent = await resource.buffer(); - if ( /\.js$/.test(module) ) { - fileContent = await this.compressJS( fileContent, resource ); - } + const fileContent = await resource.string(); this.outW.ensureNewLine(); - this.outW.write( fileContent ); + this.outW.write(fileContent); } async writePreloadFunction(section) { @@ -331,28 +326,6 @@ class BundleBuilder { // this.afterWriteFunctionPreloadSection(); } - async compressJS(fileContent, resource) { - if ( this.optimize ) { - const result = await terser.minify({ - [resource.name]: String(fileContent) - }, { - compress: false, // TODO configure? - output: { - comments: copyrightCommentsPattern, - wrap_func_args: false - } - // , outFileName: resource.name - // , outSourceMap: true - }); - // console.log(result.map); - // const map = new MOZ_SourceMap.SourceMapConsumer(result.map); - // map.eachMapping(function (m) { console.log(m); }); // console.log(map); - fileContent = result.code; - // throw new Error(); - } - return fileContent; - } - beforeWriteFunctionPreloadSection(sequence) { // simple version: just sort alphabetically sequence.sort(); @@ -367,13 +340,12 @@ class BundleBuilder { if ( /\.js$/.test(module) ) { // console.log("Processing " + module); const resource = await this.pool.findResourceWithInfo(module); - let code = await resource.buffer(); - code = rewriteDefine(this.targetBundleFormat, code, module); - if ( code ) { + let moduleContent = await resource.string(); + moduleContent = rewriteDefine(this.targetBundleFormat, moduleContent, module); + if ( moduleContent ) { outW.startSegment(module); outW.ensureNewLine(); - const fileContent = await this.compressJS(code, resource); - outW.write( fileContent ); + outW.write(moduleContent); outW.ensureNewLine(); const compressedSize = outW.endSegment(); log.verbose(" %s (%d,%d)", module, @@ -409,17 +381,17 @@ class BundleBuilder { const outW = this.outW; if ( /\.js$/.test(module) && (info == null || !info.requiresTopLevelScope) ) { - const compressedContent = await this.compressJS( await resource.buffer(), resource ); + const moduleContent = await resource.string(); outW.write(`function(){`); - outW.write( compressedContent ); + outW.write(moduleContent); this.exportGlobalNames(info); outW.ensureNewLine(); outW.write(`}`); } else if ( /\.js$/.test(module) /* implicitly: && info != null && info.requiresTopLevelScope */ ) { log.warn("**** warning: module %s requires top level scope" + " and can only be embedded as a string (requires 'eval')", module); - const compressedContent = await this.compressJS( await resource.buffer(), resource ); - outW.write( makeStringLiteral( compressedContent ) ); + const moduleContent = await resource.buffer(); + outW.write(makeStringLiteral(moduleContent)); } else if ( /\.html$/.test(module) ) { const fileContent = await resource.buffer(); outW.write( makeStringLiteral( fileContent ) ); @@ -435,13 +407,13 @@ class BundleBuilder { } outW.write(makeStringLiteral(fileContent)); } else if ( /\.xml$/.test(module) ) { - let fileContent = await resource.buffer(); + let fileContent = await resource.string(); if ( this.optimize ) { // For XML we use the pretty data // Do not minify if XML(View) contains an <*:pre> tag, // because whitespace of HTML
 should be preserved (should only happen rarely)
-				if (!xmlHtmlPrePattern.test(fileContent.toString())) {
-					fileContent = pd.xmlmin(fileContent.toString(), false);
+				if (!xmlHtmlPrePattern.test(fileContent)) {
+					fileContent = pd.xmlmin(fileContent, false);
 				}
 			}
 			outW.write( makeStringLiteral( fileContent ) );
diff --git a/lib/lbt/resources/LocatorResource.js b/lib/lbt/resources/LocatorResource.js
index 0724e6698..a5c029734 100644
--- a/lib/lbt/resources/LocatorResource.js
+++ b/lib/lbt/resources/LocatorResource.js
@@ -1,11 +1,9 @@
 const Resource = require("./Resource");
 
-
 function extractName(path) {
 	return path.slice( "/resources/".length);
 }
 
-
 class LocatorResource extends Resource {
 	constructor(pool, resource) {
 		super(pool, extractName(resource.getPath()), null, resource.getStatInfo());
diff --git a/lib/lbt/resources/Resource.js b/lib/lbt/resources/Resource.js
index 294379638..efd615fac 100644
--- a/lib/lbt/resources/Resource.js
+++ b/lib/lbt/resources/Resource.js
@@ -18,6 +18,13 @@ class Resource {
 	async buffer() {
 		return readFile(this.file);
 	}
+
+	/**
+	 * @returns {Promise} String of the file content
+	 */
+	async string() {
+		return (await this.buffer()).toString();
+	}
 }
 
 module.exports = Resource;
diff --git a/lib/processors/debugFileCreator.js b/lib/processors/debugFileCreator.js
deleted file mode 100644
index e47200743..000000000
--- a/lib/processors/debugFileCreator.js
+++ /dev/null
@@ -1,52 +0,0 @@
-const copier = require("./resourceCopier");
-const util = require("util");
-
-/**
- * Creates *-dbg.js files for all supplied resources.
- *
- * @public
- * @alias module:@ui5/builder.processors.debugFileCreator
- * @param {object} parameters Parameters
- * @param {module:@ui5/fs.Resource[]} parameters.resources List of resources to be processed
- * @param {fs|module:@ui5/fs.fsInterface} parameters.fs Node fs or
- *   custom [fs interface]{@link module:resources/module:@ui5/fs.fsInterface}
- * @returns {Promise} Promise resolving with debug resources
- */
-module.exports = function({resources, fs}) {
-	const options = {
-		pattern: /((?:\.view|\.fragment|\.controller|\.designtime|\.support)?\.js)$/,
-		replacement: "-dbg$1"
-	};
-
-	const stat = util.promisify(fs.stat);
-
-	return Promise.all(
-		resources.map((resource) => {
-			// check whether the debug resource path is already used in the
-			// previous tasks
-			return stat(resource.getPath().replace(options.pattern, options.replacement))
-				.then(
-					// if the file can be found, it should be filtered out from creating debug file
-					() => false,
-					(err) => {
-						if (err.code === "ENOENT") {
-							// if the file can't be found, it should be included in creating debug file
-							return resource;
-						}
-						// if it's other error, forward it
-						throw err;
-					}
-				);
-		})
-	).then((results) => {
-		// filter out the resouces whose debug source path is already used
-		return results.filter((result) => {
-			return !!result;
-		});
-	}).then((filteredResources) => {
-		return copier({
-			resources: filteredResources,
-			options: options
-		});
-	});
-};
diff --git a/lib/processors/minifier.js b/lib/processors/minifier.js
new file mode 100644
index 000000000..e2abe32d8
--- /dev/null
+++ b/lib/processors/minifier.js
@@ -0,0 +1,84 @@
+const path = require("path");
+const terser = require("terser");
+const Resource = require("@ui5/fs").Resource;
+/**
+ * Preserve comments which contain:
+ * 
    + *
  • copyright notice
  • + *
  • license terms
  • + *
  • "@ui5-bundle"
  • + *
  • "@ui5-bundle-raw-include"
  • + *
+ * + * @type {RegExp} + */ +const copyrightCommentsAndBundleCommentPattern = /copyright|\(c\)(?:[0-9]+|\s+[0-9A-za-z])|released under|license|\u00a9|^@ui5-bundle-raw-include |^@ui5-bundle /i; +const debugFileRegex = /((?:\.view|\.fragment|\.controller|\.designtime|\.support)?\.js)$/; + + +/** + * Result set + * + * @public + * @typedef {object} MinifierResult + * @property {module:@ui5/fs.Resource} resource Minified resource + * @property {module:@ui5/fs.Resource} dbgResource Debug (non-minified) variant + * @property {module:@ui5/fs.Resource} sourceMap Source Map + * @memberof module:@ui5/builder.processors + */ + +/** + * Minifies the supplied resources. + * + * @public + * @alias module:@ui5/builder.processors.minifier + * @param {object} parameters Parameters + * @param {module:@ui5/fs.Resource[]} parameters.resources List of resources to be processed + * @returns {Promise} + * Promise resolving with object of resource, dbgResource and sourceMap + */ +module.exports = async function({resources}) { + return Promise.all(resources.map(async (resource) => { + const dbgPath = resource.getPath().replace(debugFileRegex, "-dbg$1"); + const dbgResource = await resource.clone(); + dbgResource.setPath(dbgPath); + + const filename = path.posix.basename(resource.getPath()); + const code = await resource.getString(); + try { + const dbgFilename = path.posix.basename(dbgPath); + const result = await terser.minify({ + // Use debug-name since this will be referenced in the source map "sources" + [dbgFilename]: code + }, { + output: { + comments: copyrightCommentsAndBundleCommentPattern, + wrap_func_args: false + }, + compress: false, + mangle: { + reserved: [ + "jQuery", + "jquery", + "sap", + ] + }, + sourceMap: { + filename, + url: filename + ".map" + } + }); + resource.setString(result.code); + const sourceMapResource = new Resource({ + path: resource.getPath() + ".map", + string: result.map + }); + return {resource, dbgResource, sourceMapResource}; + } catch (err) { + // Note: err.filename contains the debug-name + throw new Error( + `Minification failed with error: ${err.message} in file ${filename} ` + + `(line ${err.line}, col ${err.col}, pos ${err.pos})`); + } + })); +}; diff --git a/lib/processors/resourceCopier.js b/lib/processors/resourceCopier.js deleted file mode 100644 index dd6247854..000000000 --- a/lib/processors/resourceCopier.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copy files to a different path. - * - * @public - * @alias module:@ui5/builder.processors.resourceCopier - * @param {object} parameters Parameters - * @param {module:@ui5/fs.Resource[]} parameters.resources List of resources to be processed - * @param {object} parameters.options Options - * @param {string} parameters.options.pattern Search pattern for path - * @param {string} parameters.options.replacement Replacement string for path - * @returns {Promise} Promise resolving with the cloned resources - */ -module.exports = function({resources, options: {pattern, replacement}}) { - if (!pattern || typeof replacement !== "string") { - return Promise.reject(new Error("[resourceCopier] Invalid options: Missing pattern or replacement.")); - } - - return Promise.all(resources.map((resource) => { - return resource.clone().then((newResource) => { - newResource.setPath(newResource.getPath().replace(pattern, replacement)); - return newResource; - }); - })); -}; diff --git a/lib/processors/uglifier.js b/lib/processors/uglifier.js deleted file mode 100644 index 7b6e1ebc9..000000000 --- a/lib/processors/uglifier.js +++ /dev/null @@ -1,45 +0,0 @@ -const terser = require("terser"); -/** - * Preserve comments which contain: - *
    - *
  • copyright notice
  • - *
  • license terms
  • - *
  • "@ui5-bundle"
  • - *
  • "@ui5-bundle-raw-include"
  • - *
- * - * @type {RegExp} - */ -const copyrightCommentsAndBundleCommentPattern = /copyright|\(c\)(?:[0-9]+|\s+[0-9A-za-z])|released under|license|\u00a9|^@ui5-bundle-raw-include |^@ui5-bundle /i; - -/** - * Minifies the supplied resources. - * - * @public - * @alias module:@ui5/builder.processors.uglifier - * @param {object} parameters Parameters - * @param {module:@ui5/fs.Resource[]} parameters.resources List of resources to be processed - * @returns {Promise} Promise resolving with uglified resources - */ -module.exports = function({resources}) { - return Promise.all(resources.map(async (resource) => { - const code = await resource.getString(); - try { - const result = await terser.minify({ - [resource.getPath()]: code - }, { - output: { - comments: copyrightCommentsAndBundleCommentPattern, - wrap_func_args: false - }, - compress: false - }); - resource.setString(result.code); - return resource; - } catch (err) { - throw new Error( - `Uglification failed with error: ${err.message} in file ${err.filename} ` + - `(line ${err.line}, col ${err.col}, pos ${err.pos})`); - } - })); -}; diff --git a/lib/tasks/TaskUtil.js b/lib/tasks/TaskUtil.js index 0420d1b39..9e397a62e 100644 --- a/lib/tasks/TaskUtil.js +++ b/lib/tasks/TaskUtil.js @@ -51,14 +51,14 @@ class TaskUtil { * This method is only available to custom task extensions defining * Specification Version 2.2 and above. * - * @param {module:@ui5/fs.Resource} resource The resource the tag should be stored for + * @param {string|module:@ui5/fs.Resource} resourcePath Path or resource-instance the tag should be stored for * @param {string} tag Name of the tag. * Currently only the [STANDARD_TAGS]{@link module:@ui5/builder.tasks.TaskUtil#STANDARD_TAGS} are allowed * @param {string|boolean|integer} [value=true] Tag value. Must be primitive * @public */ - setTag(resource, tag, value) { - return this._projectBuildContext.getResourceTagCollection().setTag(resource, tag, value); + setTag(resourcePath, tag, value) { + return this._projectBuildContext.getResourceTagCollection().setTag(resourcePath, tag, value); } /** @@ -68,14 +68,14 @@ class TaskUtil { * This method is only available to custom task extensions defining * Specification Version 2.2 and above. * - * @param {module:@ui5/fs.Resource} resource The resource the tag should be retrieved for + * @param {string|module:@ui5/fs.Resource} resourcePath Path or resource-instance the tag should be retrieved for * @param {string} tag Name of the tag * @returns {string|boolean|integer|undefined} Tag value for the given resource. * undefined if no value is available * @public */ - getTag(resource, tag) { - return this._projectBuildContext.getResourceTagCollection().getTag(resource, tag); + getTag(resourcePath, tag) { + return this._projectBuildContext.getResourceTagCollection().getTag(resourcePath, tag); } /** @@ -86,12 +86,12 @@ class TaskUtil { * This method is only available to custom task extensions defining * Specification Version 2.2 and above. * - * @param {module:@ui5/fs.Resource} resource The resource the tag should be cleared for + * @param {string|module:@ui5/fs.Resource} resourcePath Path or resource-instance the tag should be cleared for * @param {string} tag Tag * @public */ - clearTag(resource, tag) { - return this._projectBuildContext.getResourceTagCollection().clearTag(resource, tag); + clearTag(resourcePath, tag) { + return this._projectBuildContext.getResourceTagCollection().clearTag(resourcePath, tag); } /** diff --git a/lib/tasks/bundlers/generateBundle.js b/lib/tasks/bundlers/generateBundle.js index 49698e4ba..709f11417 100644 --- a/lib/tasks/bundlers/generateBundle.js +++ b/lib/tasks/bundlers/generateBundle.js @@ -1,4 +1,5 @@ const moduleBundler = require("../../processors/bundlers/moduleBundler"); +const ModuleName = require("../../lbt/utils/ModuleName"); const ReaderCollectionPrioritized = require("@ui5/fs").ReaderCollectionPrioritized; /** @@ -19,11 +20,36 @@ const ReaderCollectionPrioritized = require("@ui5/fs").ReaderCollectionPrioritiz module.exports = function({ workspace, dependencies, taskUtil, options: {projectName, bundleDefinition, bundleOptions} }) { - const combo = new ReaderCollectionPrioritized({ + let combo = new ReaderCollectionPrioritized({ name: `libraryBundler - prioritize workspace over dependencies: ${projectName}`, readers: [workspace, dependencies] }); + if (taskUtil) { + // Omit -dbg files for optimize bundles and vice versa + const filterTag = bundleOptions.optimize ? + taskUtil.STANDARD_TAGS.IsDebugVariant : taskUtil.STANDARD_TAGS.HasDebugVariant; + combo = combo.filter(function(resource) { + return !taskUtil.getTag(resource, filterTag); + }); + + if (!bundleOptions.optimize) { + // For "unoptimized" bundles, the non-debug files have already been filtered out + // Now rename the debug variants to the same name so that they appear like the original + // resource to the bundler + combo = combo.transformer(async function(resourcePath, getResource) { + if (taskUtil.getTag(resourcePath, taskUtil.STANDARD_TAGS.IsDebugVariant)) { + const resource = await getResource(); + const nonDbgPath = ModuleName.getNonDebugName(resource.getPath()); + if (!nonDbgPath) { + throw new Error(`Failed to resolve non-debug name for ${resource.getPath()}`); + } + resource.setPath(nonDbgPath); + } + }); + } + } + return combo.byGlob("/resources/**/*.{js,json,xml,html,properties,library}").then((resources) => { return moduleBundler({ options: { diff --git a/lib/tasks/bundlers/generateComponentPreload.js b/lib/tasks/bundlers/generateComponentPreload.js index b9d8faaf5..4946624b0 100644 --- a/lib/tasks/bundlers/generateComponentPreload.js +++ b/lib/tasks/bundlers/generateComponentPreload.js @@ -28,11 +28,18 @@ const {negateFilters} = require("../../lbt/resources/ResourceFilterList"); module.exports = function({ workspace, dependencies, taskUtil, options: {projectName, paths, namespaces, excludes = []} }) { - const combo = new ReaderCollectionPrioritized({ + let combo = new ReaderCollectionPrioritized({ name: `generateComponentPreload - prioritize workspace over dependencies: ${projectName}`, readers: [workspace, dependencies] }); + if (taskUtil) { + combo = combo.filter(function(resource) { + // Remove any debug variants + return !taskUtil.getTag(resource, taskUtil.STANDARD_TAGS.IsDebugVariant); + }); + } + // TODO 3.0: Limit to workspace resources? return combo.byGlob("/resources/**/*.{js,json,xml,html,properties,library}") .then(async (resources) => { diff --git a/lib/tasks/bundlers/generateLibraryPreload.js b/lib/tasks/bundlers/generateLibraryPreload.js index 8b29b4491..5a6b5bba2 100644 --- a/lib/tasks/bundlers/generateLibraryPreload.js +++ b/lib/tasks/bundlers/generateLibraryPreload.js @@ -2,6 +2,7 @@ const log = require("@ui5/logger").getLogger("builder:tasks:bundlers:generateLib const moduleBundler = require("../../processors/bundlers/moduleBundler"); const ReaderCollectionPrioritized = require("@ui5/fs").ReaderCollectionPrioritized; const {negateFilters} = require("../../lbt/resources/ResourceFilterList"); +const ModuleName = require("../../lbt/utils/ModuleName"); function getDefaultLibraryPreloadFilters(namespace, excludes) { const filters = [ @@ -272,12 +273,19 @@ function getSapUiCoreBunDef(name, filters, preload) { * @returns {Promise} Promise resolving with undefined once data has been written */ module.exports = function({workspace, dependencies, taskUtil, options: {projectName, excludes = []}}) { - const combo = new ReaderCollectionPrioritized({ + let combo = new ReaderCollectionPrioritized({ name: `libraryBundler - prioritize workspace over dependencies: ${projectName}`, readers: [workspace, dependencies] }); - return combo.byGlob("/**/*.{js,json,xml,html,properties,library}").then((resources) => { + if (taskUtil) { + combo = combo.filter(function(resource) { + // Remove any debug variants + return !taskUtil.getTag(resource, taskUtil.STANDARD_TAGS.IsDebugVariant); + }); + } + + return combo.byGlob("/**/*.{js,json,xml,html,properties,library}").then(async (resources) => { // Find all libraries and create a library-preload.js bundle let p = Promise.resolve(); @@ -296,6 +304,27 @@ module.exports = function({workspace, dependencies, taskUtil, options: {projectN const isEvo = resources.find((resource) => { return resource.getPath() === "/resources/ui5loader.js"; }); + + let unoptimizedResources = resources; + if (taskUtil) { + unoptimizedResources = await new ReaderCollectionPrioritized({ + name: `libraryBundler - prioritize workspace over dependencies: ${projectName}`, + readers: [workspace, dependencies] + }).filter(function(resource) { + // Remove any non-debug variants + return !taskUtil.getTag(resource, taskUtil.STANDARD_TAGS.HasDebugVariant); + }).transformer(async function(resourcePath, getResource) { + if (taskUtil.getTag(resourcePath, taskUtil.STANDARD_TAGS.IsDebugVariant)) { + const resource = await getResource(); + const nonDbgPath = ModuleName.getNonDebugName(resource.getPath()); + if (!nonDbgPath) { + throw new Error(`Failed to resolve non-debug name for ${resource.getPath()}`); + } + resource.setPath(nonDbgPath); + } + }).byGlob("/**/*.{js,json,xml,html,properties,library}"); + } + let filters; if (isEvo) { filters = ["ui5loader-autoconfig.js"]; @@ -309,7 +338,7 @@ module.exports = function({workspace, dependencies, taskUtil, options: {projectN }), moduleBundler({ options: getModuleBundlerOptions({name: "sap-ui-core-dbg.js", filters, preload: false}), - resources + resources: unoptimizedResources }), moduleBundler({ options: getModuleBundlerOptions({ @@ -321,7 +350,7 @@ module.exports = function({workspace, dependencies, taskUtil, options: {projectN options: getModuleBundlerOptions({ name: "sap-ui-core-nojQuery-dbg.js", filters, preload: false, provided: true }), - resources + resources: unoptimizedResources }), ]).then((results) => { const bundles = Array.prototype.concat.apply([], results); diff --git a/lib/tasks/bundlers/generateStandaloneAppBundle.js b/lib/tasks/bundlers/generateStandaloneAppBundle.js index ea6129b86..e843f0395 100644 --- a/lib/tasks/bundlers/generateStandaloneAppBundle.js +++ b/lib/tasks/bundlers/generateStandaloneAppBundle.js @@ -1,4 +1,5 @@ const log = require("@ui5/logger").getLogger("builder:tasks:bundlers:generateStandaloneAppBundle"); +const ReaderCollectionPrioritized = require("@ui5/fs").ReaderCollectionPrioritized; const moduleBundler = require("../../processors/bundlers/moduleBundler"); function getBundleDefinition(config) { @@ -76,12 +77,18 @@ module.exports = async function({workspace, dependencies, taskUtil, options: {pr `unable to generate complete bundles for such projects.`); } - // If an application does not have a namespace, its resources are located at the root. Otherwise in /resources - // For dependencies, we do not want to search in their test-resources - const results = await Promise.all([ - workspace.byGlob("/**/*.{js,json,xml,html,properties,library}"), - dependencies.byGlob("/resources/**/*.{js,json,xml,html,properties,library}") - ]); + let combo = new ReaderCollectionPrioritized({ + name: `generateStandaloneAppBundle - prioritize workspace over dependencies: ${projectName}`, + readers: [workspace, dependencies] + }); + + if (taskUtil) { + // Omit -dbg files + combo = combo.filter(function(resource) { + return !taskUtil.getTag(resource, taskUtil.STANDARD_TAGS.IsDebugVariant); + }); + } + const results = await combo.byGlob("/resources/**/*.{js,json,xml,html,properties,library}"); const resources = Array.prototype.concat.apply([], results); const isEvo = resources.find((resource) => { diff --git a/lib/tasks/createDebugFiles.js b/lib/tasks/createDebugFiles.js deleted file mode 100644 index 341e0d548..000000000 --- a/lib/tasks/createDebugFiles.js +++ /dev/null @@ -1,30 +0,0 @@ -const dbg = require("../processors/debugFileCreator"); -const fsInterface = require("@ui5/fs").fsInterface; - -/** - * Task to create dbg files. - * - * @public - * @alias module:@ui5/builder.tasks.createDebugFiles - * @param {object} parameters Parameters - * @param {module:@ui5/fs.DuplexCollection} parameters.workspace DuplexCollection to read and write files - * @param {object} parameters.options Options - * @param {string} parameters.options.pattern Pattern to locate the files to be processed - * @returns {Promise} Promise resolving with undefined once data has been written - */ -module.exports = async function({workspace, options: {pattern}}) { - let allResources; - if (workspace.byGlobSource) { // API only available on duplex collections - allResources = await workspace.byGlobSource(pattern); - } else { - allResources = await workspace.byGlob(pattern); - } - return dbg({ - fs: fsInterface(workspace), - resources: allResources - }).then((processedResources) => { - return Promise.all(processedResources.map((resource) => { - return workspace.write(resource); - })); - }); -}; diff --git a/lib/tasks/minify.js b/lib/tasks/minify.js new file mode 100644 index 000000000..ba508ca5a --- /dev/null +++ b/lib/tasks/minify.js @@ -0,0 +1,30 @@ +const minifier = require("../processors/minifier"); + +/** + * Task to minify resources. + * + * @public + * @alias module:@ui5/builder.tasks.minify + * @param {object} parameters Parameters + * @param {module:@ui5/fs.DuplexCollection} parameters.workspace DuplexCollection to read and write files + * @param {module:@ui5/builder.tasks.TaskUtil|object} [parameters.taskUtil] TaskUtil + * @param {object} parameters.options Options + * @param {string} parameters.options.pattern Pattern to locate the files to be processed + * @returns {Promise} Promise resolving with undefined once data has been written + */ +module.exports = async function({workspace, taskUtil, options: {pattern}}) { + const resources = await workspace.byGlob(pattern); + const processedResources = await minifier({resources}); + + return Promise.all(processedResources.map(async ({resource, dbgResource, sourceMapResource}) => { + if (taskUtil) { + taskUtil.setTag(resource, taskUtil.STANDARD_TAGS.HasDebugVariant); + taskUtil.setTag(dbgResource, taskUtil.STANDARD_TAGS.IsDebugVariant); + } + return Promise.all([ + workspace.write(resource), + workspace.write(dbgResource), + workspace.write(sourceMapResource) + ]); + })); +}; diff --git a/lib/tasks/taskRepository.js b/lib/tasks/taskRepository.js index 6e2ec351d..8e80e0e3f 100644 --- a/lib/tasks/taskRepository.js +++ b/lib/tasks/taskRepository.js @@ -2,12 +2,11 @@ const taskInfos = { replaceCopyright: {path: "./replaceCopyright"}, replaceVersion: {path: "./replaceVersion"}, replaceBuildtime: {path: "./replaceBuildtime"}, - createDebugFiles: {path: "./createDebugFiles"}, escapeNonAsciiCharacters: {path: "./escapeNonAsciiCharacters"}, executeJsdocSdkTransformation: {path: "./jsdoc/executeJsdocSdkTransformation"}, generateApiIndex: {path: "./jsdoc/generateApiIndex"}, generateJsdoc: {path: "./jsdoc/generateJsdoc"}, - uglify: {path: "./uglify"}, + minify: {path: "./minify"}, buildThemes: {path: "./buildThemes"}, transformBootstrapHtml: {path: "./transformBootstrapHtml"}, generateLibraryManifest: {path: "./generateLibraryManifest"}, @@ -27,6 +26,11 @@ function getTask(taskName) { const taskInfo = taskInfos[taskName]; if (!taskInfo) { + if (["createDebugFiles", "uglify"].includes(taskName)) { + throw new Error( + `Standard task ${taskName} has been removed in UI5 Tooling 3.0. ` + + `Please see the migration guide at https://sap.github.io/ui5-tooling/updates/migrate-v3/`); + } throw new Error(`taskRepository: Unknown Task ${taskName}`); } try { diff --git a/lib/tasks/uglify.js b/lib/tasks/uglify.js deleted file mode 100644 index 60884fda1..000000000 --- a/lib/tasks/uglify.js +++ /dev/null @@ -1,33 +0,0 @@ -const uglifyProcessor = require("../processors/uglifier"); - -/** - * Task to minify resources. - * - * @public - * @alias module:@ui5/builder.tasks.uglify - * @param {object} parameters Parameters - * @param {module:@ui5/fs.DuplexCollection} parameters.workspace DuplexCollection to read and write files - * @param {module:@ui5/builder.tasks.TaskUtil|object} [parameters.taskUtil] TaskUtil - * @param {object} parameters.options Options - * @param {string} parameters.options.pattern Pattern to locate the files to be processed - * @returns {Promise} Promise resolving with undefined once data has been written - */ -module.exports = function({workspace, taskUtil, options: {pattern}}) { - return workspace.byGlobSource(pattern) - .then((allResources) => { - let resources = allResources; - if (taskUtil) { - resources = allResources.filter((resource) => { - return !taskUtil.getTag(resource, taskUtil.STANDARD_TAGS.IsBundle); - }); - } - return uglifyProcessor({ - resources - }); - }) - .then((processedResources) => { - return Promise.all(processedResources.map((resource) => { - return workspace.write(resource); - })); - }); -}; diff --git a/lib/types/application/ApplicationBuilder.js b/lib/types/application/ApplicationBuilder.js index a01219803..444ebce64 100644 --- a/lib/types/application/ApplicationBuilder.js +++ b/lib/types/application/ApplicationBuilder.js @@ -67,6 +67,27 @@ class ApplicationBuilder extends AbstractBuilder { }); } + // Support rules should not be minified to have readable code in the Support Assistant + const minificationPattern = ["/**/*.js", "!**/*.support.js"]; + if (["2.6"].includes(project.specVersion)) { + const minificationExcludes = project.builder && project.builder.minification && + project.builder.minification.excludes; + if (minificationExcludes) { + // TODO 3.0: namespaces should become mandatory, see existing check above + const patternPrefix = project.metadata.namespace ? "/resources/" : "/"; + this.enhancePatternWithExcludes(minificationPattern, minificationExcludes, patternPrefix); + } + } + this.addTask("minify", async () => { + return getTask("minify").task({ + workspace: resourceCollections.workspace, + taskUtil, + options: { + pattern: minificationPattern + } + }); + }); + const componentPreload = project.builder && project.builder.componentPreload; if (componentPreload && (componentPreload.namespaces || componentPreload.paths)) { this.addTask("generateComponentPreload", async () => { @@ -138,37 +159,6 @@ class ApplicationBuilder extends AbstractBuilder { }); } - const minificationPattern = ["/**/*.js"]; - if (["2.6"].includes(project.specVersion)) { - const minificationExcludes = project.builder && project.builder.minification && - project.builder.minification.excludes; - if (minificationExcludes) { - // TODO 3.0: namespaces should become mandatory, see existing check above - const patternPrefix = project.metadata.namespace ? "/resources/" : "/"; - this.enhancePatternWithExcludes(minificationPattern, minificationExcludes, patternPrefix); - } - } - this.addTask("createDebugFiles", async () => { - const createDebugFiles = getTask("createDebugFiles").task; - return createDebugFiles({ - workspace: resourceCollections.workspace, - options: { - pattern: minificationPattern - } - }); - }); - - this.addTask("uglify", async () => { - const uglify = getTask("uglify").task; - return uglify({ - workspace: resourceCollections.workspace, - taskUtil, - options: { - pattern: minificationPattern - } - }); - }); - this.addTask("generateVersionInfo", async () => { return getTask("generateVersionInfo").task({ workspace: resourceCollections.workspace, diff --git a/lib/types/library/LibraryBuilder.js b/lib/types/library/LibraryBuilder.js index 90149a18f..d31148e36 100644 --- a/lib/types/library/LibraryBuilder.js +++ b/lib/types/library/LibraryBuilder.js @@ -89,6 +89,26 @@ class LibraryBuilder extends AbstractBuilder { }); } + // Support rules should not be minified to have readable code in the Support Assistant + const minificationPattern = ["/resources/**/*.js", "!**/*.support.js"]; + if (["2.6"].includes(project.specVersion)) { + const minificationExcludes = project.builder && project.builder.minification && + project.builder.minification.excludes; + if (minificationExcludes) { + this.enhancePatternWithExcludes(minificationPattern, minificationExcludes, "/resources/"); + } + } + + this.addTask("minify", async () => { + return getTask("minify").task({ + workspace: resourceCollections.workspace, + taskUtil, + options: { + pattern: minificationPattern + } + }); + }); + const componentPreload = project.builder && project.builder.componentPreload; if (componentPreload) { this.addTask("generateComponentPreload", async () => { @@ -195,33 +215,6 @@ class LibraryBuilder extends AbstractBuilder { }); }); - const minificationPattern = ["/resources/**/*.js"]; - if (["2.6"].includes(project.specVersion)) { - const minificationExcludes = project.builder && project.builder.minification && - project.builder.minification.excludes; - if (minificationExcludes) { - this.enhancePatternWithExcludes(minificationPattern, minificationExcludes, "/resources/"); - } - } - this.addTask("createDebugFiles", async () => { - return getTask("createDebugFiles").task({ - workspace: resourceCollections.workspace, - options: { - pattern: minificationPattern - } - }); - }); - - this.addTask("uglify", async () => { - return getTask("uglify").task({ - workspace: resourceCollections.workspace, - taskUtil, - options: { - pattern: minificationPattern - } - }); - }); - this.addTask("generateResourcesJson", () => { return getTask("generateResourcesJson").task({ workspace: resourceCollections.workspace, diff --git a/test/expected/build/application.a/dest-clean/fileWithoutExtension b/test/expected/build/application.a/dest-clean/fileWithoutExtension new file mode 100644 index 000000000..1a39ca7a7 --- /dev/null +++ b/test/expected/build/application.a/dest-clean/fileWithoutExtension @@ -0,0 +1 @@ +A file without an extension \ No newline at end of file diff --git a/test/expected/build/application.a/dest-clean/index.html b/test/expected/build/application.a/dest-clean/index.html new file mode 100644 index 000000000..1523b1dc3 --- /dev/null +++ b/test/expected/build/application.a/dest-clean/index.html @@ -0,0 +1,11 @@ + + + + Application A + + + + + + \ No newline at end of file diff --git a/test/expected/build/application.a/dest-clean/test.js b/test/expected/build/application.a/dest-clean/test.js new file mode 100644 index 000000000..cb4595405 --- /dev/null +++ b/test/expected/build/application.a/dest-clean/test.js @@ -0,0 +1,9 @@ +sap.ui.define([ + "library/d/some" +], function(someObject) { + function test(paramA) { + var variableA = paramA; + console.log(variableA); + } + test(); +}); diff --git a/test/expected/build/application.a/dest-deps-excl/test.js b/test/expected/build/application.a/dest-deps-excl/test.js index fd8278c6e..24b3706c6 100644 --- a/test/expected/build/application.a/dest-deps-excl/test.js +++ b/test/expected/build/application.a/dest-deps-excl/test.js @@ -1 +1,2 @@ -sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-excl/test.js.map b/test/expected/build/application.a/dest-deps-excl/test.js.map new file mode 100644 index 000000000..1d04a4e3e --- /dev/null +++ b/test/expected/build/application.a/dest-deps-excl/test.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["test-dbg.js"],"names":["sap","ui","define","someObject","test","paramA","variableA","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CACV,kBACD,SAASC,GACX,SAASC,EAAKC,GACb,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test.js"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-incl/fileWithoutExtension b/test/expected/build/application.a/dest-deps-incl/fileWithoutExtension new file mode 100644 index 000000000..1a39ca7a7 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/fileWithoutExtension @@ -0,0 +1 @@ +A file without an extension \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-incl/index.html b/test/expected/build/application.a/dest-deps-incl/index.html new file mode 100644 index 000000000..1523b1dc3 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/index.html @@ -0,0 +1,11 @@ + + + + Application A + + + + + + \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-incl/resources/library/a/.library b/test/expected/build/application.a/dest-deps-incl/resources/library/a/.library new file mode 100644 index 000000000..cddfadd9a --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/library/a/.library @@ -0,0 +1,17 @@ + + + + library.a + SAP SE + Some fancy copyright ${currentYear} + 1.0.0 + + Library A + + + + library.d + + + + diff --git a/test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library-RTL.css b/test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library-RTL.css new file mode 100644 index 000000000..5398b3f08 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library-RTL.css @@ -0,0 +1,3 @@ +.library-a-foo{color:#fafad2;padding:1px 4px 3px 2px} +/* Inline theming parameters */ +#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')} diff --git a/test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library-parameters.json b/test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library-parameters.json new file mode 100644 index 000000000..da3b7a52f --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library-parameters.json @@ -0,0 +1 @@ +{"libraryAColor1":"#fafad2"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library.css b/test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library.css new file mode 100644 index 000000000..ba056b3c0 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library.css @@ -0,0 +1,3 @@ +.library-a-foo{color:#fafad2;padding:1px 2px 3px 4px} +/* Inline theming parameters */ +#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')} diff --git a/test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library.source.less b/test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library.source.less new file mode 100644 index 000000000..ff0f1d5e3 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/library/a/themes/base/library.source.less @@ -0,0 +1,6 @@ +@libraryAColor1: lightgoldenrodyellow; + +.library-a-foo { + color: @libraryAColor1; + padding: 1px 2px 3px 4px; +} diff --git a/test/expected/build/application.a/dest-deps-incl/resources/library/b/.library b/test/expected/build/application.a/dest-deps-incl/resources/library/b/.library new file mode 100644 index 000000000..8cfb124a9 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/library/b/.library @@ -0,0 +1,17 @@ + + + + library.b + SAP SE + Some fancy copyright ${currentYear} + 1.0.0 + + Library B + + + + library.d + + + + diff --git a/test/expected/build/application.a/dest-deps-incl/resources/library/c/.library b/test/expected/build/application.a/dest-deps-incl/resources/library/c/.library new file mode 100644 index 000000000..3c011ecd6 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/library/c/.library @@ -0,0 +1,17 @@ + + + + library.c + SAP SE + ${copyright} + 1.0.0 + + Library C + + + + library.d + + + + diff --git a/test/expected/build/application.a/dest-deps-incl/resources/library/d/.library b/test/expected/build/application.a/dest-deps-incl/resources/library/d/.library new file mode 100644 index 000000000..d6a612a92 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/library/d/.library @@ -0,0 +1,11 @@ + + + + library.d + SAP SE + Some fancy copyright + 1.0.0 + + Library D + + diff --git a/test/expected/build/application.a/dest-deps-incl/resources/library/d/some-dbg.js b/test/expected/build/application.a/dest-deps-incl/resources/library/d/some-dbg.js new file mode 100644 index 000000000..1e8c6a2f9 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/library/d/some-dbg.js @@ -0,0 +1,7 @@ +/*! + * Some fancy copyright + */ +(function() { + var someNonUglifiedVariable = "World"; + console.log('Hello ' + someNonUglifiedVariable); +})(); diff --git a/test/expected/build/application.a/dest-deps-incl/resources/library/d/some.js b/test/expected/build/application.a/dest-deps-incl/resources/library/d/some.js new file mode 100644 index 000000000..75aba1e23 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/library/d/some.js @@ -0,0 +1,5 @@ +/*! + * Some fancy copyright + */ +(function(){var o="World";console.log("Hello "+o)})(); +//# sourceMappingURL=some.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-incl/resources/library/d/some.js.map b/test/expected/build/application.a/dest-deps-incl/resources/library/d/some.js.map new file mode 100644 index 000000000..bc2b57a0a --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/library/d/some.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["some-dbg.js"],"names":["someNonUglifiedVariable","console","log"],"mappings":";;;CAGA,WACC,IAAIA,EAA0B,QAC9BC,QAAQC,IAAI,SAAWF,IAFxB","file":"some.js"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-incl/resources/ui5loader-dbg.js b/test/expected/build/application.a/dest-deps-incl/resources/ui5loader-dbg.js new file mode 100644 index 000000000..0e76321fd --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/ui5loader-dbg.js @@ -0,0 +1 @@ +// this is just a marker file to enable the EVO bundle format diff --git a/test/expected/build/application.a/dest-deps-incl/resources/ui5loader.js b/test/expected/build/application.a/dest-deps-incl/resources/ui5loader.js new file mode 100644 index 000000000..9b62890d8 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/ui5loader.js @@ -0,0 +1,2 @@ + +//# sourceMappingURL=ui5loader.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-incl/resources/ui5loader.js.map b/test/expected/build/application.a/dest-deps-incl/resources/ui5loader.js.map new file mode 100644 index 000000000..636d46591 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/resources/ui5loader.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"ui5loader.js"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-incl/test-dbg.js b/test/expected/build/application.a/dest-deps-incl/test-dbg.js new file mode 100644 index 000000000..cb4595405 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/test-dbg.js @@ -0,0 +1,9 @@ +sap.ui.define([ + "library/d/some" +], function(someObject) { + function test(paramA) { + var variableA = paramA; + console.log(variableA); + } + test(); +}); diff --git a/test/expected/build/application.a/dest-deps-incl/test-resources/LibraryC/Test.html b/test/expected/build/application.a/dest-deps-incl/test-resources/LibraryC/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-deps-incl/test-resources/library/a/Test.html b/test/expected/build/application.a/dest-deps-incl/test-resources/library/a/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-deps-incl/test-resources/library/b/Test.html b/test/expected/build/application.a/dest-deps-incl/test-resources/library/b/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-deps-incl/test-resources/library/d/Test.html b/test/expected/build/application.a/dest-deps-incl/test-resources/library/d/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-deps-incl/test.js b/test/expected/build/application.a/dest-deps-incl/test.js new file mode 100644 index 000000000..24b3706c6 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/test.js @@ -0,0 +1,2 @@ +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-incl/test.js.map b/test/expected/build/application.a/dest-deps-incl/test.js.map new file mode 100644 index 000000000..1d04a4e3e --- /dev/null +++ b/test/expected/build/application.a/dest-deps-incl/test.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["test-dbg.js"],"names":["sap","ui","define","someObject","test","paramA","variableA","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CACV,kBACD,SAASC,GACX,SAASC,EAAKC,GACb,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test.js"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/resources/library/d/some.js b/test/expected/build/application.a/dest-deps/resources/library/d/some.js index c23f5f207..75aba1e23 100644 --- a/test/expected/build/application.a/dest-deps/resources/library/d/some.js +++ b/test/expected/build/application.a/dest-deps/resources/library/d/some.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -(function(){var o="World";console.log("Hello "+o)})(); \ No newline at end of file +(function(){var o="World";console.log("Hello "+o)})(); +//# sourceMappingURL=some.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/resources/library/d/some.js.map b/test/expected/build/application.a/dest-deps/resources/library/d/some.js.map new file mode 100644 index 000000000..bc2b57a0a --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/library/d/some.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["some-dbg.js"],"names":["someNonUglifiedVariable","console","log"],"mappings":";;;CAGA,WACC,IAAIA,EAA0B,QAC9BC,QAAQC,IAAI,SAAWF,IAFxB","file":"some.js"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/resources/ui5loader.js b/test/expected/build/application.a/dest-deps/resources/ui5loader.js index e69de29bb..9b62890d8 100644 --- a/test/expected/build/application.a/dest-deps/resources/ui5loader.js +++ b/test/expected/build/application.a/dest-deps/resources/ui5loader.js @@ -0,0 +1,2 @@ + +//# sourceMappingURL=ui5loader.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/resources/ui5loader.js.map b/test/expected/build/application.a/dest-deps/resources/ui5loader.js.map new file mode 100644 index 000000000..636d46591 --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/ui5loader.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"ui5loader.js"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/test.js b/test/expected/build/application.a/dest-deps/test.js index fd8278c6e..24b3706c6 100644 --- a/test/expected/build/application.a/dest-deps/test.js +++ b/test/expected/build/application.a/dest-deps/test.js @@ -1 +1,2 @@ -sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/test.js.map b/test/expected/build/application.a/dest-deps/test.js.map new file mode 100644 index 000000000..1d04a4e3e --- /dev/null +++ b/test/expected/build/application.a/dest-deps/test.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["test-dbg.js"],"names":["sap","ui","define","someObject","test","paramA","variableA","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CACV,kBACD,SAASC,GACX,SAASC,EAAKC,GACb,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test.js"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/resources/library/d/some.js b/test/expected/build/application.a/dest-depself/resources/library/d/some.js index c23f5f207..75aba1e23 100644 --- a/test/expected/build/application.a/dest-depself/resources/library/d/some.js +++ b/test/expected/build/application.a/dest-depself/resources/library/d/some.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -(function(){var o="World";console.log("Hello "+o)})(); \ No newline at end of file +(function(){var o="World";console.log("Hello "+o)})(); +//# sourceMappingURL=some.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/resources/library/d/some.js.map b/test/expected/build/application.a/dest-depself/resources/library/d/some.js.map new file mode 100644 index 000000000..bc2b57a0a --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/library/d/some.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["some-dbg.js"],"names":["someNonUglifiedVariable","console","log"],"mappings":";;;CAGA,WACC,IAAIA,EAA0B,QAC9BC,QAAQC,IAAI,SAAWF,IAFxB","file":"some.js"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js index c1aee5600..b03a55c6e 100644 --- a/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js +++ b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js @@ -1,10 +1,12 @@ //@ui5-bundle sap-ui-custom.js sap.ui.require.preload({ "application/a/test.js":function(){sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); +//# sourceMappingURL=test.js.map }, "library/d/some.js":function(){/*! * Some fancy copyright */ (function(){var o="World";console.log("Hello "+o)})(); +//# sourceMappingURL=some.js.map } }); diff --git a/test/expected/build/application.a/dest-depself/resources/ui5loader.js b/test/expected/build/application.a/dest-depself/resources/ui5loader.js index e69de29bb..9b62890d8 100644 --- a/test/expected/build/application.a/dest-depself/resources/ui5loader.js +++ b/test/expected/build/application.a/dest-depself/resources/ui5loader.js @@ -0,0 +1,2 @@ + +//# sourceMappingURL=ui5loader.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/resources/ui5loader.js.map b/test/expected/build/application.a/dest-depself/resources/ui5loader.js.map new file mode 100644 index 000000000..636d46591 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/ui5loader.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"ui5loader.js"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/test.js b/test/expected/build/application.a/dest-depself/test.js index fd8278c6e..24b3706c6 100644 --- a/test/expected/build/application.a/dest-depself/test.js +++ b/test/expected/build/application.a/dest-depself/test.js @@ -1 +1,2 @@ -sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/test.js.map b/test/expected/build/application.a/dest-depself/test.js.map new file mode 100644 index 000000000..1d04a4e3e --- /dev/null +++ b/test/expected/build/application.a/dest-depself/test.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["test-dbg.js"],"names":["sap","ui","define","someObject","test","paramA","variableA","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CACV,kBACD,SAASC,GACX,SAASC,EAAKC,GACb,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test.js"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js b/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js index 7728d6932..5016d451e 100644 --- a/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js +++ b/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js @@ -1,10 +1,14 @@ //@ui5-bundle sap-ui-custom.js sap.ui.require.preload({ "application/a/test.js":function(){sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); +//# sourceMappingURL=test.js.map }, "library/d/some.js":function(){/*! * ${copyright} */ -(function(){var o="World";console.log("Hello "+o)})(); +(function() { + var someNonUglifiedVariable = "World"; + console.log('Hello ' + someNonUglifiedVariable); +})(); } }); diff --git a/test/expected/build/application.a/dest-self/test.js b/test/expected/build/application.a/dest-self/test.js index fd8278c6e..24b3706c6 100644 --- a/test/expected/build/application.a/dest-self/test.js +++ b/test/expected/build/application.a/dest-self/test.js @@ -1 +1,2 @@ -sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-self/test.js.map b/test/expected/build/application.a/dest-self/test.js.map new file mode 100644 index 000000000..1d04a4e3e --- /dev/null +++ b/test/expected/build/application.a/dest-self/test.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["test-dbg.js"],"names":["sap","ui","define","someObject","test","paramA","variableA","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CACV,kBACD,SAASC,GACX,SAASC,EAAKC,GACb,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test.js"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest/test.js b/test/expected/build/application.a/dest/test.js index fd8278c6e..24b3706c6 100644 --- a/test/expected/build/application.a/dest/test.js +++ b/test/expected/build/application.a/dest/test.js @@ -1 +1,2 @@ -sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest/test.js.map b/test/expected/build/application.a/dest/test.js.map new file mode 100644 index 000000000..1d04a4e3e --- /dev/null +++ b/test/expected/build/application.a/dest/test.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["test-dbg.js"],"names":["sap","ui","define","someObject","test","paramA","variableA","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CACV,kBACD,SAASC,GACX,SAASC,EAAKC,GACb,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test.js"} \ No newline at end of file diff --git a/test/expected/build/application.b/standalone/resources/sap-ui-custom-dbg.js b/test/expected/build/application.b/standalone/resources/sap-ui-custom-dbg.js index 4c5f70cc4..be330319f 100644 --- a/test/expected/build/application.b/standalone/resources/sap-ui-custom-dbg.js +++ b/test/expected/build/application.b/standalone/resources/sap-ui-custom-dbg.js @@ -1,4 +1,9 @@ //@ui5-bundle sap-ui-custom-dbg.js +//@ui5-bundle-raw-include ui5loader-autoconfig.js +(function () { + var thisIsTheUi5LoaderAutoconfig = true; + console.log(thisIsTheUi5LoaderAutoconfig); +})() sap.ui.requireSync("sap/ui/core/Core"); // as this module contains the Core, we ensure that the Core has been booted sap.ui.getCore().boot && sap.ui.getCore().boot(); diff --git a/test/expected/build/application.b/standalone/resources/sap-ui-custom.js b/test/expected/build/application.b/standalone/resources/sap-ui-custom.js index 08327d586..b68d6920b 100644 --- a/test/expected/build/application.b/standalone/resources/sap-ui-custom.js +++ b/test/expected/build/application.b/standalone/resources/sap-ui-custom.js @@ -1,7 +1,10 @@ //@ui5-bundle sap-ui-custom.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +//@ui5-bundle-raw-include ui5loader-autoconfig.js +(function () { + var thisIsTheUi5LoaderAutoconfig = true; + console.log(thisIsTheUi5LoaderAutoconfig); +})() +sap.ui.require.preload({ "id1/embedded/i18n/i18n.properties":'title=embedded-i18n', "id1/embedded/i18n/i18n_de.properties":'title=embedded-i18n_de', "id1/embedded/i18n_fr.properties":'title=embedded-i18n_fr-wrong', @@ -11,9 +14,12 @@ jQuery.sap.registerPreloadedModules({ "id1/i18n/i18n_de.properties":'title=app-i18n_de\nfame=Stra\\u00dfe', "id1/i18n/l10n.properties":'title=app-i18n-wrong\nfame=Stra\\u00dfe', "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/ui/core/Core.js":function(){ + "sap/ui/core/Core.js":function(){(function () { + var core = true; + console.log(core); +})() } -}}); +}); sap.ui.requireSync("sap/ui/core/Core"); // as this module contains the Core, we ensure that the Core has been booted sap.ui.getCore().boot && sap.ui.getCore().boot(); diff --git a/test/expected/build/application.g/cachebuster/Component-preload.js b/test/expected/build/application.g/cachebuster/Component-preload.js index 504dbcbe0..e42a2092a 100644 --- a/test/expected/build/application.g/cachebuster/Component-preload.js +++ b/test/expected/build/application.g/cachebuster/Component-preload.js @@ -3,12 +3,15 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ "application/g/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map }, "application/g/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g","type":"application","applicationVersion":{"version":"1.0.0"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"Some fancy copyright"}', "application/g/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map }, "application/g/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}', "application/g/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map }, "application/g/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' }}); diff --git a/test/expected/build/application.g/cachebuster/Component.js b/test/expected/build/application.g/cachebuster/Component.js index 6fdb761a9..6ad3cfb41 100644 --- a/test/expected/build/application.g/cachebuster/Component.js +++ b/test/expected/build/application.g/cachebuster/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster/Component.js.map b/test/expected/build/application.g/cachebuster/Component.js.map new file mode 100644 index 000000000..97f5dc393 --- /dev/null +++ b/test/expected/build/application.g/cachebuster/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster/sap-ui-cachebuster-info.json b/test/expected/build/application.g/cachebuster/sap-ui-cachebuster-info.json index b7b2814c7..a8cc8479d 100644 --- a/test/expected/build/application.g/cachebuster/sap-ui-cachebuster-info.json +++ b/test/expected/build/application.g/cachebuster/sap-ui-cachebuster-info.json @@ -1,12 +1,15 @@ { - "Component-dbg.js": 1540570258000, - "subcomponentA/manifest.json": 1540570258000, - "subcomponentB/manifest.json": 1540570258000, - "subcomponentB/Component.js": 1540570258000, - "subcomponentA/Component.js": 1540570258000, - "Component.js": 1540570258000, - "Component-preload.js": 1554823987259, - "subcomponentB/Component-dbg.js": 1540570258000, - "subcomponentA/Component-dbg.js": 1540570258000, - "manifest.json": 1540570258000 -} + "subcomponentB/Component-dbg.js": 1542320456755, + "subcomponentA/manifest.json": 1542320456755, + "manifest.json": 1603970570100, + "subcomponentA/Component.js": 1542320456755, + "subcomponentB/manifest.json": 1542320456755, + "Component.js": 1542320456754, + "Component-dbg.js": 1542320456754, + "Component.js.map": 1638483275870, + "subcomponentA/Component-dbg.js": 1542320456755, + "subcomponentA/Component.js.map": 1638483275870, + "subcomponentB/Component.js": 1542320456755, + "subcomponentB/Component.js.map": 1638483275871, + "Component-preload.js": 1638483275995 +} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster/subcomponentA/Component.js b/test/expected/build/application.g/cachebuster/subcomponentA/Component.js index 0d3fd6ccc..b53909394 100644 --- a/test/expected/build/application.g/cachebuster/subcomponentA/Component.js +++ b/test/expected/build/application.g/cachebuster/subcomponentA/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster/subcomponentA/Component.js.map b/test/expected/build/application.g/cachebuster/subcomponentA/Component.js.map new file mode 100644 index 000000000..5303aa4c7 --- /dev/null +++ b/test/expected/build/application.g/cachebuster/subcomponentA/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster/subcomponentB/Component.js b/test/expected/build/application.g/cachebuster/subcomponentB/Component.js index c8af2ace9..c5cc2084d 100644 --- a/test/expected/build/application.g/cachebuster/subcomponentB/Component.js +++ b/test/expected/build/application.g/cachebuster/subcomponentB/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster/subcomponentB/Component.js.map b/test/expected/build/application.g/cachebuster/subcomponentB/Component.js.map new file mode 100644 index 000000000..5303aa4c7 --- /dev/null +++ b/test/expected/build/application.g/cachebuster/subcomponentB/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/Component-dbg.js b/test/expected/build/application.g/cachebuster_hash/Component-dbg.js new file mode 100644 index 000000000..fd86d4bd8 --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/Component-dbg.js @@ -0,0 +1,8 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + metadata: { + manifest: "json" + } + }); +}); \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/Component-preload.js b/test/expected/build/application.g/cachebuster_hash/Component-preload.js new file mode 100644 index 000000000..e42a2092a --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/Component-preload.js @@ -0,0 +1,17 @@ +//@ui5-bundle application/g/Component-preload.js +jQuery.sap.registerPreloadedModules({ +"version":"2.0", +"modules":{ + "application/g/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map +}, + "application/g/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g","type":"application","applicationVersion":{"version":"1.0.0"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"Some fancy copyright"}', + "application/g/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map +}, + "application/g/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}', + "application/g/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map +}, + "application/g/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' +}}); diff --git a/test/expected/build/application.g/cachebuster_hash/Component.js b/test/expected/build/application.g/cachebuster_hash/Component.js new file mode 100644 index 000000000..6ad3cfb41 --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/Component.js @@ -0,0 +1,2 @@ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/Component.js.map b/test/expected/build/application.g/cachebuster_hash/Component.js.map new file mode 100644 index 000000000..97f5dc393 --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/manifest.json b/test/expected/build/application.g/cachebuster_hash/manifest.json new file mode 100644 index 000000000..620705334 --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/manifest.json @@ -0,0 +1,14 @@ +{ + "_version": "1.1.0", + "sap.app": { + "_version": "1.1.0", + "id": "application.g", + "type": "application", + "applicationVersion": { + "version": "1.0.0" + }, + "embeds": ["embedded"], + "title": "{{title}}" + }, + "customCopyrightString": "Some fancy copyright" +} diff --git a/test/expected/build/application.g/cachebuster_hash/sap-ui-cachebuster-info.json b/test/expected/build/application.g/cachebuster_hash/sap-ui-cachebuster-info.json new file mode 100644 index 000000000..68f5436bc --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/sap-ui-cachebuster-info.json @@ -0,0 +1,15 @@ +{ + "Component.js": "174e92417f0fa7889c2bdb8a243c4d748d66a4da", + "subcomponentB/manifest.json": "3a08d0555e3e49fe683e01205090eed3182b4a9f", + "manifest.json": "a867583cff8c3a5135bfbdd97dcb7a9cad4948bd", + "subcomponentB/Component.js": "d2a467cc8d05c693b22dbef82c2bff4610611d81", + "subcomponentA/Component.js": "37e2d3c99ddf728313ceaddd087c6d547fcbdf8f", + "subcomponentA/manifest.json": "7dfcdf568dcfb47c74d309e2f00193688b112fb7", + "subcomponentB/Component-dbg.js": "c03da2c5ff162c1d9d5e5c4a3edc2cebcda6b0a1", + "subcomponentB/Component.js.map": "76cd9820f761dd43fe4b2a6f5397d09625603e0d", + "subcomponentA/Component-dbg.js": "fef3a5814776e5575302f814e96ae31a13df12b7", + "subcomponentA/Component.js.map": "76cd9820f761dd43fe4b2a6f5397d09625603e0d", + "Component-dbg.js": "874c35543ae850262d1552b6c2d00cecaae205a7", + "Component.js.map": "35e88e40f4933fe235a359361d7bd3459e6f5235", + "Component-preload.js": "d55d19cde640e716b1e03fe44d21436d5158db09" +} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component-dbg.js b/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component-dbg.js new file mode 100644 index 000000000..5f1b47a8a --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component-dbg.js @@ -0,0 +1,8 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.subcomponentA.Component', { + metadata: { + manifest: "json" + } + }); +}); \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component.js b/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component.js new file mode 100644 index 000000000..b53909394 --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component.js @@ -0,0 +1,2 @@ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component.js.map b/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component.js.map new file mode 100644 index 000000000..5303aa4c7 --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/subcomponentA/manifest.json b/test/expected/build/application.g/cachebuster_hash/subcomponentA/manifest.json new file mode 100644 index 000000000..ac1f84ae8 --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/subcomponentA/manifest.json @@ -0,0 +1,13 @@ +{ + "_version": "1.1.0", + "sap.app": { + "_version": "1.1.0", + "id": "application.g.subcomponentA", + "type": "application", + "applicationVersion": { + "version": "1.2.2" + }, + "embeds": ["embedded"], + "title": "{{title}}" + } +} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component-dbg.js b/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component-dbg.js new file mode 100644 index 000000000..5fb07ed25 --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component-dbg.js @@ -0,0 +1,8 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.subcomponentB.Component', { + metadata: { + manifest: "json" + } + }); +}); \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component.js b/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component.js new file mode 100644 index 000000000..c5cc2084d --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component.js @@ -0,0 +1,2 @@ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component.js.map b/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component.js.map new file mode 100644 index 000000000..5303aa4c7 --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/subcomponentB/manifest.json b/test/expected/build/application.g/cachebuster_hash/subcomponentB/manifest.json new file mode 100644 index 000000000..84cd1802f --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/subcomponentB/manifest.json @@ -0,0 +1,13 @@ +{ + "_version": "1.1.0", + "sap.app": { + "_version": "1.1.0", + "id": "application.g.subcomponentB", + "type": "application", + "applicationVersion": { + "version": "1.2.2" + }, + "embeds": ["embedded"], + "title": "{{title}}" + } +} \ No newline at end of file diff --git a/test/expected/build/application.g/dest/Component-preload.js b/test/expected/build/application.g/dest/Component-preload.js index bb4d7436f..3754c4605 100644 --- a/test/expected/build/application.g/dest/Component-preload.js +++ b/test/expected/build/application.g/dest/Component-preload.js @@ -3,6 +3,7 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ "application/g/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map }, "application/g/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g","type":"application","applicationVersion":{"version":"1.0.0"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"Some fancy copyright"}' }}); diff --git a/test/expected/build/application.g/dest/Component.js b/test/expected/build/application.g/dest/Component.js index 6fdb761a9..6ad3cfb41 100644 --- a/test/expected/build/application.g/dest/Component.js +++ b/test/expected/build/application.g/dest/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.g/dest/Component.js.map b/test/expected/build/application.g/dest/Component.js.map new file mode 100644 index 000000000..97f5dc393 --- /dev/null +++ b/test/expected/build/application.g/dest/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.g/dest/subcomponentA/Component-preload.js b/test/expected/build/application.g/dest/subcomponentA/Component-preload.js index 4c103c261..47f678316 100644 --- a/test/expected/build/application.g/dest/subcomponentA/Component-preload.js +++ b/test/expected/build/application.g/dest/subcomponentA/Component-preload.js @@ -3,6 +3,7 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ "application/g/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map }, "application/g/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' }}); diff --git a/test/expected/build/application.g/dest/subcomponentA/Component.js b/test/expected/build/application.g/dest/subcomponentA/Component.js index 0d3fd6ccc..b53909394 100644 --- a/test/expected/build/application.g/dest/subcomponentA/Component.js +++ b/test/expected/build/application.g/dest/subcomponentA/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.g/dest/subcomponentA/Component.js.map b/test/expected/build/application.g/dest/subcomponentA/Component.js.map new file mode 100644 index 000000000..5303aa4c7 --- /dev/null +++ b/test/expected/build/application.g/dest/subcomponentA/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.g/dest/subcomponentB/Component-preload.js b/test/expected/build/application.g/dest/subcomponentB/Component-preload.js index 14667fe94..f6815fb06 100644 --- a/test/expected/build/application.g/dest/subcomponentB/Component-preload.js +++ b/test/expected/build/application.g/dest/subcomponentB/Component-preload.js @@ -3,6 +3,7 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ "application/g/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map }, "application/g/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' }}); diff --git a/test/expected/build/application.g/dest/subcomponentB/Component.js b/test/expected/build/application.g/dest/subcomponentB/Component.js index c8af2ace9..c5cc2084d 100644 --- a/test/expected/build/application.g/dest/subcomponentB/Component.js +++ b/test/expected/build/application.g/dest/subcomponentB/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.g/dest/subcomponentB/Component.js.map b/test/expected/build/application.g/dest/subcomponentB/Component.js.map new file mode 100644 index 000000000..5303aa4c7 --- /dev/null +++ b/test/expected/build/application.g/dest/subcomponentB/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/Component-dbg.js b/test/expected/build/application.g/dest2/Component-dbg.js new file mode 100644 index 000000000..fd86d4bd8 --- /dev/null +++ b/test/expected/build/application.g/dest2/Component-dbg.js @@ -0,0 +1,8 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + metadata: { + manifest: "json" + } + }); +}); \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/Component-preload.js b/test/expected/build/application.g/dest2/Component-preload.js new file mode 100644 index 000000000..3754c4605 --- /dev/null +++ b/test/expected/build/application.g/dest2/Component-preload.js @@ -0,0 +1,9 @@ +//@ui5-bundle application/g/Component-preload.js +jQuery.sap.registerPreloadedModules({ +"version":"2.0", +"modules":{ + "application/g/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map +}, + "application/g/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g","type":"application","applicationVersion":{"version":"1.0.0"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"Some fancy copyright"}' +}}); diff --git a/test/expected/build/application.g/dest2/Component.js b/test/expected/build/application.g/dest2/Component.js new file mode 100644 index 000000000..6ad3cfb41 --- /dev/null +++ b/test/expected/build/application.g/dest2/Component.js @@ -0,0 +1,2 @@ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/Component.js.map b/test/expected/build/application.g/dest2/Component.js.map new file mode 100644 index 000000000..97f5dc393 --- /dev/null +++ b/test/expected/build/application.g/dest2/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/manifest.json b/test/expected/build/application.g/dest2/manifest.json new file mode 100644 index 000000000..620705334 --- /dev/null +++ b/test/expected/build/application.g/dest2/manifest.json @@ -0,0 +1,14 @@ +{ + "_version": "1.1.0", + "sap.app": { + "_version": "1.1.0", + "id": "application.g", + "type": "application", + "applicationVersion": { + "version": "1.0.0" + }, + "embeds": ["embedded"], + "title": "{{title}}" + }, + "customCopyrightString": "Some fancy copyright" +} diff --git a/test/expected/build/application.g/dest2/subcomponentA/Component-dbg.js b/test/expected/build/application.g/dest2/subcomponentA/Component-dbg.js new file mode 100644 index 000000000..5f1b47a8a --- /dev/null +++ b/test/expected/build/application.g/dest2/subcomponentA/Component-dbg.js @@ -0,0 +1,8 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.subcomponentA.Component', { + metadata: { + manifest: "json" + } + }); +}); \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js b/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js new file mode 100644 index 000000000..47f678316 --- /dev/null +++ b/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js @@ -0,0 +1,9 @@ +//@ui5-bundle application/g/subcomponentA/Component-preload.js +jQuery.sap.registerPreloadedModules({ +"version":"2.0", +"modules":{ + "application/g/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map +}, + "application/g/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' +}}); diff --git a/test/expected/build/application.g/dest2/subcomponentA/Component.js b/test/expected/build/application.g/dest2/subcomponentA/Component.js new file mode 100644 index 000000000..b53909394 --- /dev/null +++ b/test/expected/build/application.g/dest2/subcomponentA/Component.js @@ -0,0 +1,2 @@ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentA/Component.js.map b/test/expected/build/application.g/dest2/subcomponentA/Component.js.map new file mode 100644 index 000000000..5303aa4c7 --- /dev/null +++ b/test/expected/build/application.g/dest2/subcomponentA/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentA/manifest.json b/test/expected/build/application.g/dest2/subcomponentA/manifest.json new file mode 100644 index 000000000..ac1f84ae8 --- /dev/null +++ b/test/expected/build/application.g/dest2/subcomponentA/manifest.json @@ -0,0 +1,13 @@ +{ + "_version": "1.1.0", + "sap.app": { + "_version": "1.1.0", + "id": "application.g.subcomponentA", + "type": "application", + "applicationVersion": { + "version": "1.2.2" + }, + "embeds": ["embedded"], + "title": "{{title}}" + } +} \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentB/Component-dbg.js b/test/expected/build/application.g/dest2/subcomponentB/Component-dbg.js new file mode 100644 index 000000000..5fb07ed25 --- /dev/null +++ b/test/expected/build/application.g/dest2/subcomponentB/Component-dbg.js @@ -0,0 +1,8 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.subcomponentB.Component', { + metadata: { + manifest: "json" + } + }); +}); \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js b/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js new file mode 100644 index 000000000..f6815fb06 --- /dev/null +++ b/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js @@ -0,0 +1,9 @@ +//@ui5-bundle application/g/subcomponentB/Component-preload.js +jQuery.sap.registerPreloadedModules({ +"version":"2.0", +"modules":{ + "application/g/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map +}, + "application/g/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' +}}); diff --git a/test/expected/build/application.g/dest2/subcomponentB/Component.js b/test/expected/build/application.g/dest2/subcomponentB/Component.js new file mode 100644 index 000000000..c5cc2084d --- /dev/null +++ b/test/expected/build/application.g/dest2/subcomponentB/Component.js @@ -0,0 +1,2 @@ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentB/Component.js.map b/test/expected/build/application.g/dest2/subcomponentB/Component.js.map new file mode 100644 index 000000000..5303aa4c7 --- /dev/null +++ b/test/expected/build/application.g/dest2/subcomponentB/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentB/manifest.json b/test/expected/build/application.g/dest2/subcomponentB/manifest.json new file mode 100644 index 000000000..84cd1802f --- /dev/null +++ b/test/expected/build/application.g/dest2/subcomponentB/manifest.json @@ -0,0 +1,13 @@ +{ + "_version": "1.1.0", + "sap.app": { + "_version": "1.1.0", + "id": "application.g.subcomponentB", + "type": "application", + "applicationVersion": { + "version": "1.2.2" + }, + "embeds": ["embedded"], + "title": "{{title}}" + } +} \ No newline at end of file diff --git a/test/expected/build/application.h/dest/Component-dbg.js b/test/expected/build/application.h/dest/Component-dbg.js new file mode 100644 index 000000000..cb9bd4068 --- /dev/null +++ b/test/expected/build/application.h/dest/Component-dbg.js @@ -0,0 +1,8 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.h.Component', { + metadata: { + manifest: "json" + } + }); +}); diff --git a/test/expected/build/application.h/dest/Component.js b/test/expected/build/application.h/dest/Component.js index acf57e86e..ccde11646 100644 --- a/test/expected/build/application.h/dest/Component.js +++ b/test/expected/build/application.h/dest/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.h.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.h.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.h/dest/Component.js.map b/test/expected/build/application.h/dest/Component.js.map new file mode 100644 index 000000000..97f5dc393 --- /dev/null +++ b/test/expected/build/application.h/dest/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsA/customBundle.js b/test/expected/build/application.h/dest/sectionsA/customBundle.js index 4acc4444d..4292cdd48 100644 --- a/test/expected/build/application.h/dest/sectionsA/customBundle.js +++ b/test/expected/build/application.h/dest/sectionsA/customBundle.js @@ -3,7 +3,9 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ "application/h/sectionsA/section1.js":function(){sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); +//# sourceMappingURL=section1.js.map }, "application/h/sectionsA/section3.js":function(){sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); +//# sourceMappingURL=section3.js.map } }}); diff --git a/test/expected/build/application.h/dest/sectionsA/section1-dbg.js b/test/expected/build/application.h/dest/sectionsA/section1-dbg.js new file mode 100644 index 000000000..ac4a81296 --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsA/section1-dbg.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 1 included"); +}); diff --git a/test/expected/build/application.h/dest/sectionsA/section1.js b/test/expected/build/application.h/dest/sectionsA/section1.js index 1ec2e3184..740930367 100644 --- a/test/expected/build/application.h/dest/sectionsA/section1.js +++ b/test/expected/build/application.h/dest/sectionsA/section1.js @@ -1 +1,2 @@ -sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); \ No newline at end of file +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); +//# sourceMappingURL=section1.js.map \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsA/section1.js.map b/test/expected/build/application.h/dest/sectionsA/section1.js.map new file mode 100644 index 000000000..8b3202d17 --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsA/section1.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["section1-dbg.js"],"names":["sap","ui","define","Button","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,gBAAiB,SAASC,GACxCC,QAAQC,IAAI","file":"section1.js"} \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsA/section2-dbg.js b/test/expected/build/application.h/dest/sectionsA/section2-dbg.js new file mode 100644 index 000000000..e009c8286 --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsA/section2-dbg.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 2 included"); +}); diff --git a/test/expected/build/application.h/dest/sectionsA/section2.js b/test/expected/build/application.h/dest/sectionsA/section2.js index a446217a5..653acdb83 100644 --- a/test/expected/build/application.h/dest/sectionsA/section2.js +++ b/test/expected/build/application.h/dest/sectionsA/section2.js @@ -1 +1,2 @@ -sap.ui.define(["sap/m/Button"],function(n){console.log("Section 2 included")}); \ No newline at end of file +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 2 included")}); +//# sourceMappingURL=section2.js.map \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsA/section2.js.map b/test/expected/build/application.h/dest/sectionsA/section2.js.map new file mode 100644 index 000000000..09d59d6ea --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsA/section2.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["section2-dbg.js"],"names":["sap","ui","define","Button","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,gBAAiB,SAASC,GACxCC,QAAQC,IAAI","file":"section2.js"} \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsA/section3-dbg.js b/test/expected/build/application.h/dest/sectionsA/section3-dbg.js new file mode 100644 index 000000000..5fd9349d4 --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsA/section3-dbg.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 3 included"); +}); diff --git a/test/expected/build/application.h/dest/sectionsA/section3.js b/test/expected/build/application.h/dest/sectionsA/section3.js index 8358bbe01..70c1434ed 100644 --- a/test/expected/build/application.h/dest/sectionsA/section3.js +++ b/test/expected/build/application.h/dest/sectionsA/section3.js @@ -1 +1,2 @@ -sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); \ No newline at end of file +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); +//# sourceMappingURL=section3.js.map \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsA/section3.js.map b/test/expected/build/application.h/dest/sectionsA/section3.js.map new file mode 100644 index 000000000..d39b700b8 --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsA/section3.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["section3-dbg.js"],"names":["sap","ui","define","Button","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,gBAAiB,SAASC,GACxCC,QAAQC,IAAI","file":"section3.js"} \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsB/customBundle.js b/test/expected/build/application.h/dest/sectionsB/customBundle.js index 0e66f011b..2ee5ae456 100644 --- a/test/expected/build/application.h/dest/sectionsB/customBundle.js +++ b/test/expected/build/application.h/dest/sectionsB/customBundle.js @@ -2,10 +2,16 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/h/sectionsB/section1.js":function(){sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); + "application/h/sectionsB/section1.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 1 included"); +}); }, - "application/h/sectionsB/section2.js":function(){sap.ui.define(["sap/m/Button"],function(n){console.log("Section 2 included")}); + "application/h/sectionsB/section2.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 2 included"); +}); }, - "application/h/sectionsB/section3.js":function(){sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); + "application/h/sectionsB/section3.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 3 included"); +}); } }}); diff --git a/test/expected/build/application.h/dest/sectionsB/section1-dbg.js b/test/expected/build/application.h/dest/sectionsB/section1-dbg.js new file mode 100644 index 000000000..ac4a81296 --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsB/section1-dbg.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 1 included"); +}); diff --git a/test/expected/build/application.h/dest/sectionsB/section1.js b/test/expected/build/application.h/dest/sectionsB/section1.js index 1ec2e3184..740930367 100644 --- a/test/expected/build/application.h/dest/sectionsB/section1.js +++ b/test/expected/build/application.h/dest/sectionsB/section1.js @@ -1 +1,2 @@ -sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); \ No newline at end of file +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); +//# sourceMappingURL=section1.js.map \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsB/section1.js.map b/test/expected/build/application.h/dest/sectionsB/section1.js.map new file mode 100644 index 000000000..8b3202d17 --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsB/section1.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["section1-dbg.js"],"names":["sap","ui","define","Button","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,gBAAiB,SAASC,GACxCC,QAAQC,IAAI","file":"section1.js"} \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsB/section2-dbg.js b/test/expected/build/application.h/dest/sectionsB/section2-dbg.js new file mode 100644 index 000000000..e009c8286 --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsB/section2-dbg.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 2 included"); +}); diff --git a/test/expected/build/application.h/dest/sectionsB/section2.js b/test/expected/build/application.h/dest/sectionsB/section2.js index a446217a5..653acdb83 100644 --- a/test/expected/build/application.h/dest/sectionsB/section2.js +++ b/test/expected/build/application.h/dest/sectionsB/section2.js @@ -1 +1,2 @@ -sap.ui.define(["sap/m/Button"],function(n){console.log("Section 2 included")}); \ No newline at end of file +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 2 included")}); +//# sourceMappingURL=section2.js.map \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsB/section2.js.map b/test/expected/build/application.h/dest/sectionsB/section2.js.map new file mode 100644 index 000000000..09d59d6ea --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsB/section2.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["section2-dbg.js"],"names":["sap","ui","define","Button","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,gBAAiB,SAASC,GACxCC,QAAQC,IAAI","file":"section2.js"} \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsB/section3-dbg.js b/test/expected/build/application.h/dest/sectionsB/section3-dbg.js new file mode 100644 index 000000000..5fd9349d4 --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsB/section3-dbg.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 3 included"); +}); diff --git a/test/expected/build/application.h/dest/sectionsB/section3.js b/test/expected/build/application.h/dest/sectionsB/section3.js index 8358bbe01..70c1434ed 100644 --- a/test/expected/build/application.h/dest/sectionsB/section3.js +++ b/test/expected/build/application.h/dest/sectionsB/section3.js @@ -1 +1,2 @@ -sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); \ No newline at end of file +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); +//# sourceMappingURL=section3.js.map \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsB/section3.js.map b/test/expected/build/application.h/dest/sectionsB/section3.js.map new file mode 100644 index 000000000..d39b700b8 --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsB/section3.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["section3-dbg.js"],"names":["sap","ui","define","Button","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,gBAAiB,SAASC,GACxCC,QAAQC,IAAI","file":"section3.js"} \ No newline at end of file diff --git a/test/expected/build/application.h/no-minify/Component.js b/test/expected/build/application.h/no-minify/Component.js new file mode 100644 index 000000000..cb9bd4068 --- /dev/null +++ b/test/expected/build/application.h/no-minify/Component.js @@ -0,0 +1,8 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.h.Component', { + metadata: { + manifest: "json" + } + }); +}); diff --git a/test/expected/build/application.h/no-minify/manifest.json b/test/expected/build/application.h/no-minify/manifest.json new file mode 100644 index 000000000..32b7e4a84 --- /dev/null +++ b/test/expected/build/application.h/no-minify/manifest.json @@ -0,0 +1,13 @@ +{ + "_version": "1.1.0", + "sap.app": { + "_version": "1.1.0", + "id": "application.h", + "type": "application", + "applicationVersion": { + "version": "1.2.2" + }, + "embeds": ["embedded"], + "title": "{{title}}" + } +} diff --git a/test/expected/build/application.h/no-minify/sectionsA/customBundle.js b/test/expected/build/application.h/no-minify/sectionsA/customBundle.js new file mode 100644 index 000000000..3bd827332 --- /dev/null +++ b/test/expected/build/application.h/no-minify/sectionsA/customBundle.js @@ -0,0 +1,13 @@ +//@ui5-bundle application/h/sectionsA/customBundle.js +jQuery.sap.registerPreloadedModules({ +"version":"2.0", +"modules":{ + "application/h/sectionsA/section1.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 1 included"); +}); +}, + "application/h/sectionsA/section3.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 3 included"); +}); +} +}}); diff --git a/test/expected/build/application.h/no-minify/sectionsA/section1.js b/test/expected/build/application.h/no-minify/sectionsA/section1.js new file mode 100644 index 000000000..ac4a81296 --- /dev/null +++ b/test/expected/build/application.h/no-minify/sectionsA/section1.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 1 included"); +}); diff --git a/test/expected/build/application.h/no-minify/sectionsA/section2.js b/test/expected/build/application.h/no-minify/sectionsA/section2.js new file mode 100644 index 000000000..e009c8286 --- /dev/null +++ b/test/expected/build/application.h/no-minify/sectionsA/section2.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 2 included"); +}); diff --git a/test/expected/build/application.h/no-minify/sectionsA/section3.js b/test/expected/build/application.h/no-minify/sectionsA/section3.js new file mode 100644 index 000000000..5fd9349d4 --- /dev/null +++ b/test/expected/build/application.h/no-minify/sectionsA/section3.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 3 included"); +}); diff --git a/test/expected/build/application.h/no-minify/sectionsB/customBundle.js b/test/expected/build/application.h/no-minify/sectionsB/customBundle.js new file mode 100644 index 000000000..2ee5ae456 --- /dev/null +++ b/test/expected/build/application.h/no-minify/sectionsB/customBundle.js @@ -0,0 +1,17 @@ +//@ui5-bundle application/h/sectionsB/customBundle.js +jQuery.sap.registerPreloadedModules({ +"version":"2.0", +"modules":{ + "application/h/sectionsB/section1.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 1 included"); +}); +}, + "application/h/sectionsB/section2.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 2 included"); +}); +}, + "application/h/sectionsB/section3.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 3 included"); +}); +} +}}); diff --git a/test/expected/build/application.h/no-minify/sectionsB/section1.js b/test/expected/build/application.h/no-minify/sectionsB/section1.js new file mode 100644 index 000000000..ac4a81296 --- /dev/null +++ b/test/expected/build/application.h/no-minify/sectionsB/section1.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 1 included"); +}); diff --git a/test/expected/build/application.h/no-minify/sectionsB/section2.js b/test/expected/build/application.h/no-minify/sectionsB/section2.js new file mode 100644 index 000000000..e009c8286 --- /dev/null +++ b/test/expected/build/application.h/no-minify/sectionsB/section2.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 2 included"); +}); diff --git a/test/expected/build/application.h/no-minify/sectionsB/section3.js b/test/expected/build/application.h/no-minify/sectionsB/section3.js new file mode 100644 index 000000000..5fd9349d4 --- /dev/null +++ b/test/expected/build/application.h/no-minify/sectionsB/section3.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/m/Button"], function(Button) { + console.log("Section 3 included"); +}); diff --git a/test/expected/build/application.i/dest/Component-dbg.js b/test/expected/build/application.i/dest/Component-dbg.js new file mode 100644 index 000000000..f402cb140 --- /dev/null +++ b/test/expected/build/application.i/dest/Component-dbg.js @@ -0,0 +1,8 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.i.Component', { + metadata: { + manifest: "json" + } + }); +}); diff --git a/test/expected/build/application.i/dest/Component-preload.js b/test/expected/build/application.i/dest/Component-preload.js index 938149674..929f49213 100644 --- a/test/expected/build/application.i/dest/Component-preload.js +++ b/test/expected/build/application.i/dest/Component-preload.js @@ -3,9 +3,11 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ "application/i/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.i.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map }, "application/i/changes/changes-bundle.json":'[{"fileName":"id_456_addField","fileType":"change","changeType":"hideControl","component":"application.i.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.i.Component/changes","creation":"2023-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}},{"fileName":"id_123_addField","fileType":"change","changeType":"hideControl","component":"application.i.Component","content":{},"selector":{"id":"control1"},"layer":"CUSTOMER","texts":{},"namespace":"apps/application.i.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"Max Mustermann"}}]', "application/i/changes/coding/MyExtension.js":function(){sap.ui.define([],function(){return{}}); +//# sourceMappingURL=MyExtension.js.map }, "application/i/changes/fragments/MyFragment.fragment.xml":'', "application/i/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.i","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"},"sap.ui5":{"dependencies":{"libs":{"sap.ui.layout":{},"sap.ui.core":{},"sap.m":{},"sap.ui.fl":{}}}}}' diff --git a/test/expected/build/application.i/dest/Component.js b/test/expected/build/application.i/dest/Component.js index f172a1f15..5d50a2eff 100644 --- a/test/expected/build/application.i/dest/Component.js +++ b/test/expected/build/application.i/dest/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.i.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.i.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.i/dest/Component.js.map b/test/expected/build/application.i/dest/Component.js.map new file mode 100644 index 000000000..97f5dc393 --- /dev/null +++ b/test/expected/build/application.i/dest/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.i/dest/changes/coding/MyExtension-dbg.js b/test/expected/build/application.i/dest/changes/coding/MyExtension-dbg.js new file mode 100644 index 000000000..dfb3da014 --- /dev/null +++ b/test/expected/build/application.i/dest/changes/coding/MyExtension-dbg.js @@ -0,0 +1,3 @@ +sap.ui.define([],function () { + return {}; +}); diff --git a/test/expected/build/application.i/dest/changes/coding/MyExtension.js b/test/expected/build/application.i/dest/changes/coding/MyExtension.js index b9e475d8e..ce81ba310 100644 --- a/test/expected/build/application.i/dest/changes/coding/MyExtension.js +++ b/test/expected/build/application.i/dest/changes/coding/MyExtension.js @@ -1 +1,2 @@ -sap.ui.define([],function(){return{}}); \ No newline at end of file +sap.ui.define([],function(){return{}}); +//# sourceMappingURL=MyExtension.js.map \ No newline at end of file diff --git a/test/expected/build/application.i/dest/changes/coding/MyExtension.js.map b/test/expected/build/application.i/dest/changes/coding/MyExtension.js.map new file mode 100644 index 000000000..bff243492 --- /dev/null +++ b/test/expected/build/application.i/dest/changes/coding/MyExtension.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["MyExtension-dbg.js"],"names":["sap","ui","define"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAG,WAChB,MAAO","file":"MyExtension.js"} \ No newline at end of file diff --git a/test/expected/build/application.j/dest-resources-json/Component-dbg.js b/test/expected/build/application.j/dest-resources-json/Component-dbg.js new file mode 100644 index 000000000..e40d21d9a --- /dev/null +++ b/test/expected/build/application.j/dest-resources-json/Component-dbg.js @@ -0,0 +1,8 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.j.Component', { + metadata: { + manifest: "json" + } + }); +}); diff --git a/test/expected/build/application.j/dest-resources-json/Component-preload.js b/test/expected/build/application.j/dest-resources-json/Component-preload.js index 31e1ed1fe..b00969cfa 100644 --- a/test/expected/build/application.j/dest-resources-json/Component-preload.js +++ b/test/expected/build/application.j/dest-resources-json/Component-preload.js @@ -3,8 +3,10 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ "application/j/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map }, "application/j/changes/coding/MyExtension.js":function(){sap.ui.define([],function(){return{}}); +//# sourceMappingURL=MyExtension.js.map }, "application/j/changes/flexibility-bundle.json":'{"changes":[{"fileName":"id_456_addField","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2023-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}},{"fileName":"id_123_addField","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"CUSTOMER","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"Max Mustermann"}}],"compVariants":[{"fileName":"id_111_compVariants","fileType":"variant","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"},"appDescriptorChange":false}],"variants":[{"fileName":"id_111_test","fileType":"ctrl_variant","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}],"variantChanges":[{"fileName":"id_111_test","fileType":"ctrl_variant_change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}],"variantDependentControlChanges":[{"fileName":"id_111_variantDependentControlChange","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"},"variantReference":"someting here"}],"variantManagementChanges":[{"fileName":"id_111_test","fileType":"ctrl_variant_management_change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}]}', "application/j/changes/fragments/MyFragment.fragment.xml":'', diff --git a/test/expected/build/application.j/dest-resources-json/Component.js b/test/expected/build/application.j/dest-resources-json/Component.js index 984f96eaf..f64b0734d 100644 --- a/test/expected/build/application.j/dest-resources-json/Component.js +++ b/test/expected/build/application.j/dest-resources-json/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.j/dest-resources-json/Component.js.map b/test/expected/build/application.j/dest-resources-json/Component.js.map new file mode 100644 index 000000000..97f5dc393 --- /dev/null +++ b/test/expected/build/application.j/dest-resources-json/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension-dbg.js b/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension-dbg.js new file mode 100644 index 000000000..dfb3da014 --- /dev/null +++ b/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension-dbg.js @@ -0,0 +1,3 @@ +sap.ui.define([],function () { + return {}; +}); diff --git a/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension.js b/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension.js index b9e475d8e..ce81ba310 100644 --- a/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension.js +++ b/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension.js @@ -1 +1,2 @@ -sap.ui.define([],function(){return{}}); \ No newline at end of file +sap.ui.define([],function(){return{}}); +//# sourceMappingURL=MyExtension.js.map \ No newline at end of file diff --git a/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension.js.map b/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension.js.map new file mode 100644 index 000000000..bff243492 --- /dev/null +++ b/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["MyExtension-dbg.js"],"names":["sap","ui","define"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAG,WAChB,MAAO","file":"MyExtension.js"} \ No newline at end of file diff --git a/test/expected/build/application.j/dest-resources-json/resources.json b/test/expected/build/application.j/dest-resources-json/resources.json index 93780b448..4aa4823f5 100644 --- a/test/expected/build/application.j/dest-resources-json/resources.json +++ b/test/expected/build/application.j/dest-resources-json/resources.json @@ -1,10 +1,23 @@ { "_version": "1.1.0", "resources": [ + { + "name": "Component-dbg.js", + "module": "application/j/Component.js", + "size": 184, + "isDebug": true, + "required": [ + "sap/m/library.js", + "sap/ui/core/UIComponent.js", + "sap/ui/core/library.js", + "sap/ui/fl/library.js", + "sap/ui/layout/library.js" + ] + }, { "name": "Component-preload.js", "module": "application/j/Component-preload.js", - "size": 3682, + "size": 3760, "merged": true, "required": [ "sap/m/library.js", @@ -24,7 +37,7 @@ { "name": "Component.js", "module": "application/j/Component.js", - "size": 141, + "size": 179, "required": [ "sap/m/library.js", "sap/ui/core/UIComponent.js", @@ -33,10 +46,26 @@ "sap/ui/layout/library.js" ] }, + { + "name": "Component.js.map", + "size": 253, + "isDebug": true + }, + { + "name": "changes/coding/MyExtension-dbg.js", + "module": "application/j/changes/coding/MyExtension.js", + "size": 47, + "isDebug": true + }, { "name": "changes/coding/MyExtension.js", "module": "application/j/changes/coding/MyExtension.js", - "size": 39 + "size": 79 + }, + { + "name": "changes/coding/MyExtension.js.map", + "size": 152, + "isDebug": true }, { "name": "changes/flexibility-bundle.json", @@ -91,7 +120,7 @@ }, { "name": "resources.json", - "size": 2098 + "size": 2704 } ] } \ No newline at end of file diff --git a/test/expected/build/application.j/dest/Component-dbg.js b/test/expected/build/application.j/dest/Component-dbg.js new file mode 100644 index 000000000..e40d21d9a --- /dev/null +++ b/test/expected/build/application.j/dest/Component-dbg.js @@ -0,0 +1,8 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.j.Component', { + metadata: { + manifest: "json" + } + }); +}); diff --git a/test/expected/build/application.j/dest/Component-preload.js b/test/expected/build/application.j/dest/Component-preload.js index 31e1ed1fe..b00969cfa 100644 --- a/test/expected/build/application.j/dest/Component-preload.js +++ b/test/expected/build/application.j/dest/Component-preload.js @@ -3,8 +3,10 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ "application/j/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map }, "application/j/changes/coding/MyExtension.js":function(){sap.ui.define([],function(){return{}}); +//# sourceMappingURL=MyExtension.js.map }, "application/j/changes/flexibility-bundle.json":'{"changes":[{"fileName":"id_456_addField","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2023-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}},{"fileName":"id_123_addField","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"CUSTOMER","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"Max Mustermann"}}],"compVariants":[{"fileName":"id_111_compVariants","fileType":"variant","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"},"appDescriptorChange":false}],"variants":[{"fileName":"id_111_test","fileType":"ctrl_variant","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}],"variantChanges":[{"fileName":"id_111_test","fileType":"ctrl_variant_change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}],"variantDependentControlChanges":[{"fileName":"id_111_variantDependentControlChange","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"},"variantReference":"someting here"}],"variantManagementChanges":[{"fileName":"id_111_test","fileType":"ctrl_variant_management_change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}]}', "application/j/changes/fragments/MyFragment.fragment.xml":'', diff --git a/test/expected/build/application.j/dest/Component.js b/test/expected/build/application.j/dest/Component.js index 984f96eaf..f64b0734d 100644 --- a/test/expected/build/application.j/dest/Component.js +++ b/test/expected/build/application.j/dest/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/application.j/dest/Component.js.map b/test/expected/build/application.j/dest/Component.js.map new file mode 100644 index 000000000..97f5dc393 --- /dev/null +++ b/test/expected/build/application.j/dest/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/application.j/dest/changes/coding/MyExtension-dbg.js b/test/expected/build/application.j/dest/changes/coding/MyExtension-dbg.js new file mode 100644 index 000000000..dfb3da014 --- /dev/null +++ b/test/expected/build/application.j/dest/changes/coding/MyExtension-dbg.js @@ -0,0 +1,3 @@ +sap.ui.define([],function () { + return {}; +}); diff --git a/test/expected/build/application.j/dest/changes/coding/MyExtension.js b/test/expected/build/application.j/dest/changes/coding/MyExtension.js index b9e475d8e..ce81ba310 100644 --- a/test/expected/build/application.j/dest/changes/coding/MyExtension.js +++ b/test/expected/build/application.j/dest/changes/coding/MyExtension.js @@ -1 +1,2 @@ -sap.ui.define([],function(){return{}}); \ No newline at end of file +sap.ui.define([],function(){return{}}); +//# sourceMappingURL=MyExtension.js.map \ No newline at end of file diff --git a/test/expected/build/application.j/dest/changes/coding/MyExtension.js.map b/test/expected/build/application.j/dest/changes/coding/MyExtension.js.map new file mode 100644 index 000000000..bff243492 --- /dev/null +++ b/test/expected/build/application.j/dest/changes/coding/MyExtension.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["MyExtension-dbg.js"],"names":["sap","ui","define"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAG,WAChB,MAAO","file":"MyExtension.js"} \ No newline at end of file diff --git a/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js b/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js index d7133abe9..ed8251c37 100644 --- a/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js +++ b/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js @@ -2,13 +2,34 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/k/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.k.Component",{metadata:{manifest:"json"}})}); + "application/k/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.k.Component', { + metadata: { + manifest: "json" + } + }); +}); }, "application/k/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k","type":"application","applicationVersion":{"version":"${version}"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"${copyright}"}', - "application/k/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.k.subcomponentA.Component",{metadata:{manifest:"json"}})}); + "application/k/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.k.subcomponentA.Component', { + metadata: { + manifest: "json" + } + }); +}); }, "application/k/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}', - "application/k/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.k.subcomponentB.Component",{metadata:{manifest:"json"}})}); + "application/k/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.k.subcomponentB.Component', { + metadata: { + manifest: "json" + } + }); +}); }, "application/k/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}', "application/k/subcomponentB/thirdparty/lib.js":function(){console.log("subcomponentB/thirdparty/lib.js"); diff --git a/test/expected/build/application.k/dest/Component-preload.js b/test/expected/build/application.k/dest/Component-preload.js index 67ee5854d..12b9506ec 100644 --- a/test/expected/build/application.k/dest/Component-preload.js +++ b/test/expected/build/application.k/dest/Component-preload.js @@ -2,7 +2,14 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/k/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.k.Component",{metadata:{manifest:"json"}})}); + "application/k/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.k.Component', { + metadata: { + manifest: "json" + } + }); +}); }, "application/k/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k","type":"application","applicationVersion":{"version":"${version}"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"${copyright}"}' }}); diff --git a/test/expected/build/application.k/dest/subcomponentA/Component-preload.js b/test/expected/build/application.k/dest/subcomponentA/Component-preload.js index 6ce44c11a..2e73aff3b 100644 --- a/test/expected/build/application.k/dest/subcomponentA/Component-preload.js +++ b/test/expected/build/application.k/dest/subcomponentA/Component-preload.js @@ -2,7 +2,14 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/k/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.k.subcomponentA.Component",{metadata:{manifest:"json"}})}); + "application/k/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.k.subcomponentA.Component', { + metadata: { + manifest: "json" + } + }); +}); }, "application/k/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' }}); diff --git a/test/expected/build/application.k/dest/subcomponentB/Component-preload.js b/test/expected/build/application.k/dest/subcomponentB/Component-preload.js index e1c8f43cb..24bf462a5 100644 --- a/test/expected/build/application.k/dest/subcomponentB/Component-preload.js +++ b/test/expected/build/application.k/dest/subcomponentB/Component-preload.js @@ -2,7 +2,14 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/k/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.k.subcomponentB.Component",{metadata:{manifest:"json"}})}); + "application/k/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.k.subcomponentB.Component', { + metadata: { + manifest: "json" + } + }); +}); }, "application/k/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}', "application/k/subcomponentB/thirdparty/lib.js":function(){console.log("subcomponentB/thirdparty/lib.js"); diff --git a/test/expected/build/application.l/dest/subdir/index.js b/test/expected/build/application.l/dest/subdir/index.js index 894e5374f..9661d7207 100644 --- a/test/expected/build/application.l/dest/subdir/index.js +++ b/test/expected/build/application.l/dest/subdir/index.js @@ -1 +1,2 @@ -function hello(l){console.log("hello "+l)}hello("world"); \ No newline at end of file +function hello(l){console.log("hello "+l)}hello("world"); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/test/expected/build/application.l/dest/subdir/index.js.map b/test/expected/build/application.l/dest/subdir/index.js.map new file mode 100644 index 000000000..9ebd8bf4e --- /dev/null +++ b/test/expected/build/application.l/dest/subdir/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index-dbg.js"],"names":["hello","name","console","log"],"mappings":"AACA,SAASA,MAAMC,GACdC,QAAQC,IAAI,SAAWF,GAExBD,MAAM","file":"index.js"} \ No newline at end of file diff --git a/test/expected/build/application.l/dest/subdir/thirdparty/File1.js b/test/expected/build/application.l/dest/subdir/thirdparty/File1.js index 894e5374f..7b3311e4e 100644 --- a/test/expected/build/application.l/dest/subdir/thirdparty/File1.js +++ b/test/expected/build/application.l/dest/subdir/thirdparty/File1.js @@ -1 +1,2 @@ -function hello(l){console.log("hello "+l)}hello("world"); \ No newline at end of file +function hello(l){console.log("hello "+l)}hello("world"); +//# sourceMappingURL=File1.js.map \ No newline at end of file diff --git a/test/expected/build/application.l/dest/subdir/thirdparty/File1.js.map b/test/expected/build/application.l/dest/subdir/thirdparty/File1.js.map new file mode 100644 index 000000000..1c04d432d --- /dev/null +++ b/test/expected/build/application.l/dest/subdir/thirdparty/File1.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["File1-dbg.js"],"names":["hello","name","console","log"],"mappings":"AACA,SAASA,MAAMC,GACdC,QAAQC,IAAI,SAAWF,GAExBD,MAAM","file":"File1.js"} \ No newline at end of file diff --git a/test/expected/build/application.l/dest/test.js b/test/expected/build/application.l/dest/test.js index 49687cdc2..5a6672e9f 100644 --- a/test/expected/build/application.l/dest/test.js +++ b/test/expected/build/application.l/dest/test.js @@ -1 +1,2 @@ -sap.ui.define([],function(){function n(n){var o=n;console.log(o)}n()}); \ No newline at end of file +sap.ui.define([],function(){function n(n){var o=n;console.log(o)}n()}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/test/expected/build/application.l/dest/test.js.map b/test/expected/build/application.l/dest/test.js.map new file mode 100644 index 000000000..99a31b097 --- /dev/null +++ b/test/expected/build/application.l/dest/test.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["test-dbg.js"],"names":["sap","ui","define","test","paramA","variableA","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAI,WACjB,SAASC,EAAKC,GACb,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test.js"} \ No newline at end of file diff --git "a/test/expected/build/application.\303\270/dest/Component-preload.js" "b/test/expected/build/application.\303\270/dest/Component-preload.js" index cb92a7eef..7b95d4e8a 100644 --- "a/test/expected/build/application.\303\270/dest/Component-preload.js" +++ "b/test/expected/build/application.\303\270/dest/Component-preload.js" @@ -1,6 +1,7 @@ //@ui5-bundle application/ø/Component-preload.js sap.ui.require.preload({ "application/ø/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.ø.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map }, "application/ø/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.ø","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"},"sap.ui5":{"dependencies":{"minUI5Version":"1.73.2","libs":{"sap.ui.core":{}}}}}' }); diff --git "a/test/expected/build/application.\303\270/dest/Component.js" "b/test/expected/build/application.\303\270/dest/Component.js" index cc3bdb695..8c43e4752 100644 --- "a/test/expected/build/application.\303\270/dest/Component.js" +++ "b/test/expected/build/application.\303\270/dest/Component.js" @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.ø.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.ø.Component",{metadata:{manifest:"json"}})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git "a/test/expected/build/application.\303\270/dest/Component.js.map" "b/test/expected/build/application.\303\270/dest/Component.js.map" new file mode 100644 index 000000000..97f5dc393 --- /dev/null +++ "b/test/expected/build/application.\303\270/dest/Component.js.map" @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/build/fileWithoutExtension b/test/expected/build/build/fileWithoutExtension new file mode 100644 index 000000000..1a39ca7a7 --- /dev/null +++ b/test/expected/build/build/fileWithoutExtension @@ -0,0 +1 @@ +A file without an extension \ No newline at end of file diff --git a/test/expected/build/build/index.html b/test/expected/build/build/index.html new file mode 100644 index 000000000..1523b1dc3 --- /dev/null +++ b/test/expected/build/build/index.html @@ -0,0 +1,11 @@ + + + + Application A + + + + + + \ No newline at end of file diff --git a/test/expected/build/build/test.js b/test/expected/build/build/test.js new file mode 100644 index 000000000..cb4595405 --- /dev/null +++ b/test/expected/build/build/test.js @@ -0,0 +1,9 @@ +sap.ui.define([ + "library/d/some" +], function(someObject) { + function test(paramA) { + var variableA = paramA; + console.log(variableA); + } + test(); +}); diff --git a/test/expected/build/cleanup/fileWithoutExtension b/test/expected/build/cleanup/fileWithoutExtension new file mode 100644 index 000000000..1a39ca7a7 --- /dev/null +++ b/test/expected/build/cleanup/fileWithoutExtension @@ -0,0 +1 @@ +A file without an extension \ No newline at end of file diff --git a/test/expected/build/cleanup/index.html b/test/expected/build/cleanup/index.html new file mode 100644 index 000000000..1523b1dc3 --- /dev/null +++ b/test/expected/build/cleanup/index.html @@ -0,0 +1,11 @@ + + + + Application A + + + + + + \ No newline at end of file diff --git a/test/expected/build/cleanup/test.js b/test/expected/build/cleanup/test.js new file mode 100644 index 000000000..cb4595405 --- /dev/null +++ b/test/expected/build/cleanup/test.js @@ -0,0 +1,9 @@ +sap.ui.define([ + "library/d/some" +], function(someObject) { + function test(paramA) { + var variableA = paramA; + console.log(variableA); + } + test(); +}); diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core-dbg.js b/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core-dbg.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core.js b/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core.js new file mode 100644 index 000000000..a72d46525 --- /dev/null +++ b/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core.js @@ -0,0 +1,2 @@ + +//# sourceMappingURL=sap-ui-core.js.map \ No newline at end of file diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core.js.map b/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core.js.map new file mode 100644 index 000000000..e347f93df --- /dev/null +++ b/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"sap-ui-core.js"} \ No newline at end of file diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global-dbg.js b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global-dbg.js new file mode 100644 index 000000000..8a2077bdb --- /dev/null +++ b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global-dbg.js @@ -0,0 +1,5 @@ +/*! + * Some fancy copyright + */ +// replacement of $\{buildtime\} is only made in sap/ui/Global.js and Global-dbg.js +console.log('20220620-1630'); diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global.js b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global.js new file mode 100644 index 000000000..e0fe65e6f --- /dev/null +++ b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global.js @@ -0,0 +1,5 @@ +/*! + * Some fancy copyright + */ +console.log("20220620-1630"); +//# sourceMappingURL=Global.js.map \ No newline at end of file diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global.js.map b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global.js.map new file mode 100644 index 000000000..694230468 --- /dev/null +++ b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Global-dbg.js"],"names":["console","log"],"mappings":";;;AAIAA,QAAQC,IAAI","file":"Global.js"} \ No newline at end of file diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/.library b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/.library new file mode 100644 index 000000000..f975d6a4e --- /dev/null +++ b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/.library @@ -0,0 +1,20 @@ + + + + sap.ui.core + SAP SE + Some fancy copyright + 1.0.0 + + Core + + + + + + + + + + diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core-dbg.js b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core-dbg.js new file mode 100644 index 000000000..124b349b7 --- /dev/null +++ b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core-dbg.js @@ -0,0 +1,5 @@ +/*! + * Some fancy copyright + */ +// replacement of $\{buildtime\} is only made in sap/ui/Global.js and Global-dbg.js +console.log('${buildtime}'); diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core.js b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core.js new file mode 100644 index 000000000..e625a5c05 --- /dev/null +++ b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core.js @@ -0,0 +1,5 @@ +/*! + * Some fancy copyright + */ +console.log("${buildtime}"); +//# sourceMappingURL=Core.js.map \ No newline at end of file diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core.js.map b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core.js.map new file mode 100644 index 000000000..75511857a --- /dev/null +++ b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Core-dbg.js"],"names":["console","log"],"mappings":";;;AAIAA,QAAQC,IAAI","file":"Core.js"} \ No newline at end of file diff --git a/test/expected/build/library.d/dest/resources/library/d/some.js b/test/expected/build/library.d/dest/resources/library/d/some.js index c23f5f207..75aba1e23 100644 --- a/test/expected/build/library.d/dest/resources/library/d/some.js +++ b/test/expected/build/library.d/dest/resources/library/d/some.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -(function(){var o="World";console.log("Hello "+o)})(); \ No newline at end of file +(function(){var o="World";console.log("Hello "+o)})(); +//# sourceMappingURL=some.js.map \ No newline at end of file diff --git a/test/expected/build/library.d/dest/resources/library/d/some.js.map b/test/expected/build/library.d/dest/resources/library/d/some.js.map new file mode 100644 index 000000000..bc2b57a0a --- /dev/null +++ b/test/expected/build/library.d/dest/resources/library/d/some.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["some-dbg.js"],"names":["someNonUglifiedVariable","console","log"],"mappings":";;;CAGA,WACC,IAAIA,EAA0B,QAC9BC,QAAQC,IAAI,SAAWF,IAFxB","file":"some.js"} \ No newline at end of file diff --git a/test/expected/build/library.d/preload/resources/library/d/library-preload.js b/test/expected/build/library.d/preload/resources/library/d/library-preload.js index 3a8e66b86..68c443e80 100644 --- a/test/expected/build/library.d/preload/resources/library/d/library-preload.js +++ b/test/expected/build/library.d/preload/resources/library/d/library-preload.js @@ -5,6 +5,9 @@ jQuery.sap.registerPreloadedModules({ "library/d/some.js":function(){/*! * ${copyright} */ -(function(){var o="World";console.log("Hello "+o)})(); +(function() { + var someNonUglifiedVariable = "World"; + console.log('Hello ' + someNonUglifiedVariable); +})(); } }}); diff --git a/test/expected/build/library.e/dest/resources/library/e/library.js b/test/expected/build/library.e/dest/resources/library/e/library.js index 39e3277ce..648540278 100644 --- a/test/expected/build/library.e/dest/resources/library/e/library.js +++ b/test/expected/build/library.e/dest/resources/library/e/library.js @@ -3,4 +3,5 @@ * (c) Copyright 2009-xxx SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ -console.log("HelloWorld"); \ No newline at end of file +console.log("HelloWorld"); +//# sourceMappingURL=library.js.map \ No newline at end of file diff --git a/test/expected/build/library.e/dest/resources/library/e/library.js.map b/test/expected/build/library.e/dest/resources/library/e/library.js.map new file mode 100644 index 000000000..bd84007b6 --- /dev/null +++ b/test/expected/build/library.e/dest/resources/library/e/library.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["library-dbg.js"],"names":["console","log"],"mappings":";;;;;AAKAA,QAAQC,IAAI","file":"library.js"} \ No newline at end of file diff --git a/test/expected/build/library.e/dest/resources/library/e/some.js b/test/expected/build/library.e/dest/resources/library/e/some.js index 39e3277ce..36245f900 100644 --- a/test/expected/build/library.e/dest/resources/library/e/some.js +++ b/test/expected/build/library.e/dest/resources/library/e/some.js @@ -3,4 +3,5 @@ * (c) Copyright 2009-xxx SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ -console.log("HelloWorld"); \ No newline at end of file +console.log("HelloWorld"); +//# sourceMappingURL=some.js.map \ No newline at end of file diff --git a/test/expected/build/library.e/dest/resources/library/e/some.js.map b/test/expected/build/library.e/dest/resources/library/e/some.js.map new file mode 100644 index 000000000..bad3019d4 --- /dev/null +++ b/test/expected/build/library.e/dest/resources/library/e/some.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["some-dbg.js"],"names":["console","log"],"mappings":";;;;;AAKAA,QAAQC,IAAI","file":"some.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-dbg.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-dbg.js new file mode 100644 index 000000000..998e27dce --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-dbg.js @@ -0,0 +1,5 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-preload.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-preload.js index f66daec7d..58530f541 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-preload.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-preload.js @@ -1,10 +1,12 @@ //@ui5-bundle library/h/components/Component-preload.js 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",{})}); +//# sourceMappingURL=Component.js.map }, "library/h/components/TodoComponent.js":function(){/*! * Some fancy copyright */ console.log(" File "); +//# sourceMappingURL=TodoComponent.js.map } }); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component.js index 422a97071..04d854984 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component.js.map new file mode 100644 index 000000000..96488949b --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent-dbg.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent-dbg.js new file mode 100644 index 000000000..ab9d806f6 --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent-dbg.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +console.log(' File '); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent.js index bcf866e67..f58e632b3 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -console.log(" File "); \ No newline at end of file +console.log(" File "); +//# sourceMappingURL=TodoComponent.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent.js.map new file mode 100644 index 000000000..178f39969 --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["TodoComponent-dbg.js"],"names":["console","log"],"mappings":";;;AAGAA,QAAQC,IAAI","file":"TodoComponent.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/resources.json b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/resources.json index ab073db99..bdea7f3d7 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/resources.json +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/resources.json @@ -1,10 +1,19 @@ { "_version": "1.1.0", "resources": [ + { + "name": "Component-dbg.js", + "module": "library/h/components/Component.js", + "size": 146, + "isDebug": true, + "required": [ + "sap/ui/core/UIComponent.js" + ] + }, { "name": "Component-preload.js", "module": "library/h/components/Component-preload.js", - "size": 361, + "size": 441, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -17,25 +26,51 @@ { "name": "Component.js", "module": "library/h/components/Component.js", - "size": 115, + "size": 153, "required": [ "sap/ui/core/UIComponent.js" ] }, + { + "name": "Component.js.map", + "size": 208, + "isDebug": true + }, + { + "name": "TodoComponent-dbg.js", + "module": "library/h/components/TodoComponent.js", + "size": 55, + "format": "raw", + "isDebug": true + }, { "name": "TodoComponent.js", "module": "library/h/components/TodoComponent.js", - "size": 54, + "size": 96, "format": "raw" }, + { + "name": "TodoComponent.js.map", + "size": 133, + "isDebug": true + }, { "name": "resources.json", - "size": 2128 + "size": 3509 + }, + { + "name": "subcomponent1/Component-dbg.js", + "module": "library/h/components/subcomponent1/Component.js", + "size": 146, + "isDebug": true, + "required": [ + "sap/ui/core/UIComponent.js" + ] }, { "name": "subcomponent1/Component-preload.js", "module": "library/h/components/subcomponent1/Component-preload.js", - "size": 279, + "size": 317, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -47,7 +82,21 @@ { "name": "subcomponent1/Component.js", "module": "library/h/components/subcomponent1/Component.js", - "size": 115, + "size": 153, + "required": [ + "sap/ui/core/UIComponent.js" + ] + }, + { + "name": "subcomponent1/Component.js.map", + "size": 208, + "isDebug": true + }, + { + "name": "subcomponent2/Component-dbg.js", + "module": "library/h/components/subcomponent2/Component.js", + "size": 146, + "isDebug": true, "required": [ "sap/ui/core/UIComponent.js" ] @@ -55,7 +104,7 @@ { "name": "subcomponent2/Component-preload.js", "module": "library/h/components/subcomponent2/Component-preload.js", - "size": 279, + "size": 317, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -67,7 +116,21 @@ { "name": "subcomponent2/Component.js", "module": "library/h/components/subcomponent2/Component.js", - "size": 115, + "size": 153, + "required": [ + "sap/ui/core/UIComponent.js" + ] + }, + { + "name": "subcomponent2/Component.js.map", + "size": 208, + "isDebug": true + }, + { + "name": "subcomponent3/Component-dbg.js", + "module": "library/h/components/subcomponent3/Component.js", + "size": 146, + "isDebug": true, "required": [ "sap/ui/core/UIComponent.js" ] @@ -75,7 +138,7 @@ { "name": "subcomponent3/Component-preload.js", "module": "library/h/components/subcomponent3/Component-preload.js", - "size": 279, + "size": 317, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -87,10 +150,15 @@ { "name": "subcomponent3/Component.js", "module": "library/h/components/subcomponent3/Component.js", - "size": 115, + "size": 153, "required": [ "sap/ui/core/UIComponent.js" ] + }, + { + "name": "subcomponent3/Component.js.map", + "size": 208, + "isDebug": true } ] } \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-dbg.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-dbg.js new file mode 100644 index 000000000..998e27dce --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-dbg.js @@ -0,0 +1,5 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-preload.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-preload.js index d2309dcdf..464e003a7 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-preload.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-preload.js @@ -1,5 +1,6 @@ //@ui5-bundle library/h/components/subcomponent1/Component-preload.js sap.ui.require.preload({ "library/h/components/subcomponent1/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map } }); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component.js index 422a97071..04d854984 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component.js.map new file mode 100644 index 000000000..96488949b --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/resources.json b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/resources.json index 7ca30f3d7..e610cb752 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/resources.json +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/resources.json @@ -1,10 +1,19 @@ { "_version": "1.1.0", "resources": [ + { + "name": "Component-dbg.js", + "module": "library/h/components/subcomponent1/Component.js", + "size": 146, + "isDebug": true, + "required": [ + "sap/ui/core/UIComponent.js" + ] + }, { "name": "Component-preload.js", "module": "library/h/components/subcomponent1/Component-preload.js", - "size": 279, + "size": 317, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -16,14 +25,19 @@ { "name": "Component.js", "module": "library/h/components/subcomponent1/Component.js", - "size": 115, + "size": 153, "required": [ "sap/ui/core/UIComponent.js" ] }, + { + "name": "Component.js.map", + "size": 208, + "isDebug": true + }, { "name": "resources.json", - "size": 550 + "size": 820 } ] } \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-dbg.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-dbg.js new file mode 100644 index 000000000..998e27dce --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-dbg.js @@ -0,0 +1,5 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-preload.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-preload.js index ce88226b9..ef751b6d7 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-preload.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-preload.js @@ -1,5 +1,6 @@ //@ui5-bundle library/h/components/subcomponent2/Component-preload.js sap.ui.require.preload({ "library/h/components/subcomponent2/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map } }); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component.js index 422a97071..04d854984 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component.js.map new file mode 100644 index 000000000..96488949b --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/resources.json b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/resources.json index 7037628ac..3a981a492 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/resources.json +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/resources.json @@ -1,10 +1,19 @@ { "_version": "1.1.0", "resources": [ + { + "name": "Component-dbg.js", + "module": "library/h/components/subcomponent2/Component.js", + "size": 146, + "isDebug": true, + "required": [ + "sap/ui/core/UIComponent.js" + ] + }, { "name": "Component-preload.js", "module": "library/h/components/subcomponent2/Component-preload.js", - "size": 279, + "size": 317, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -16,14 +25,19 @@ { "name": "Component.js", "module": "library/h/components/subcomponent2/Component.js", - "size": 115, + "size": 153, "required": [ "sap/ui/core/UIComponent.js" ] }, + { + "name": "Component.js.map", + "size": 208, + "isDebug": true + }, { "name": "resources.json", - "size": 550 + "size": 820 } ] } \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-dbg.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-dbg.js new file mode 100644 index 000000000..998e27dce --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-dbg.js @@ -0,0 +1,5 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-preload.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-preload.js index 4b88fc476..55db04d3d 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-preload.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-preload.js @@ -1,5 +1,6 @@ //@ui5-bundle library/h/components/subcomponent3/Component-preload.js sap.ui.require.preload({ "library/h/components/subcomponent3/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map } }); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component.js index 422a97071..04d854984 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component.js.map new file mode 100644 index 000000000..96488949b --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/resources.json b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/resources.json index 92de203ca..bcf8ccf95 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/resources.json +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/resources.json @@ -1,10 +1,19 @@ { "_version": "1.1.0", "resources": [ + { + "name": "Component-dbg.js", + "module": "library/h/components/subcomponent3/Component.js", + "size": 146, + "isDebug": true, + "required": [ + "sap/ui/core/UIComponent.js" + ] + }, { "name": "Component-preload.js", "module": "library/h/components/subcomponent3/Component-preload.js", - "size": 279, + "size": 317, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -16,14 +25,19 @@ { "name": "Component.js", "module": "library/h/components/subcomponent3/Component.js", - "size": 115, + "size": 153, "required": [ "sap/ui/core/UIComponent.js" ] }, + { + "name": "Component.js.map", + "size": 208, + "isDebug": true + }, { "name": "resources.json", - "size": 550 + "size": 820 } ] } \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle-dbg.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle-dbg.js new file mode 100644 index 000000000..1746a7a97 --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle-dbg.js @@ -0,0 +1,24 @@ +//@ui5-bundle library/h/customBundle-dbg.js +sap.ui.require.preload({ + "library/h/file.js":function(){/*! + * Some fancy copyright + */ +console.log(' File '); +}, + "library/h/library.js":function(){/*! + * Some fancy copyright + */ +console.log(' Library '); +}, + "library/h/some.js":function(){/*! + * Some fancy copyright + */ +//@ui5-bundle-raw-include library/h/other.js +console.log(' Some '); +} +}); +//@ui5-bundle-raw-include library/h/not.js +/*! + * Some fancy copyright + */ +console.log(' Not including '); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle.js index e9e0e00ed..40bf0e991 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle.js @@ -4,21 +4,25 @@ sap.ui.require.preload({ * Some fancy copyright */ console.log(" File "); +//# sourceMappingURL=file.js.map }, "library/h/library.js":function(){/*! * Some fancy copyright */ console.log(" Library "); +//# sourceMappingURL=library.js.map }, "library/h/some.js":function(){/*! * Some fancy copyright */ //@ui5-bundle-raw-include library/h/other.js console.log(" Some "); +//# sourceMappingURL=some.js.map } }); //@ui5-bundle-raw-include library/h/not.js /*! * Some fancy copyright */ -console.log(" Not including "); \ No newline at end of file +console.log(" Not including "); +//# sourceMappingURL=not.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library-dbg.designtime.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library-dbg.designtime.js new file mode 100644 index 000000000..34069d6ac --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library-dbg.designtime.js @@ -0,0 +1,14 @@ +/*! + * Some fancy copyright + */ + +/** + * designtime and global export + */ +var myexport = (function() { + + "use strict"; + + String("asd"); + +}()); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library.designtime.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library.designtime.js index 9b135171d..530ba01e1 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library.designtime.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library.designtime.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -var myexport=function(){"use strict";String("asd")}(); \ No newline at end of file +var myexport=function(){"use strict";String("asd")}(); +//# sourceMappingURL=library.designtime.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library.designtime.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library.designtime.js.map new file mode 100644 index 000000000..eed1a2f12 --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library.designtime.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["library-dbg.designtime.js"],"names":["myexport","String"],"mappings":";;;AAOA,IAAIA,SAAY,WAEf,aAEAC,OAAO,OAJO","file":"library.designtime.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/file-dbg.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/file-dbg.js new file mode 100644 index 000000000..ab9d806f6 --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/file-dbg.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +console.log(' File '); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/file.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/file.js index bcf866e67..2fe4c2aae 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/file.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/file.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -console.log(" File "); \ No newline at end of file +console.log(" File "); +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/file.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/file.js.map new file mode 100644 index 000000000..0e96bde9b --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/file.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["file-dbg.js"],"names":["console","log"],"mappings":";;;AAGAA,QAAQC,IAAI","file":"file.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/library-dbg.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/library-dbg.js new file mode 100644 index 000000000..c9d3cbc0c --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/library-dbg.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +console.log(' Library '); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/library.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/library.js index 6900e2218..ce760e5cb 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/library.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/library.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -console.log(" Library "); \ No newline at end of file +console.log(" Library "); +//# sourceMappingURL=library.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/library.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/library.js.map new file mode 100644 index 000000000..fc4ea2654 --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/library.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["library-dbg.js"],"names":["console","log"],"mappings":";;;AAGAA,QAAQC,IAAI","file":"library.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/not-dbg.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/not-dbg.js new file mode 100644 index 000000000..d61495954 --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/not-dbg.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +console.log(' Not including '); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/not.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/not.js index c249a10c8..75a862b14 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/not.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/not.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -console.log(" Not including "); \ No newline at end of file +console.log(" Not including "); +//# sourceMappingURL=not.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/not.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/not.js.map new file mode 100644 index 000000000..d696f9d1e --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/not.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["not-dbg.js"],"names":["console","log"],"mappings":";;;AAGAA,QAAQC,IAAI","file":"not.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/resources.json b/test/expected/build/library.h/dest-resources-json/resources/library/h/resources.json index bf55e5d3c..b7eff7d8b 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/resources.json +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/resources.json @@ -5,10 +5,19 @@ "name": ".library", "size": 473 }, + { + "name": "components/Component-dbg.js", + "module": "library/h/components/Component.js", + "size": 146, + "isDebug": true, + "required": [ + "sap/ui/core/UIComponent.js" + ] + }, { "name": "components/Component-preload.js", "module": "library/h/components/Component-preload.js", - "size": 361, + "size": 441, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -21,21 +30,47 @@ { "name": "components/Component.js", "module": "library/h/components/Component.js", - "size": 115, + "size": 153, "required": [ "sap/ui/core/UIComponent.js" ] }, + { + "name": "components/Component.js.map", + "size": 208, + "isDebug": true + }, + { + "name": "components/TodoComponent-dbg.js", + "module": "library/h/components/TodoComponent.js", + "size": 55, + "format": "raw", + "isDebug": true + }, { "name": "components/TodoComponent.js", "module": "library/h/components/TodoComponent.js", - "size": 54, + "size": 96, "format": "raw" }, + { + "name": "components/TodoComponent.js.map", + "size": 133, + "isDebug": true + }, + { + "name": "components/subcomponent1/Component-dbg.js", + "module": "library/h/components/subcomponent1/Component.js", + "size": 146, + "isDebug": true, + "required": [ + "sap/ui/core/UIComponent.js" + ] + }, { "name": "components/subcomponent1/Component-preload.js", "module": "library/h/components/subcomponent1/Component-preload.js", - "size": 279, + "size": 317, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -47,7 +82,21 @@ { "name": "components/subcomponent1/Component.js", "module": "library/h/components/subcomponent1/Component.js", - "size": 115, + "size": 153, + "required": [ + "sap/ui/core/UIComponent.js" + ] + }, + { + "name": "components/subcomponent1/Component.js.map", + "size": 208, + "isDebug": true + }, + { + "name": "components/subcomponent2/Component-dbg.js", + "module": "library/h/components/subcomponent2/Component.js", + "size": 146, + "isDebug": true, "required": [ "sap/ui/core/UIComponent.js" ] @@ -55,7 +104,7 @@ { "name": "components/subcomponent2/Component-preload.js", "module": "library/h/components/subcomponent2/Component-preload.js", - "size": 279, + "size": 317, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -67,7 +116,21 @@ { "name": "components/subcomponent2/Component.js", "module": "library/h/components/subcomponent2/Component.js", - "size": 115, + "size": 153, + "required": [ + "sap/ui/core/UIComponent.js" + ] + }, + { + "name": "components/subcomponent2/Component.js.map", + "size": 208, + "isDebug": true + }, + { + "name": "components/subcomponent3/Component-dbg.js", + "module": "library/h/components/subcomponent3/Component.js", + "size": 146, + "isDebug": true, "required": [ "sap/ui/core/UIComponent.js" ] @@ -75,7 +138,7 @@ { "name": "components/subcomponent3/Component-preload.js", "module": "library/h/components/subcomponent3/Component-preload.js", - "size": 279, + "size": 317, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -87,15 +150,34 @@ { "name": "components/subcomponent3/Component.js", "module": "library/h/components/subcomponent3/Component.js", - "size": 115, + "size": 153, "required": [ "sap/ui/core/UIComponent.js" ] }, + { + "name": "components/subcomponent3/Component.js.map", + "size": 208, + "isDebug": true + }, + { + "name": "customBundle-dbg.js", + "module": "library/h/customBundle.js", + "size": 500, + "isDebug": true, + "merged": true, + "included": [ + "library/h/file.js", + "library/h/library.js", + "library/h/some.js", + "library/h/other.js", + "library/h/not.js" + ] + }, { "name": "customBundle.js", "module": "library/h/customBundle.js", - "size": 495, + "size": 629, "merged": true, "included": [ "library/h/file.js", @@ -105,10 +187,22 @@ "library/h/not.js" ] }, + { + "name": "designtime/library-dbg.designtime.js", + "module": "library/h/designtime/library.designtime.js", + "size": 142, + "requiresTopLevelScope": true, + "exposedGlobalNames": [ + "myexport" + ], + "format": "raw", + "isDebug": true, + "designtime": true + }, { "name": "designtime/library.designtime.js", "module": "library/h/designtime/library.designtime.js", - "size": 86, + "size": 133, "requiresTopLevelScope": true, "exposedGlobalNames": [ "myexport" @@ -116,12 +210,30 @@ "format": "raw", "designtime": true }, + { + "name": "designtime/library.designtime.js.map", + "size": 167, + "isDebug": true, + "designtime": true + }, + { + "name": "file-dbg.js", + "module": "library/h/file.js", + "size": 55, + "format": "raw", + "isDebug": true + }, { "name": "file.js", "module": "library/h/file.js", - "size": 54, + "size": 87, "format": "raw" }, + { + "name": "file.js.map", + "size": 115, + "isDebug": true + }, { "name": "i18n/messagebundle.properties", "module": "library/h/i18n/messagebundle.properties", @@ -136,36 +248,76 @@ "locale": "en", "raw": "i18n/messagebundle.properties" }, + { + "name": "library-dbg.js", + "module": "library/h/library.js", + "size": 58, + "format": "raw", + "isDebug": true + }, { "name": "library.js", "module": "library/h/library.js", - "size": 57, + "size": 93, "format": "raw" }, + { + "name": "library.js.map", + "size": 121, + "isDebug": true + }, { "name": "manifest.json", "module": "library/h/manifest.json", "size": 614 }, + { + "name": "not-dbg.js", + "module": "library/h/not.js", + "size": 64, + "format": "raw", + "isDebug": true + }, { "name": "not.js", "module": "library/h/not.js", - "size": 63, + "size": 95, "format": "raw" }, + { + "name": "not.js.map", + "size": 113, + "isDebug": true + }, { "name": "resources.json", - "size": 3724 + "size": 6749 + }, + { + "name": "some-dbg.js", + "module": "library/h/some.js", + "size": 100, + "format": "raw", + "isDebug": true, + "merged": true, + "included": [ + "library/h/other.js" + ] }, { "name": "some.js", "module": "library/h/some.js", - "size": 99, + "size": 132, "format": "raw", "merged": true, "included": [ "library/h/other.js" ] + }, + { + "name": "some.js.map", + "size": 116, + "isDebug": true } ] } \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/some-dbg.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/some-dbg.js new file mode 100644 index 000000000..e03abda4d --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/some-dbg.js @@ -0,0 +1,5 @@ +/*! + * Some fancy copyright + */ +//@ui5-bundle-raw-include library/h/other.js +console.log(' Some '); diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/some.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/some.js index 1e86f9afc..0c5f5d3e3 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/some.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/some.js @@ -2,4 +2,5 @@ * Some fancy copyright */ //@ui5-bundle-raw-include library/h/other.js -console.log(" Some "); \ No newline at end of file +console.log(" Some "); +//# sourceMappingURL=some.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/some.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/some.js.map new file mode 100644 index 000000000..d62492183 --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/some.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["some-dbg.js"],"names":["console","log"],"mappings":";;;;AAIAA,QAAQC,IAAI","file":"some.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/Component-dbg.js b/test/expected/build/library.h/dest/resources/library/h/components/Component-dbg.js new file mode 100644 index 000000000..998e27dce --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/Component-dbg.js @@ -0,0 +1,5 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); 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 f66daec7d..58530f541 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,10 +1,12 @@ //@ui5-bundle library/h/components/Component-preload.js 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",{})}); +//# sourceMappingURL=Component.js.map }, "library/h/components/TodoComponent.js":function(){/*! * Some fancy copyright */ console.log(" File "); +//# sourceMappingURL=TodoComponent.js.map } }); diff --git a/test/expected/build/library.h/dest/resources/library/h/components/Component.js b/test/expected/build/library.h/dest/resources/library/h/components/Component.js index 422a97071..04d854984 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/Component.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/Component.js.map b/test/expected/build/library.h/dest/resources/library/h/components/Component.js.map new file mode 100644 index 000000000..96488949b --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent-dbg.js b/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent-dbg.js new file mode 100644 index 000000000..ab9d806f6 --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent-dbg.js @@ -0,0 +1,4 @@ +/*! + * 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 index bcf866e67..f58e632b3 100644 --- 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 @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -console.log(" File "); \ No newline at end of file +console.log(" File "); +//# sourceMappingURL=TodoComponent.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent.js.map b/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent.js.map new file mode 100644 index 000000000..178f39969 --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["TodoComponent-dbg.js"],"names":["console","log"],"mappings":";;;AAGAA,QAAQC,IAAI","file":"TodoComponent.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-dbg.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-dbg.js new file mode 100644 index 000000000..998e27dce --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-dbg.js @@ -0,0 +1,5 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-preload.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-preload.js index d2309dcdf..464e003a7 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-preload.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-preload.js @@ -1,5 +1,6 @@ //@ui5-bundle library/h/components/subcomponent1/Component-preload.js sap.ui.require.preload({ "library/h/components/subcomponent1/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map } }); diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component.js index 422a97071..04d854984 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component.js.map b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component.js.map new file mode 100644 index 000000000..96488949b --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-dbg.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-dbg.js new file mode 100644 index 000000000..998e27dce --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-dbg.js @@ -0,0 +1,5 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-preload.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-preload.js index ce88226b9..ef751b6d7 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-preload.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-preload.js @@ -1,5 +1,6 @@ //@ui5-bundle library/h/components/subcomponent2/Component-preload.js sap.ui.require.preload({ "library/h/components/subcomponent2/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map } }); diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component.js index 422a97071..04d854984 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component.js.map b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component.js.map new file mode 100644 index 000000000..96488949b --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-dbg.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-dbg.js new file mode 100644 index 000000000..998e27dce --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-dbg.js @@ -0,0 +1,5 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-preload.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-preload.js index 4b88fc476..55db04d3d 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-preload.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-preload.js @@ -1,5 +1,6 @@ //@ui5-bundle library/h/components/subcomponent3/Component-preload.js sap.ui.require.preload({ "library/h/components/subcomponent3/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map } }); diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component.js index 422a97071..04d854984 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component.js @@ -1 +1,2 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); +//# sourceMappingURL=Component.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component.js.map b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component.js.map new file mode 100644 index 000000000..96488949b --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/customBundle-dbg.js b/test/expected/build/library.h/dest/resources/library/h/customBundle-dbg.js new file mode 100644 index 000000000..1746a7a97 --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/customBundle-dbg.js @@ -0,0 +1,24 @@ +//@ui5-bundle library/h/customBundle-dbg.js +sap.ui.require.preload({ + "library/h/file.js":function(){/*! + * Some fancy copyright + */ +console.log(' File '); +}, + "library/h/library.js":function(){/*! + * Some fancy copyright + */ +console.log(' Library '); +}, + "library/h/some.js":function(){/*! + * Some fancy copyright + */ +//@ui5-bundle-raw-include library/h/other.js +console.log(' Some '); +} +}); +//@ui5-bundle-raw-include library/h/not.js +/*! + * Some fancy copyright + */ +console.log(' Not including '); diff --git a/test/expected/build/library.h/dest/resources/library/h/customBundle.js b/test/expected/build/library.h/dest/resources/library/h/customBundle.js index e9e0e00ed..40bf0e991 100644 --- a/test/expected/build/library.h/dest/resources/library/h/customBundle.js +++ b/test/expected/build/library.h/dest/resources/library/h/customBundle.js @@ -4,21 +4,25 @@ sap.ui.require.preload({ * Some fancy copyright */ console.log(" File "); +//# sourceMappingURL=file.js.map }, "library/h/library.js":function(){/*! * Some fancy copyright */ console.log(" Library "); +//# sourceMappingURL=library.js.map }, "library/h/some.js":function(){/*! * Some fancy copyright */ //@ui5-bundle-raw-include library/h/other.js console.log(" Some "); +//# sourceMappingURL=some.js.map } }); //@ui5-bundle-raw-include library/h/not.js /*! * Some fancy copyright */ -console.log(" Not including "); \ No newline at end of file +console.log(" Not including "); +//# sourceMappingURL=not.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/designtime/library-dbg.designtime.js b/test/expected/build/library.h/dest/resources/library/h/designtime/library-dbg.designtime.js new file mode 100644 index 000000000..34069d6ac --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/designtime/library-dbg.designtime.js @@ -0,0 +1,14 @@ +/*! + * Some fancy copyright + */ + +/** + * designtime and global export + */ +var myexport = (function() { + + "use strict"; + + String("asd"); + +}()); diff --git a/test/expected/build/library.h/dest/resources/library/h/designtime/library.designtime.js b/test/expected/build/library.h/dest/resources/library/h/designtime/library.designtime.js index 9b135171d..530ba01e1 100644 --- a/test/expected/build/library.h/dest/resources/library/h/designtime/library.designtime.js +++ b/test/expected/build/library.h/dest/resources/library/h/designtime/library.designtime.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -var myexport=function(){"use strict";String("asd")}(); \ No newline at end of file +var myexport=function(){"use strict";String("asd")}(); +//# sourceMappingURL=library.designtime.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/designtime/library.designtime.js.map b/test/expected/build/library.h/dest/resources/library/h/designtime/library.designtime.js.map new file mode 100644 index 000000000..eed1a2f12 --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/designtime/library.designtime.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["library-dbg.designtime.js"],"names":["myexport","String"],"mappings":";;;AAOA,IAAIA,SAAY,WAEf,aAEAC,OAAO,OAJO","file":"library.designtime.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/file-dbg.js b/test/expected/build/library.h/dest/resources/library/h/file-dbg.js new file mode 100644 index 000000000..ab9d806f6 --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/file-dbg.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +console.log(' File '); diff --git a/test/expected/build/library.h/dest/resources/library/h/file.js b/test/expected/build/library.h/dest/resources/library/h/file.js index bcf866e67..2fe4c2aae 100644 --- a/test/expected/build/library.h/dest/resources/library/h/file.js +++ b/test/expected/build/library.h/dest/resources/library/h/file.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -console.log(" File "); \ No newline at end of file +console.log(" File "); +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/file.js.map b/test/expected/build/library.h/dest/resources/library/h/file.js.map new file mode 100644 index 000000000..0e96bde9b --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/file.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["file-dbg.js"],"names":["console","log"],"mappings":";;;AAGAA,QAAQC,IAAI","file":"file.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/library-dbg.js b/test/expected/build/library.h/dest/resources/library/h/library-dbg.js new file mode 100644 index 000000000..c9d3cbc0c --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/library-dbg.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +console.log(' Library '); diff --git a/test/expected/build/library.h/dest/resources/library/h/library.js b/test/expected/build/library.h/dest/resources/library/h/library.js index 6900e2218..ce760e5cb 100644 --- a/test/expected/build/library.h/dest/resources/library/h/library.js +++ b/test/expected/build/library.h/dest/resources/library/h/library.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -console.log(" Library "); \ No newline at end of file +console.log(" Library "); +//# sourceMappingURL=library.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/library.js.map b/test/expected/build/library.h/dest/resources/library/h/library.js.map new file mode 100644 index 000000000..fc4ea2654 --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/library.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["library-dbg.js"],"names":["console","log"],"mappings":";;;AAGAA,QAAQC,IAAI","file":"library.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/not-dbg.js b/test/expected/build/library.h/dest/resources/library/h/not-dbg.js new file mode 100644 index 000000000..d61495954 --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/not-dbg.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +console.log(' Not including '); diff --git a/test/expected/build/library.h/dest/resources/library/h/not.js b/test/expected/build/library.h/dest/resources/library/h/not.js index c249a10c8..75a862b14 100644 --- a/test/expected/build/library.h/dest/resources/library/h/not.js +++ b/test/expected/build/library.h/dest/resources/library/h/not.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -console.log(" Not including "); \ No newline at end of file +console.log(" Not including "); +//# sourceMappingURL=not.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/not.js.map b/test/expected/build/library.h/dest/resources/library/h/not.js.map new file mode 100644 index 000000000..d696f9d1e --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/not.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["not-dbg.js"],"names":["console","log"],"mappings":";;;AAGAA,QAAQC,IAAI","file":"not.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/some-dbg.js b/test/expected/build/library.h/dest/resources/library/h/some-dbg.js new file mode 100644 index 000000000..e03abda4d --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/some-dbg.js @@ -0,0 +1,5 @@ +/*! + * Some fancy copyright + */ +//@ui5-bundle-raw-include library/h/other.js +console.log(' Some '); diff --git a/test/expected/build/library.h/dest/resources/library/h/some.js b/test/expected/build/library.h/dest/resources/library/h/some.js index 1e86f9afc..0c5f5d3e3 100644 --- a/test/expected/build/library.h/dest/resources/library/h/some.js +++ b/test/expected/build/library.h/dest/resources/library/h/some.js @@ -2,4 +2,5 @@ * Some fancy copyright */ //@ui5-bundle-raw-include library/h/other.js -console.log(" Some "); \ No newline at end of file +console.log(" Some "); +//# sourceMappingURL=some.js.map \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/some.js.map b/test/expected/build/library.h/dest/resources/library/h/some.js.map new file mode 100644 index 000000000..d62492183 --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/some.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["some-dbg.js"],"names":["console","log"],"mappings":";;;;AAIAA,QAAQC,IAAI","file":"some.js"} \ No newline at end of file diff --git a/test/expected/build/library.h/no-minify/resources/library/h/.library b/test/expected/build/library.h/no-minify/resources/library/h/.library new file mode 100644 index 000000000..9084728e8 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/.library @@ -0,0 +1,19 @@ + + + + library.h + SAP SE + Some fancy copyright + 1.0.0 + + Library H + + + + + + + + + + diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/Component-preload.js b/test/expected/build/library.h/no-minify/resources/library/h/components/Component-preload.js new file mode 100644 index 000000000..1ca867689 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/Component-preload.js @@ -0,0 +1,14 @@ +//@ui5-bundle library/h/components/Component-preload.js +sap.ui.require.preload({ + "library/h/components/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); +}, + "library/h/components/TodoComponent.js":function(){/*! + * Some fancy copyright + */ +console.log(' File '); +} +}); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/Component.js b/test/expected/build/library.h/no-minify/resources/library/h/components/Component.js new file mode 100644 index 000000000..998e27dce --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/Component.js @@ -0,0 +1,5 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/TodoComponent.js b/test/expected/build/library.h/no-minify/resources/library/h/components/TodoComponent.js new file mode 100644 index 000000000..ab9d806f6 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/TodoComponent.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +console.log(' File '); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component-preload.js b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component-preload.js new file mode 100644 index 000000000..40b2828bc --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component-preload.js @@ -0,0 +1,9 @@ +//@ui5-bundle library/h/components/subcomponent1/Component-preload.js +sap.ui.require.preload({ + "library/h/components/subcomponent1/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); +} +}); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component.js b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component.js new file mode 100644 index 000000000..998e27dce --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component.js @@ -0,0 +1,5 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component-preload.js b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component-preload.js new file mode 100644 index 000000000..0e338e1ba --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component-preload.js @@ -0,0 +1,9 @@ +//@ui5-bundle library/h/components/subcomponent2/Component-preload.js +sap.ui.require.preload({ + "library/h/components/subcomponent2/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); +} +}); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component.js b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component.js new file mode 100644 index 000000000..998e27dce --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component.js @@ -0,0 +1,5 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component-preload.js b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component-preload.js new file mode 100644 index 000000000..42cadcd83 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component-preload.js @@ -0,0 +1,9 @@ +//@ui5-bundle library/h/components/subcomponent3/Component-preload.js +sap.ui.require.preload({ + "library/h/components/subcomponent3/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); +} +}); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component.js b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component.js new file mode 100644 index 000000000..998e27dce --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component.js @@ -0,0 +1,5 @@ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "use strict"; + return UIComponent.extend('application.g.Component', { + }); +}); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/customBundle-dbg.js b/test/expected/build/library.h/no-minify/resources/library/h/customBundle-dbg.js new file mode 100644 index 000000000..1746a7a97 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/customBundle-dbg.js @@ -0,0 +1,24 @@ +//@ui5-bundle library/h/customBundle-dbg.js +sap.ui.require.preload({ + "library/h/file.js":function(){/*! + * Some fancy copyright + */ +console.log(' File '); +}, + "library/h/library.js":function(){/*! + * Some fancy copyright + */ +console.log(' Library '); +}, + "library/h/some.js":function(){/*! + * Some fancy copyright + */ +//@ui5-bundle-raw-include library/h/other.js +console.log(' Some '); +} +}); +//@ui5-bundle-raw-include library/h/not.js +/*! + * Some fancy copyright + */ +console.log(' Not including '); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/customBundle.js b/test/expected/build/library.h/no-minify/resources/library/h/customBundle.js new file mode 100644 index 000000000..8c6d93a0b --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/customBundle.js @@ -0,0 +1,24 @@ +//@ui5-bundle library/h/customBundle.js +sap.ui.require.preload({ + "library/h/file.js":function(){/*! + * Some fancy copyright + */ +console.log(' File '); +}, + "library/h/library.js":function(){/*! + * Some fancy copyright + */ +console.log(' Library '); +}, + "library/h/some.js":function(){/*! + * Some fancy copyright + */ +//@ui5-bundle-raw-include library/h/other.js +console.log(' Some '); +} +}); +//@ui5-bundle-raw-include library/h/not.js +/*! + * Some fancy copyright + */ +console.log(' Not including '); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/designtime/library.designtime.js b/test/expected/build/library.h/no-minify/resources/library/h/designtime/library.designtime.js new file mode 100644 index 000000000..34069d6ac --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/designtime/library.designtime.js @@ -0,0 +1,14 @@ +/*! + * Some fancy copyright + */ + +/** + * designtime and global export + */ +var myexport = (function() { + + "use strict"; + + String("asd"); + +}()); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/file.js b/test/expected/build/library.h/no-minify/resources/library/h/file.js new file mode 100644 index 000000000..ab9d806f6 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/file.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +console.log(' File '); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/i18n/messagebundle.properties b/test/expected/build/library.h/no-minify/resources/library/h/i18n/messagebundle.properties new file mode 100644 index 000000000..1c6a1a9e8 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/i18n/messagebundle.properties @@ -0,0 +1 @@ +a=b \ No newline at end of file diff --git a/test/expected/build/library.h/no-minify/resources/library/h/i18n/messagebundle_en.properties b/test/expected/build/library.h/no-minify/resources/library/h/i18n/messagebundle_en.properties new file mode 100644 index 000000000..1c6a1a9e8 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/i18n/messagebundle_en.properties @@ -0,0 +1 @@ +a=b \ No newline at end of file diff --git a/test/expected/build/library.h/no-minify/resources/library/h/library.js b/test/expected/build/library.h/no-minify/resources/library/h/library.js new file mode 100644 index 000000000..c9d3cbc0c --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/library.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +console.log(' Library '); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/manifest.json b/test/expected/build/library.h/no-minify/resources/library/h/manifest.json new file mode 100644 index 000000000..808d3df90 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/manifest.json @@ -0,0 +1,34 @@ +{ + "_version": "1.21.0", + "sap.app": { + "id": "library.h", + "type": "library", + "embeds": [], + "applicationVersion": { + "version": "1.0.0" + }, + "title": "Library H", + "description": "Library H", + "resources": "resources.json", + "offline": true + }, + "sap.ui": { + "technology": "UI5", + "supportedThemes": [] + }, + "sap.ui5": { + "dependencies": { + "minUI5Version": "1.0", + "libs": {} + }, + "library": { + "i18n": false, + "content": { + "controls": [], + "elements": [], + "types": [], + "interfaces": [] + } + } + } +} \ No newline at end of file diff --git a/test/expected/build/library.h/no-minify/resources/library/h/not.js b/test/expected/build/library.h/no-minify/resources/library/h/not.js new file mode 100644 index 000000000..d61495954 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/not.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +console.log(' Not including '); diff --git a/test/expected/build/library.h/no-minify/resources/library/h/some.js b/test/expected/build/library.h/no-minify/resources/library/h/some.js new file mode 100644 index 000000000..e03abda4d --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/some.js @@ -0,0 +1,5 @@ +/*! + * Some fancy copyright + */ +//@ui5-bundle-raw-include library/h/other.js +console.log(' Some '); diff --git a/test/expected/build/library.h/no-minify/test-resources/library/d/Test.html b/test/expected/build/library.h/no-minify/test-resources/library/d/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/library.l/dest/resources/library/l/some.js b/test/expected/build/library.l/dest/resources/library/l/some.js index 82357c2d4..bf4a8a469 100644 --- a/test/expected/build/library.l/dest/resources/library/l/some.js +++ b/test/expected/build/library.l/dest/resources/library/l/some.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -sap.ui.define([],function(){"use strict";var i=function(){}},true); \ No newline at end of file +sap.ui.define([],function(){"use strict";var i=function(){}},true); +//# sourceMappingURL=some.js.map \ No newline at end of file diff --git a/test/expected/build/library.l/dest/resources/library/l/some.js.map b/test/expected/build/library.l/dest/resources/library/l/some.js.map new file mode 100644 index 000000000..a7bf0ac2b --- /dev/null +++ b/test/expected/build/library.l/dest/resources/library/l/some.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["some-dbg.js"],"names":["sap","ui","define","SomeFunction"],"mappings":";;;AAIAA,IAAIC,GAAGC,OAAO,GACb,WACA,aAOA,IAAIC,EAAe,cAEF","file":"some.js"} \ No newline at end of file diff --git a/test/expected/build/library.l/dest/resources/library/l/subdir/index.js b/test/expected/build/library.l/dest/resources/library/l/subdir/index.js index 894e5374f..9661d7207 100644 --- a/test/expected/build/library.l/dest/resources/library/l/subdir/index.js +++ b/test/expected/build/library.l/dest/resources/library/l/subdir/index.js @@ -1 +1,2 @@ -function hello(l){console.log("hello "+l)}hello("world"); \ No newline at end of file +function hello(l){console.log("hello "+l)}hello("world"); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/test/expected/build/library.l/dest/resources/library/l/subdir/index.js.map b/test/expected/build/library.l/dest/resources/library/l/subdir/index.js.map new file mode 100644 index 000000000..9ebd8bf4e --- /dev/null +++ b/test/expected/build/library.l/dest/resources/library/l/subdir/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index-dbg.js"],"names":["hello","name","console","log"],"mappings":"AACA,SAASA,MAAMC,GACdC,QAAQC,IAAI,SAAWF,GAExBD,MAAM","file":"index.js"} \ No newline at end of file diff --git a/test/expected/build/library.l/dest/resources/library/l/subdir/thirdparty/File1.js b/test/expected/build/library.l/dest/resources/library/l/subdir/thirdparty/File1.js index 894e5374f..7b3311e4e 100644 --- a/test/expected/build/library.l/dest/resources/library/l/subdir/thirdparty/File1.js +++ b/test/expected/build/library.l/dest/resources/library/l/subdir/thirdparty/File1.js @@ -1 +1,2 @@ -function hello(l){console.log("hello "+l)}hello("world"); \ No newline at end of file +function hello(l){console.log("hello "+l)}hello("world"); +//# sourceMappingURL=File1.js.map \ No newline at end of file diff --git a/test/expected/build/library.l/dest/resources/library/l/subdir/thirdparty/File1.js.map b/test/expected/build/library.l/dest/resources/library/l/subdir/thirdparty/File1.js.map new file mode 100644 index 000000000..1c04d432d --- /dev/null +++ b/test/expected/build/library.l/dest/resources/library/l/subdir/thirdparty/File1.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["File1-dbg.js"],"names":["hello","name","console","log"],"mappings":"AACA,SAASA,MAAMC,GACdC,QAAQC,IAAI,SAAWF,GAExBD,MAAM","file":"File1.js"} \ No newline at end of file diff --git "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js" "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js" index b25d5ac7a..7b9c787c6 100644 --- "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js" +++ "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js" @@ -5,5 +5,6 @@ sap.ui.require.preload({ * Some fancy copyright */ (function(){var o="World";console.log("Hello "+o)})(); +//# sourceMappingURL=some.js.map } }); diff --git "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.support.js" "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.support.js" new file mode 100644 index 000000000..9dd152223 --- /dev/null +++ "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.support.js" @@ -0,0 +1,37 @@ +//@ui5-bundle library/ø/library-preload.support.js +/*! + * Some fancy copyright + */ +/** + * Defines support rules + */ + sap.ui.predefine("library/ø/rules/MyControl.support", ['sap/ui/support/library', 'sap/base/Log'], + function(SupportLib, Log) { + 'use strict'; + + //********************************************************** + // Rule Definitions + //********************************************************** + + var oRule = { + id: "oRule", + audiences: [Audiences.Application], + categories: [Categories.Usage], + enabled: true, + minversion: '1.71', + title: 'Title', + description: 'description', + resolution: 'resolution', + check: function(oIssueManager, oCoreFacade, oScope) { + oIssueManager.addIssue({ + severity: Severity.High, + details: 'Looking good today!' + }); + } + }; + + return [ + oRule + ]; + + }, true); diff --git "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/rules/MyControl.support.js" "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/rules/MyControl.support.js" new file mode 100644 index 000000000..6f084d6ef --- /dev/null +++ "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/rules/MyControl.support.js" @@ -0,0 +1,36 @@ +/*! + * Some fancy copyright + */ +/** + * Defines support rules + */ + sap.ui.define(['sap/ui/support/library', 'sap/base/Log'], + function(SupportLib, Log) { + 'use strict'; + + //********************************************************** + // Rule Definitions + //********************************************************** + + var oRule = { + id: "oRule", + audiences: [Audiences.Application], + categories: [Categories.Usage], + enabled: true, + minversion: '1.71', + title: 'Title', + description: 'description', + resolution: 'resolution', + check: function(oIssueManager, oCoreFacade, oScope) { + oIssueManager.addIssue({ + severity: Severity.High, + details: 'Looking good today!' + }); + } + }; + + return [ + oRule + ]; + + }, true); diff --git "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/some.js" "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/some.js" index c23f5f207..75aba1e23 100644 --- "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/some.js" +++ "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/some.js" @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -(function(){var o="World";console.log("Hello "+o)})(); \ No newline at end of file +(function(){var o="World";console.log("Hello "+o)})(); +//# sourceMappingURL=some.js.map \ No newline at end of file diff --git "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/some.js.map" "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/some.js.map" new file mode 100644 index 000000000..bc2b57a0a --- /dev/null +++ "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/some.js.map" @@ -0,0 +1 @@ +{"version":3,"sources":["some-dbg.js"],"names":["someNonUglifiedVariable","console","log"],"mappings":";;;CAGA,WACC,IAAIA,EAA0B,QAC9BC,QAAQC,IAAI,SAAWF,IAFxB","file":"some.js"} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap-ui-core.js b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap-ui-core.js index e69de29bb..a72d46525 100644 --- a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap-ui-core.js +++ b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap-ui-core.js @@ -0,0 +1,2 @@ + +//# sourceMappingURL=sap-ui-core.js.map \ No newline at end of file diff --git a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap-ui-core.js.map b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap-ui-core.js.map new file mode 100644 index 000000000..e347f93df --- /dev/null +++ b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap-ui-core.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"sap-ui-core.js"} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/Global.js b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/Global.js index b37fec15d..e0fe65e6f 100644 --- a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/Global.js +++ b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/Global.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -console.log("20220620-1630"); \ No newline at end of file +console.log("20220620-1630"); +//# sourceMappingURL=Global.js.map \ No newline at end of file diff --git a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/Global.js.map b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/Global.js.map new file mode 100644 index 000000000..694230468 --- /dev/null +++ b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/Global.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Global-dbg.js"],"names":["console","log"],"mappings":";;;AAIAA,QAAQC,IAAI","file":"Global.js"} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/core/Core.js b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/core/Core.js index 607c2f2f2..e625a5c05 100644 --- a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/core/Core.js +++ b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/core/Core.js @@ -1,4 +1,5 @@ /*! * Some fancy copyright */ -console.log("${buildtime}"); \ No newline at end of file +console.log("${buildtime}"); +//# sourceMappingURL=Core.js.map \ No newline at end of file diff --git a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/core/Core.js.map b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/core/Core.js.map new file mode 100644 index 000000000..75511857a --- /dev/null +++ b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/core/Core.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Core-dbg.js"],"names":["console","log"],"mappings":";;;AAIAA,QAAQC,IAAI","file":"Core.js"} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-dbg.js b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-dbg.js index ad90626c5..032851a0c 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-dbg.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-dbg.js @@ -1,4 +1,9 @@ //@ui5-bundle sap-ui-core-dbg.js +//@ui5-bundle-raw-include ui5loader-autoconfig.js +(function () { + var thisIsTheUi5LoaderAutoconfig = true; + console.log(thisIsTheUi5LoaderAutoconfig); +})() sap.ui.requireSync("sap/ui/core/Core"); // as this module contains the Core, we ensure that the Core has been booted sap.ui.getCore().boot && sap.ui.getCore().boot(); diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery-dbg.js b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery-dbg.js index 59acdf55a..0586fc05a 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery-dbg.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery-dbg.js @@ -1,4 +1,9 @@ //@ui5-bundle sap-ui-core-nojQuery-dbg.js +//@ui5-bundle-raw-include ui5loader-autoconfig.js +(function () { + var thisIsTheUi5LoaderAutoconfig = true; + console.log(thisIsTheUi5LoaderAutoconfig); +})() sap.ui.requireSync("sap/ui/core/Core"); // as this module contains the Core, we ensure that the Core has been booted sap.ui.getCore().boot && sap.ui.getCore().boot(); diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery.js b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery.js index e01a57ec5..f5f9001c0 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery.js @@ -1,10 +1,17 @@ //@ui5-bundle sap-ui-core-nojQuery.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ - "sap/ui/core/Core.js":function(){ +window["sap-ui-optimized"] = true; +try { +//@ui5-bundle-raw-include ui5loader-autoconfig.js +(function(){var o=true;console.log(o)})(); +//# sourceMappingURL=ui5loader-autoconfig.js.map +sap.ui.require.preload({ + "sap/ui/core/Core.js":function(){(function(){var o=true;console.log(o)})(); +//# sourceMappingURL=Core.js.map } -}}); +}); sap.ui.requireSync("sap/ui/core/Core"); // as this module contains the Core, we ensure that the Core has been booted sap.ui.getCore().boot && sap.ui.getCore().boot(); +} catch(oError) { +if (oError.name != "Restart") { throw oError; } +} diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js index 71e97011c..d3a111a16 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js @@ -1,10 +1,17 @@ //@ui5-bundle sap-ui-core.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ - "sap/ui/core/Core.js":function(){ +window["sap-ui-optimized"] = true; +try { +//@ui5-bundle-raw-include ui5loader-autoconfig.js +(function(){var o=true;console.log(o)})(); +//# sourceMappingURL=ui5loader-autoconfig.js.map +sap.ui.require.preload({ + "sap/ui/core/Core.js":function(){(function(){var o=true;console.log(o)})(); +//# sourceMappingURL=Core.js.map } -}}); +}); sap.ui.requireSync("sap/ui/core/Core"); // as this module contains the Core, we ensure that the Core has been booted sap.ui.getCore().boot && sap.ui.getCore().boot(); +} catch(oError) { +if (oError.name != "Restart") { throw oError; } +} diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js.map b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js.map new file mode 100644 index 000000000..a9b380967 --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["sap-ui-core-dbg.js"],"names":["thisShouldBeOverwritten","console","log"],"mappings":"CAAA,WACC,IAAIA,EAA0B,KAC9BC,QAAQC,IAAIF,IAFb","file":"sap-ui-core.js"} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core-dbg.js b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core-dbg.js new file mode 100644 index 000000000..66bd2c43f --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core-dbg.js @@ -0,0 +1,4 @@ +(function () { + var core = true; + console.log(core); +})() diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core.js b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core.js index e69de29bb..29a53cc7e 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core.js @@ -0,0 +1,2 @@ +(function(){var o=true;console.log(o)})(); +//# sourceMappingURL=Core.js.map \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core.js.map b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core.js.map new file mode 100644 index 000000000..d83752ade --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["Core-dbg.js"],"names":["core","console","log"],"mappings":"CAAA,WACC,IAAIA,EAAO,KACXC,QAAQC,IAAIF,IAFb","file":"Core.js"} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/library-preload.js b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/library-preload.js index 5f9e0796e..19e93a36a 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/library-preload.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/library-preload.js @@ -1,13 +1,16 @@ //@ui5-bundle sap/ui/core/library-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "sap/ui/core/one.js":function(){function One(){return 1} +//# sourceMappingURL=one.js.map this.One=One; }, "sap/ui/core/some.js":function(){/*! * ${copyright} */ console.log("HelloWorld"); +//# sourceMappingURL=some.js.map +}, + "ui5loader.js":function(){(function(){var o=true;console.log(o)})(); +//# sourceMappingURL=ui5loader.js.map } -}}); +}); diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one-dbg.js b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one-dbg.js new file mode 100644 index 000000000..753bd0523 --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one-dbg.js @@ -0,0 +1,3 @@ +function One(){ + return 1; +} diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one.js b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one.js index 753bd0523..7a53557c1 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one.js @@ -1,3 +1,2 @@ -function One(){ - return 1; -} +function One(){return 1} +//# sourceMappingURL=one.js.map \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one.js.map b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one.js.map new file mode 100644 index 000000000..a4b534c3a --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["one-dbg.js"],"names":["One"],"mappings":"AAAA,SAASA,MACR,OAAO","file":"one.js"} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some-dbg.js b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some-dbg.js new file mode 100644 index 000000000..f39184874 --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some-dbg.js @@ -0,0 +1,14 @@ +/*! + * ${copyright} + */ +console.log('HelloWorld'); + +/* + * function add(c) - this is still not implemented. + * @private + * @param {Component} c + * @name add + * This comment should be removed in the preload bundle although it contains the magic + * sequence "opening parenthesis - letter c - closing parenthesis" which usually indicates + * a c o p y r i g h t comment. + */ diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some.js b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some.js index f39184874..66f0541d6 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some.js @@ -1,14 +1,5 @@ /*! * ${copyright} */ -console.log('HelloWorld'); - -/* - * function add(c) - this is still not implemented. - * @private - * @param {Component} c - * @name add - * This comment should be removed in the preload bundle although it contains the magic - * sequence "opening parenthesis - letter c - closing parenthesis" which usually indicates - * a c o p y r i g h t comment. - */ +console.log("HelloWorld"); +//# sourceMappingURL=some.js.map \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some.js.map b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some.js.map new file mode 100644 index 000000000..c8712c5c9 --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["some-dbg.js"],"names":["console","log"],"mappings":";;;AAGAA,QAAQC,IAAI","file":"some.js"} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig-dbg.js b/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig-dbg.js new file mode 100644 index 000000000..783bce8ec --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig-dbg.js @@ -0,0 +1,4 @@ +(function () { + var thisIsTheUi5LoaderAutoconfig = true; + console.log(thisIsTheUi5LoaderAutoconfig); +})() diff --git a/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig.js b/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig.js new file mode 100644 index 000000000..3cedd755e --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig.js @@ -0,0 +1,2 @@ +(function(){var o=true;console.log(o)})(); +//# sourceMappingURL=ui5loader-autoconfig.js.map \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig.js.map b/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig.js.map new file mode 100644 index 000000000..17ebf5849 --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["ui5loader-autoconfig-dbg.js"],"names":["thisIsTheUi5LoaderAutoconfig","console","log"],"mappings":"CAAA,WACC,IAAIA,EAA+B,KACnCC,QAAQC,IAAIF,IAFb","file":"ui5loader-autoconfig.js"} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/ui5loader-dbg.js b/test/expected/build/sap.ui.core/preload/resources/ui5loader-dbg.js new file mode 100644 index 000000000..5e44b1dd6 --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/ui5loader-dbg.js @@ -0,0 +1,4 @@ +(function () { + var thisIsTheUi5Loader = true; + console.log(thisIsTheUi5Loader); +})() diff --git a/test/expected/build/sap.ui.core/preload/resources/ui5loader.js b/test/expected/build/sap.ui.core/preload/resources/ui5loader.js new file mode 100644 index 000000000..863578d3d --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/ui5loader.js @@ -0,0 +1,2 @@ +(function(){var o=true;console.log(o)})(); +//# sourceMappingURL=ui5loader.js.map \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/ui5loader.js.map b/test/expected/build/sap.ui.core/preload/resources/ui5loader.js.map new file mode 100644 index 000000000..6c94ed09e --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/ui5loader.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["ui5loader-dbg.js"],"names":["thisIsTheUi5Loader","console","log"],"mappings":"CAAA,WACC,IAAIA,EAAqB,KACzBC,QAAQC,IAAIF,IAFb","file":"ui5loader.js"} \ No newline at end of file diff --git "a/test/fixtures/library.\303\270/m\303\241in/\303\237rc/library/\303\270/rules/MyControl.support.js" "b/test/fixtures/library.\303\270/m\303\241in/\303\237rc/library/\303\270/rules/MyControl.support.js" new file mode 100644 index 000000000..105f08ef0 --- /dev/null +++ "b/test/fixtures/library.\303\270/m\303\241in/\303\237rc/library/\303\270/rules/MyControl.support.js" @@ -0,0 +1,36 @@ +/*! + * ${copyright} + */ +/** + * Defines support rules + */ + sap.ui.define(['sap/ui/support/library', 'sap/base/Log'], + function(SupportLib, Log) { + 'use strict'; + + //********************************************************** + // Rule Definitions + //********************************************************** + + var oRule = { + id: "oRule", + audiences: [Audiences.Application], + categories: [Categories.Usage], + enabled: true, + minversion: '1.71', + title: 'Title', + description: 'description', + resolution: 'resolution', + check: function(oIssueManager, oCoreFacade, oScope) { + oIssueManager.addIssue({ + severity: Severity.High, + details: 'Looking good today!' + }); + } + }; + + return [ + oRule + ]; + + }, true); diff --git a/test/fixtures/sap.ui.core/main/src/sap-ui-core.js b/test/fixtures/sap.ui.core/main/src/sap-ui-core.js index e69de29bb..bd9958b6e 100644 --- a/test/fixtures/sap.ui.core/main/src/sap-ui-core.js +++ b/test/fixtures/sap.ui.core/main/src/sap-ui-core.js @@ -0,0 +1,4 @@ +(function () { + var thisShouldBeOverwritten = true; + console.log(thisShouldBeOverwritten); +})() diff --git a/test/fixtures/sap.ui.core/main/src/sap/ui/core/Core.js b/test/fixtures/sap.ui.core/main/src/sap/ui/core/Core.js index e69de29bb..66bd2c43f 100644 --- a/test/fixtures/sap.ui.core/main/src/sap/ui/core/Core.js +++ b/test/fixtures/sap.ui.core/main/src/sap/ui/core/Core.js @@ -0,0 +1,4 @@ +(function () { + var core = true; + console.log(core); +})() diff --git a/test/fixtures/sap.ui.core/main/src/ui5loader-autoconfig.js b/test/fixtures/sap.ui.core/main/src/ui5loader-autoconfig.js new file mode 100644 index 000000000..783bce8ec --- /dev/null +++ b/test/fixtures/sap.ui.core/main/src/ui5loader-autoconfig.js @@ -0,0 +1,4 @@ +(function () { + var thisIsTheUi5LoaderAutoconfig = true; + console.log(thisIsTheUi5LoaderAutoconfig); +})() diff --git a/test/fixtures/sap.ui.core/main/src/ui5loader.js b/test/fixtures/sap.ui.core/main/src/ui5loader.js new file mode 100644 index 000000000..5e44b1dd6 --- /dev/null +++ b/test/fixtures/sap.ui.core/main/src/ui5loader.js @@ -0,0 +1,4 @@ +(function () { + var thisIsTheUi5Loader = true; + console.log(thisIsTheUi5Loader); +})() diff --git a/test/lib/builder/BuildContext.js b/test/lib/builder/BuildContext.js index 1021fce32..7b6af6aea 100644 --- a/test/lib/builder/BuildContext.js +++ b/test/lib/builder/BuildContext.js @@ -27,10 +27,14 @@ test("getRootProject", (t) => { test.serial("createProjectContext", (t) => { class DummyProjectContext { - constructor({buildContext, project, resources}) { + constructor({buildContext, project, resources, globalTags}) { t.is(buildContext, testBuildContext, "Correct buildContext parameter"); t.is(project, "project", "Correct project parameter"); t.is(resources, "resources", "Correct resources parameter"); + t.deepEqual(globalTags, { + IsDebugVariant: "ui5:IsDebugVariant", + HasDebugVariant: "ui5:HasDebugVariant", + }, "Correct globalTags parameter"); } } mock("../../../lib/builder/ProjectBuildContext", DummyProjectContext); @@ -70,3 +74,28 @@ test("executeCleanupTasks", async (t) => { t.is(executeCleanupTasks.callCount, 2, "Project context executeCleanupTasks got called twice"); }); + +test.serial("getResourceTagCollection", (t) => { + class DummyResourceTagCollection { + constructor({allowedTags, superCollection}) { + t.deepEqual(allowedTags, [ + "ui5:IsDebugVariant", + "ui5:HasDebugVariant", + ], + "Correct allowedTags parameter supplied"); + } + } + mock("@ui5/fs", { + ResourceTagCollection: DummyResourceTagCollection + }); + + const BuildContext = mock.reRequire("../../../lib/builder/BuildContext"); + const buildContext = new BuildContext({ + rootProject: "pony" + }); + + const collection = buildContext.getResourceTagCollection(); + + t.true(collection instanceof DummyResourceTagCollection, + "Returned an instance of mocked DummyResourceTagCollection"); +}); diff --git a/test/lib/builder/ProjectBuildContext.js b/test/lib/builder/ProjectBuildContext.js index d14b3072c..911ef92a0 100644 --- a/test/lib/builder/ProjectBuildContext.js +++ b/test/lib/builder/ProjectBuildContext.js @@ -1,7 +1,13 @@ const test = require("ava"); const sinon = require("sinon"); const mock = require("mock-require"); +const ResourceTagCollection = require("@ui5/fs").ResourceTagCollection; +test.beforeEach((t) => { + t.context.resourceTagCollection = new ResourceTagCollection({ + allowedTags: ["me:MyTag"] + }); +}); test.afterEach.always((t) => { sinon.restore(); mock.stopAll(); @@ -11,7 +17,12 @@ const ProjectBuildContext = require("../../../lib/builder/ProjectBuildContext"); test("Missing parameters", (t) => { const error = t.throws(() => { - new ProjectBuildContext({}); + new ProjectBuildContext({ + buildContext: { + getResourceTagCollection: () => t.context.resourceTagCollection + }, + globalTags: {MyTag: "me:MyTag"}, + }); }); t.is(error.message, `One or more mandatory parameters are missing`, "Threw with expected error message"); @@ -20,8 +31,10 @@ test("Missing parameters", (t) => { test("isRootProject: true", (t) => { const projectBuildContext = new ProjectBuildContext({ buildContext: { - getRootProject: () => "root project" + getRootProject: () => "root project", + getResourceTagCollection: () => t.context.resourceTagCollection }, + globalTags: {MyTag: "me:MyTag"}, project: "root project", resources: "resources" }); @@ -32,8 +45,10 @@ test("isRootProject: true", (t) => { test("isRootProject: false", (t) => { const projectBuildContext = new ProjectBuildContext({ buildContext: { - getRootProject: () => "root project" + getRootProject: () => "root project", + getResourceTagCollection: () => t.context.resourceTagCollection }, + globalTags: {MyTag: "me:MyTag"}, project: "no root project", resources: "resources" }); @@ -44,8 +59,10 @@ test("isRootProject: false", (t) => { test("registerCleanupTask", (t) => { const projectBuildContext = new ProjectBuildContext({ buildContext: { - getRootProject: () => "root project" + getRootProject: () => "root project", + getResourceTagCollection: () => t.context.resourceTagCollection }, + globalTags: {MyTag: "me:MyTag"}, project: "no root project", resources: "resources" }); @@ -59,8 +76,10 @@ test("registerCleanupTask", (t) => { test("executeCleanupTasks", (t) => { const projectBuildContext = new ProjectBuildContext({ buildContext: { - getRootProject: () => "root project" + getRootProject: () => "root project", + getResourceTagCollection: () => t.context.resourceTagCollection }, + globalTags: {MyTag: "me:MyTag"}, project: "no root project", resources: "resources" }); @@ -78,26 +97,33 @@ test("executeCleanupTasks", (t) => { test("STANDARD_TAGS constant", (t) => { const projectBuildContext = new ProjectBuildContext({ buildContext: { - getRootProject: () => "root project" + getRootProject: () => "root project", + getResourceTagCollection: () => t.context.resourceTagCollection }, + globalTags: {MyTag: "me:MyTag"}, project: "no root project", resources: "resources" }); t.deepEqual(projectBuildContext.STANDARD_TAGS, { OmitFromBuildResult: "ui5:OmitFromBuildResult", + MyTag: "me:MyTag", IsBundle: "ui5:IsBundle" }, "Exposes correct STANDARD_TAGS constant"); }); test.serial("getResourceTagCollection", (t) => { class DummyResourceTagCollection { - constructor({allowedTags}) { + constructor({allowedTags, superCollection}) { t.deepEqual(allowedTags, [ "ui5:OmitFromBuildResult", - "ui5:IsBundle" + "ui5:IsBundle", + "me:MyTag", ], "Correct allowedTags parameter supplied"); + + t.is(superCollection, "build context's tag collection", + "Correct superCollection parameter supplied"); } } mock("@ui5/fs", { @@ -107,8 +133,10 @@ test.serial("getResourceTagCollection", (t) => { const ProjectBuildContext = mock.reRequire("../../../lib/builder/ProjectBuildContext"); const projectBuildContext = new ProjectBuildContext({ buildContext: { - getRootProject: () => "root project" + getRootProject: () => "root project", + getResourceTagCollection: () => "build context's tag collection", }, + globalTags: {MyTag: "me:MyTag"}, project: "no root project", resources: "resources" }); diff --git a/test/lib/builder/builder-composeTaskList.js b/test/lib/builder/builder-composeTaskList.js index 3f4c94470..3c7780947 100644 --- a/test/lib/builder/builder-composeTaskList.js +++ b/test/lib/builder/builder-composeTaskList.js @@ -31,9 +31,8 @@ test.afterEach.always(() => { "replaceCopyright", "replaceVersion", "replaceBuildtime", - "createDebugFiles", "escapeNonAsciiCharacters", - "uglify", + "minify", "buildThemes", "generateLibraryManifest", "generateVersionInfo", @@ -67,9 +66,8 @@ test.afterEach.always(() => { "replaceCopyright", "replaceVersion", "replaceBuildtime", - "createDebugFiles", "escapeNonAsciiCharacters", - "uglify", + "minify", "buildThemes", "transformBootstrapHtml", "generateLibraryManifest", @@ -106,9 +104,8 @@ test.afterEach.always(() => { }, [ "replaceVersion", "replaceBuildtime", - "createDebugFiles", "escapeNonAsciiCharacters", - "uglify", + "minify", "buildThemes", "generateLibraryManifest", "generateVersionInfo", @@ -130,12 +127,11 @@ test.afterEach.always(() => { "replaceCopyright", "replaceVersion", "replaceBuildtime", - "createDebugFiles", "escapeNonAsciiCharacters", "executeJsdocSdkTransformation", "generateApiIndex", "generateJsdoc", - "uglify", + "minify", "buildThemes", "transformBootstrapHtml", "generateLibraryManifest", @@ -171,9 +167,8 @@ test.afterEach.always(() => { "replaceCopyright", "replaceVersion", "replaceBuildtime", - "createDebugFiles", "escapeNonAsciiCharacters", - "uglify", + "minify", "buildThemes", "generateLibraryManifest", "generateVersionInfo", @@ -203,9 +198,8 @@ test.afterEach.always(() => { "replaceCopyright", "replaceVersion", "replaceBuildtime", - "createDebugFiles", "escapeNonAsciiCharacters", - "uglify", + "minify", "buildThemes", "generateLibraryManifest", "generateVersionInfo", diff --git a/test/lib/builder/builder.js b/test/lib/builder/builder.js index b40fa6d45..e19f78766 100644 --- a/test/lib/builder/builder.js +++ b/test/lib/builder/builder.js @@ -162,9 +162,8 @@ test.serial("Build", async (t) => { "replaceCopyright", "replaceVersion", "replaceBuildtime", - "createDebugFiles", "escapeNonAsciiCharacters", - "uglify", + "minify", "buildThemes", "generateLibraryManifest", "generateVersionInfo", @@ -448,7 +447,28 @@ test.serial("Build application.h", (t) => { return builder.build({ tree: applicationHTree, destPath, - excludedTasks: ["createDebugFiles", "generateComponentPreload", + excludedTasks: ["generateComponentPreload", + "generateStandaloneAppBundle", "generateVersionInfo"] + }).then(() => { + return findFiles(expectedPath); + }).then((expectedFiles) => { + // Check for all directories and files + assert.directoryDeepEqual(destPath, expectedPath); + // Check for all file contents + return checkFileContentsIgnoreLineFeeds(t, expectedFiles, expectedPath, destPath); + }).then(() => { + t.pass(); + }); +}); + +test.serial("Build application.h (no minify)", (t) => { + const destPath = "./test/tmp/build/application.h/no-minify"; + const expectedPath = path.join("test", "expected", "build", "application.h", "no-minify"); + + return builder.build({ + tree: applicationHTree, + destPath, + excludedTasks: ["minify", "generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo"] }).then(() => { return findFiles(expectedPath); @@ -469,7 +489,7 @@ test.serial("Build application.i", (t) => { return builder.build({ tree: applicationITree, destPath, - excludedTasks: ["createDebugFiles", "generateStandaloneAppBundle", "generateVersionInfo"] + excludedTasks: ["generateStandaloneAppBundle", "generateVersionInfo"] }).then(() => { return findFiles(expectedPath); }).then((expectedFiles) => { @@ -489,7 +509,7 @@ test.serial("Build application.j", (t) => { return builder.build({ tree: applicationJTree, destPath, - excludedTasks: ["createDebugFiles", "generateStandaloneAppBundle", "generateVersionInfo"] + excludedTasks: ["generateStandaloneAppBundle", "generateVersionInfo"] }).then(() => { return findFiles(expectedPath); }).then((expectedFiles) => { @@ -534,7 +554,7 @@ test.serial("Build application.j with resources.json and version info", (t) => { ], tree: applicationJTree, destPath, - excludedTasks: ["createDebugFiles", "generateStandaloneAppBundle"] + excludedTasks: ["generateStandaloneAppBundle"] }).then(() => { return findFiles(expectedPath); }).then((expectedFiles) => { @@ -698,7 +718,29 @@ test.serial("Build library.h with custom bundles and component-preloads", (t) => return builder.build({ tree: libraryHTree, destPath, - excludedTasks: ["createDebugFiles", "generateLibraryPreload"] + excludedTasks: ["generateLibraryPreload"] + }).then(() => { + return findFiles(expectedPath); + }).then((expectedFiles) => { + // Check for all directories and files + assert.directoryDeepEqual(destPath, expectedPath); + + // Check for all file contents + return checkFileContentsIgnoreLineFeeds(t, expectedFiles, expectedPath, destPath); + }).then(() => { + t.pass(); + }); +}); + + +test.serial("Build library.h with custom bundles and component-preloads (no minify)", (t) => { + const destPath = path.join("test", "tmp", "build", "library.h", "no-minify"); + const expectedPath = path.join("test", "expected", "build", "library.h", "no-minify"); + + return builder.build({ + tree: libraryHTree, + destPath, + excludedTasks: ["minify", "generateLibraryPreload"] }).then(() => { return findFiles(expectedPath); }).then((expectedFiles) => { @@ -722,7 +764,7 @@ test.serial("Build library.h with custom bundles and component-preloads with res ], tree: libraryHTree, destPath, - excludedTasks: ["createDebugFiles", "generateLibraryPreload"] + excludedTasks: ["generateLibraryPreload"] }).then(() => { return findFiles(expectedPath); }).then((expectedFiles) => { @@ -743,7 +785,7 @@ test.serial("Build library.i with manifest info taken from .library and library. return builder.build({ tree: libraryITree, destPath, - excludedTasks: ["createDebugFiles", "generateLibraryPreload", "uglify"] + excludedTasks: ["generateLibraryPreload", "minify"] }).then(() => { return findFiles(expectedPath); }).then((expectedFiles) => { @@ -1289,7 +1331,7 @@ const applicationHTree = { }] }, "bundleOptions": { - "optimize": true, + "optimize": false, "usePredefinedCalls": true } }] @@ -1613,7 +1655,7 @@ const libraryHTree = { "filters": [ "library/h/some.js", "library/h/library.js", - "library/h/file.js", + "library/h/fi*.js", "!library/h/components/" ], "resolve": false, @@ -1633,6 +1675,35 @@ const libraryHTree = { "optimize": true, "usePredefinedCalls": true } + }, { + "bundleDefinition": { + "name": "library/h/customBundle-dbg.js", + "defaultFileTypes": [".js"], + "sections": [{ + "mode": "preload", + "filters": [ + "library/h/some.js", + "library/h/library.js", + "library/h/fi*.js", + "!library/h/components/" + ], + "resolve": false, + "renderer": false + }, { + "mode": "raw", + "filters": [ + "library/h/not.js" + ], + "resolve": true, + "declareModules": false, + "sort": true, + "renderer": false + }] + }, + "bundleOptions": { + "optimize": false, + "usePredefinedCalls": true + } }], "componentPreload": { "namespaces": [ diff --git a/test/lib/index.js b/test/lib/index.js index b9d5ea003..c79476f60 100644 --- a/test/lib/index.js +++ b/test/lib/index.js @@ -11,12 +11,10 @@ test("index.js exports all expected modules", (t) => { t.truthy(index.processors.jsdocGenerator, "Module exported"); t.truthy(index.processors.sdkTransformer, "Module exported"); t.truthy(index.processors.bootstrapHtmlTransformer, "Module exported"); - t.truthy(index.processors.debugFileCreator, "Module exported"); - t.truthy(index.processors.resourceCopier, "Module exported"); + t.truthy(index.processors.minifier, "Module exported"); t.truthy(index.processors.nonAsciiEscaper, "Module exported"); t.truthy(index.processors.stringReplacer, "Module exported"); t.truthy(index.processors.themeBuilder, "Module exported"); - t.truthy(index.processors.uglifier, "Module exported"); t.truthy(index.processors.versionInfoGenerator, "Module exported"); t.truthy(index.tasks.generateComponentPreload, "Module exported"); @@ -28,7 +26,7 @@ test("index.js exports all expected modules", (t) => { t.truthy(index.tasks.generateBundle, "Module exported"); t.truthy(index.tasks.generateCachebusterInfo, "Module exported"); t.truthy(index.tasks.buildThemes, "Module exported"); - t.truthy(index.tasks.createDebugFiles, "Module exported"); + t.truthy(index.tasks.minify, "Module exported"); t.truthy(index.tasks.executeJsdocSdkTransformation, "Module exported"); t.truthy(index.tasks.generateApiIndex, "Module exported"); t.truthy(index.tasks.generateJsdoc, "Module exported"); @@ -38,7 +36,6 @@ test("index.js exports all expected modules", (t) => { t.truthy(index.tasks.replaceVersion, "Module exported"); t.truthy(index.tasks.replaceBuildtime, "Module exported"); t.truthy(index.tasks.transformBootstrapHtml, "Module exported"); - t.truthy(index.tasks.uglify, "Module exported"); t.truthy(index.tasks.taskRepository, "Module exported"); t.truthy(index.types.AbstractBuilder, "Module exported"); diff --git a/test/lib/lbt/bundle/Builder.js b/test/lib/lbt/bundle/Builder.js index f76295a33..c6146a75d 100644 --- a/test/lib/lbt/bundle/Builder.js +++ b/test/lib/lbt/bundle/Builder.js @@ -30,6 +30,9 @@ test.serial("writePreloadModule: with invalid json content", async (t) => { write: writeStub }; const invalidJsonResource = { + string: function() { + return this.buffer(); + }, buffer: async () => { return invalidJsonContent; } @@ -52,14 +55,23 @@ test("integration: createBundle with exposedGlobals", async (t) => { const pool = new ResourcePool(); pool.addResource({ name: "a.js", + string: function() { + return this.buffer(); + }, buffer: async () => "function One(){return 1;}" }); pool.addResource({ name: "ui5loader.js", + string: function() { + return this.buffer(); + }, buffer: async () => "" }); pool.addResource({ name: "a.library", + string: function() { + return this.buffer(); + }, buffer: async () => ` @@ -111,14 +123,23 @@ test("integration: createBundle EVOBundleFormat (ui5loader.js)", async (t) => { const pool = new ResourcePool(); pool.addResource({ name: "ui5loader.js", + string: function() { + return this.buffer(); + }, buffer: async () => "(function(__global) {sap.ui.require = function(){};}(window));" }); pool.addResource({ name: "jquery.sap.global-dbg.js", + string: function() { + return this.buffer(); + }, buffer: async () => "sap.ui.define([], function(){return {};});" }); pool.addResource({ name: "myModule.js", + string: function() { + return this.buffer(); + }, buffer: async () => "(function(){window.mine = {};}());" }); @@ -153,7 +174,7 @@ sap.ui.require.preload({ (function(){window.mine = {};}()); sap.ui.requireSync("ui5loader"); `; - t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optomization and " + + t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optimization and " + "should contain:" + " preload part from jquery.sap.global-dbg.js" + " raw part from myModule.js" + @@ -168,22 +189,37 @@ test("integration: createBundle EVOBundleFormat, using predefine calls", async ( const pool = new ResourcePool(); pool.addResource({ name: "ui5loader.js", + string: function() { + return this.buffer(); + }, buffer: async () => "(function(__global) {sap.ui.require = function(){};}(window));" }); pool.addResource({ // the pool must contain this to activate optimization markers name: "jquery.sap.global-dbg.js", + string: function() { + return this.buffer(); + }, buffer: async () => "sap.ui.define([], function(){return {};});" }); pool.addResource({ name: "jquery.sap.global.js", + string: function() { + return this.buffer(); + }, buffer: async () => "sap.ui.define([], function(){return {};});" }); pool.addResource({ name: "jquery.sap.pony1.js", + string: function() { + return this.buffer(); + }, buffer: async () => "sap.ui.define(); // hello" }); pool.addResource({ name: "jquery.sap.pony2.js", + string: function() { + return this.buffer(); + }, buffer: async () => `sap. ui.define /*hello*/ @@ -191,10 +227,16 @@ test("integration: createBundle EVOBundleFormat, using predefine calls", async ( }); pool.addResource({ name: "myRawModule.js", + string: function() { + return this.buffer(); + }, buffer: async () => "(function(){window.mine = {};}());" }); pool.addResource({ name: "myModuleUsingGlobalScope.js", + string: function() { + return this.buffer(); + }, buffer: async () => "var magic = {};" }); @@ -231,17 +273,20 @@ test("integration: createBundle EVOBundleFormat, using predefine calls", async ( t.deepEqual(oResult.name, "Component-preload.js"); const expectedContent = `//@ui5-bundle Component-preload.js window["sap-ui-optimized"] = true; -sap.ui.predefine("jquery.sap.global",[],function(){return{}}); -sap.ui.predefine("jquery.sap.pony1"); -sap.ui.predefine("jquery.sap.pony2"); +sap.ui.predefine("jquery.sap.global", [], function(){return {};}); +sap.ui.predefine("jquery.sap.pony1"); // hello +sap. + ui.predefine + /*hello*/ + ("jquery.sap.pony2"); sap.ui.require.preload({ - "myModuleUsingGlobalScope.js":'var magic={};' + "myModuleUsingGlobalScope.js":'var magic = {};' },"preload-section"); //@ui5-bundle-raw-include myRawModule.js -(function(){window.mine={}})(); +(function(){window.mine = {};}()); sap.ui.requireSync("ui5loader"); `; - t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optomization and " + + t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optimization and " + "should contain:" + " preload part from jquery.sap.global-dbg.js" + " raw part from myModule.js" + @@ -262,22 +307,37 @@ test("integration: createBundle EVOBundleFormat, using predefine calls, no optim const pool = new ResourcePool(); pool.addResource({ name: "ui5loader.js", + string: function() { + return this.buffer(); + }, buffer: async () => "(function(__global) {sap.ui.require = function(){};}(window));" }); pool.addResource({ // the pool must contain this to activate optimization markers name: "jquery.sap.global-dbg.js", + string: function() { + return this.buffer(); + }, buffer: async () => "sap.ui.define([], function(){return {};});" }); pool.addResource({ name: "jquery.sap.global.js", + string: function() { + return this.buffer(); + }, buffer: async () => "sap.ui.define([], function(){return {};});" }); pool.addResource({ name: "jquery.sap.pony1.js", + string: function() { + return this.buffer(); + }, buffer: async () => "sap.ui.define(); // hello" }); pool.addResource({ name: "jquery.sap.pony2.js", + string: function() { + return this.buffer(); + }, buffer: async () => `sap. ui.define /*hello*/ @@ -285,10 +345,16 @@ test("integration: createBundle EVOBundleFormat, using predefine calls, no optim }); pool.addResource({ name: "myRawModule.js", + string: function() { + return this.buffer(); + }, buffer: async () => "(function(){window.mine = {};}());" }); pool.addResource({ name: "myModuleUsingGlobalScope.js", + string: function() { + return this.buffer(); + }, buffer: async () => "var magic = {};" }); @@ -338,7 +404,7 @@ sap.ui.require.preload({ (function(){window.mine = {};}()); sap.ui.requireSync("ui5loader"); `; - t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optomization and " + + t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optimization and " + "should contain:" + " preload part from jquery.sap.global-dbg.js" + " raw part from myModule.js" + @@ -359,10 +425,16 @@ test("integration: createBundle (bootstrap bundle)", async (t) => { const pool = new ResourcePool(); pool.addResource({ name: "ui5loader.js", + string: function() { + return this.buffer(); + }, buffer: async () => "(function(__global) {sap.ui.require = function(){};}(window));" }); pool.addResource({ name: "sap/ui/core/Core.js", + string: function() { + return this.buffer(); + }, buffer: async () => "sap.ui.define([],function(){return {};});" }); @@ -397,8 +469,8 @@ test("integration: createBundle (bootstrap bundle)", async (t) => { window["sap-ui-optimized"] = true; try { //@ui5-bundle-raw-include ui5loader.js -(function(i){sap.ui.require=function(){}})(window); -sap.ui.predefine("sap/ui/core/Core",[],function(){return{}}); +(function(__global) {sap.ui.require = function(){};}(window)); +sap.ui.predefine("sap/ui/core/Core", [],function(){return {};}); sap.ui.requireSync("sap/ui/core/Core"); // as this module contains the Core, we ensure that the Core has been booted sap.ui.getCore().boot && sap.ui.getCore().boot(); @@ -406,7 +478,7 @@ sap.ui.getCore().boot && sap.ui.getCore().boot(); if (oError.name != "Restart") { throw oError; } } `; - t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optomization and " + + t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optimization and " + "should contain:" + " preload part from jquery.sap.global-dbg.js" + " raw part from myModule.js" + @@ -421,14 +493,23 @@ test("integration: createBundle UI5BundleFormat (non ui5loader.js)", async (t) = const pool = new ResourcePool(); pool.addResource({ name: "sap-ui-core.js", + string: function() { + return this.buffer(); + }, buffer: async () => "(function(__global) {sap.ui.require = function(){};}(window));" }); pool.addResource({ name: "jquery.sap.global-dbg.js", + string: function() { + return this.buffer(); + }, buffer: async () => "sap.ui.define([], function(){/* comment */ return {};});" }); pool.addResource({ name: "myModule.js", + string: function() { + return this.buffer(); + }, buffer: async () => "(function(){window.mine = {};}());" }); @@ -480,18 +561,23 @@ test("integration: createBundle (bootstrap bundle, UI5BundleFormat)", async (t) const pool = new ResourcePool(); pool.addResource({ name: "jquery.sap.global.js", - buffer: async () => "(function(__global) {sap.ui.require = function(){};}(window));" - }); - pool.addResource({ - name: "jquery.sap.global-dbg.js", + string: function() { + return this.buffer(); + }, buffer: async () => "(function(__global) {sap.ui.require = function(){};}(window));" }); pool.addResource({ name: "myRawModule.js", + string: function() { + return this.buffer(); + }, buffer: async () => "(function(){window.mine = {};}());" }); pool.addResource({ name: "sap/ui/core/Core.js", + string: function() { + return this.buffer(); + }, buffer: async () => "sap.ui.define([],function(){return {};});" }); @@ -526,12 +612,12 @@ test("integration: createBundle (bootstrap bundle, UI5BundleFormat)", async (t) window["sap-ui-optimized"] = true; try { //@ui5-bundle-raw-include jquery.sap.global.js -(function(i){sap.ui.require=function(){}})(window); +(function(__global) {sap.ui.require = function(){};}(window)); //@ui5-bundle-raw-include myRawModule.js -(function(){window.mine={}})(); +(function(){window.mine = {};}()); jQuery.sap.declare('jquery.sap.global', false); jQuery.sap.declare('myRawModule', false); -sap.ui.predefine("sap/ui/core/Core",[],function(){return{}}); +sap.ui.predefine("sap/ui/core/Core", [],function(){return {};}); sap.ui.requireSync("sap/ui/core/Core"); // as this module contains the Core, we ensure that the Core has been booted sap.ui.getCore().boot && sap.ui.getCore().boot(); @@ -539,7 +625,7 @@ sap.ui.getCore().boot && sap.ui.getCore().boot(); if (oError.name != "Restart") { throw oError; } } `; - t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optomization and " + + t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optimization and " + "should contain:" + " preload part from jquery.sap.global-dbg.js" + " raw part from myModule.js" + @@ -564,22 +650,37 @@ test("integration: createBundle with bundleInfo", async (t) => { const pool = new ResourcePool(); pool.addResource({ name: "a.js", + string: function() { + return this.buffer(); + }, buffer: async () => "function One(){return 1;}" }); pool.addResource({ name: "b.js", + string: function() { + return this.buffer(); + }, buffer: async () => "function Two(){return 2;}" }); pool.addResource({ name: "c.js", + string: function() { + return this.buffer(); + }, buffer: async () => "function Three(){return 3;}" }); pool.addResource({ name: "ui5loader.js", + string: function() { + return this.buffer(); + }, buffer: async () => "" }); pool.addResource({ name: "a.library", + string: function() { + return this.buffer(); + }, buffer: async () => ` diff --git a/test/lib/lbt/resources/Resource.js b/test/lib/lbt/resources/Resource.js index b6e0670ce..85a0e767b 100644 --- a/test/lib/lbt/resources/Resource.js +++ b/test/lib/lbt/resources/Resource.js @@ -5,7 +5,7 @@ const mock = require("mock-require"); let Resource = require("../../../../lib/lbt/resources/Resource"); test.serial("Resource: buffer", async (t) => { - const readFileStub = sinon.stub().callsArg(1); + const readFileStub = sinon.stub().callsArgWith(1, null, Buffer.from("content")); mock("graceful-fs", { readFile: readFileStub }); @@ -14,12 +14,32 @@ test.serial("Resource: buffer", async (t) => { // Re-require tested module Resource = mock.reRequire("../../../../lib/lbt/resources/Resource"); const resource = new Resource({}, "name", "file"); - await resource.buffer(); + const res = await resource.buffer(); mock.stop("graceful-fs"); t.is(readFileStub.callCount, 1, "called once"); t.is(readFileStub.getCall(0).args[0], "file", "called with file parameter"); + t.is(res.toString(), "content", "File content returned correctly"); +}); + +test.serial("Resource: string", async (t) => { + const readFileStub = sinon.stub().callsArgWith(1, null, Buffer.from("content")); + mock("graceful-fs", { + readFile: readFileStub + }); + mock.reRequire("graceful-fs"); + + // Re-require tested module + Resource = mock.reRequire("../../../../lib/lbt/resources/Resource"); + const resource = new Resource({}, "name", "file"); + const res = await resource.string(); + + mock.stop("graceful-fs"); + + t.is(readFileStub.callCount, 1, "called once"); + t.is(readFileStub.getCall(0).args[0], "file", "called with file parameter"); + t.is(res, "content", "File content returned correctly"); }); test.serial("Resource: constructor", async (t) => { diff --git a/test/lib/processors/minifier.js b/test/lib/processors/minifier.js new file mode 100644 index 000000000..e204ca268 --- /dev/null +++ b/test/lib/processors/minifier.js @@ -0,0 +1,225 @@ +const test = require("ava"); + +const minifier = require("../../../lib/processors/minifier"); +const ui5Fs = require("@ui5/fs"); +const resourceFactory = ui5Fs.resourceFactory; + +test("Basic minifier", async (t) => { + const content = `/*! + * \${copyright} + */ + function myFunc(myArg) { + jQuery.sap.require("something"); + console.log("Something required") + } +myFun(); +`; + const testResource = resourceFactory.createResource({ + path: "/test.controller.js", + string: content + }); + const [{resource, dbgResource, sourceMapResource}] = await minifier({ + resources: [testResource] + }); + + const expected = `/*! + * \${copyright} + */ +function myFunc(e){jQuery.sap.require("something");console.log("Something required")}myFun(); +//# sourceMappingURL=test.controller.js.map`; + t.deepEqual(await resource.getString(), expected, "Correct minified content"); + t.deepEqual(await dbgResource.getString(), content, "Correct debug content"); + const expectedSourceMap = `{"version":3,"sources":["test-dbg.controller.js"],` + + `"names":["myFunc","myArg","jQuery","sap","require","console","log","myFun"],` + + `"mappings":";;;AAGC,SAASA,OAAOC,GACfC,OAAOC,IAAIC,QAAQ,aACnBC,QAAQC,IAAI,sBAEdC",` + + `"file":"test.controller.js"}`; + t.deepEqual(await sourceMapResource.getString(), expectedSourceMap, "Correct source map content"); +}); + +test("Multiple resources", async (t) => { + const content1 = ` +function test1(paramA) { + var variableA = paramA; + console.log(variableA); +} +test1();`; + const content2 = ` +function test2(paramA) { + var variableA = paramA; + console.log(variableA); +} +test2();`; + const content3 = ` +function test3(paramA) { + var variableA = paramA; + console.log(variableA); +} +test3();`; + + const testResources = [ + resourceFactory.createResource({ + path: "/test1.controller.js", + string: content1 + }), + resourceFactory.createResource({ + path: "/test2.fragment.js", + string: content2 + }), + resourceFactory.createResource({ + path: "/test3.designtime.js", + string: content3 + }) + ]; + + const resources = await minifier({ + resources: testResources + }); + + const expectedMinified1 = `function test1(t){var o=t;console.log(o)}test1(); +//# sourceMappingURL=test1.controller.js.map`; + const expectedMinified2 = `function test2(t){var o=t;console.log(o)}test2(); +//# sourceMappingURL=test2.fragment.js.map`; + const expectedMinified3 = `function test3(t){var o=t;console.log(o)}test3(); +//# sourceMappingURL=test3.designtime.js.map`; + + const expectedSourceMap1 = + `{"version":3,"sources":["test1-dbg.controller.js"],"names":["test1","paramA","variableA","console","log"],` + + `"mappings":"AACA,SAASA,MAAMC,GACd,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test1.controller.js"}`; + const expectedSourceMap2 = + `{"version":3,"sources":["test2-dbg.fragment.js"],"names":["test2","paramA","variableA","console","log"],` + + `"mappings":"AACA,SAASA,MAAMC,GACd,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test2.fragment.js"}`; + const expectedSourceMap3 = + `{"version":3,"sources":["test3-dbg.designtime.js"],"names":["test3","paramA","variableA","console","log"],` + + `"mappings":"AACA,SAASA,MAAMC,GACd,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test3.designtime.js"}`; + + t.deepEqual(resources[0].resource.getPath(), "/test1.controller.js", + "Correct resource path for minified content of resource 1"); + t.deepEqual(await resources[0].resource.getString(), expectedMinified1, "Correct minified content for resource 1"); + t.deepEqual(resources[0].dbgResource.getPath(), "/test1-dbg.controller.js", + "Correct resource path for debug content of resource 1"); + t.deepEqual(await resources[0].dbgResource.getString(), content1, "Correct debug content for resource 1"); + t.deepEqual(resources[0].sourceMapResource.getPath(), "/test1.controller.js.map", + "Correct resource path for source map content of resource 1"); + t.deepEqual(await resources[0].sourceMapResource.getString(), expectedSourceMap1, + "Correct source map content for resource 1"); + + t.deepEqual(resources[1].resource.getPath(), "/test2.fragment.js", + "Correct resource path for minified content of resource 2"); + t.deepEqual(await resources[1].resource.getString(), expectedMinified2, "Correct minified content for resource 2"); + t.deepEqual(resources[1].dbgResource.getPath(), "/test2-dbg.fragment.js", + "Correct resource path for debug content of resource 2"); + t.deepEqual(await resources[1].dbgResource.getString(), content2, "Correct debug content for resource 2"); + t.deepEqual(resources[1].sourceMapResource.getPath(), "/test2.fragment.js.map", + "Correct resource path for source map content of resource 2"); + t.deepEqual(await resources[1].sourceMapResource.getString(), expectedSourceMap2, + "Correct source map content for resource 2"); + + t.deepEqual(resources[2].resource.getPath(), "/test3.designtime.js", + "Correct resource path for minified content of resource 3"); + t.deepEqual(await resources[2].resource.getString(), expectedMinified3, "Correct minified content for resource 3"); + t.deepEqual(resources[2].dbgResource.getPath(), "/test3-dbg.designtime.js", + "Correct resource path for debug content of resource 3"); + t.deepEqual(await resources[2].dbgResource.getString(), content3, "Correct debug content for resource 3"); + t.deepEqual(resources[2].sourceMapResource.getPath(), "/test3.designtime.js.map", + "Correct resource path for source map content of resource 3"); + t.deepEqual(await resources[2].sourceMapResource.getString(), expectedSourceMap3, + "Correct source map content for resource 3"); +}); + +test("Different copyright", async (t) => { + const content = ` +/* + * Copyright SAPUI5 Developers and other contributors + */ +function test(paramA) { + var variableA = paramA; + console.log(variableA); +} +test(); +`; + const testResource = resourceFactory.createResource({ + path: "/test.view.js", + string: content + }); + const [{resource, dbgResource, sourceMapResource}] = await minifier({ + resources: [testResource] + }); + + const expected = `/* + * Copyright SAPUI5 Developers and other contributors + */ +function test(t){var o=t;console.log(o)}test(); +//# sourceMappingURL=test.view.js.map`; + t.deepEqual(await resource.getString(), expected, "Correct minified content"); + t.deepEqual(await dbgResource.getString(), content, "Correct debug content"); + const expectedSourceMap = + `{"version":3,"sources":["test-dbg.view.js"],"names":["test","paramA","variableA","console","log"],` + + `"mappings":";;;AAIA,SAASA,KAAKC,GACb,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test.view.js"}`; + t.deepEqual(await sourceMapResource.getString(), expectedSourceMap, "Correct source map content"); +}); + +test("minify raw module (@ui5-bundle-raw-include)", async (t) => { + const content = ` +//@ui5-bundle-raw-include sap/ui/my/module.js +function test(paramA) { + var variableA = paramA; + console.log(variableA); +} +test();`; + + const testResource = resourceFactory.createResource({ + path: "/test.js", + string: content + }); + const [{resource}] = await minifier({ + resources: [testResource] + }); + + const expected = `//@ui5-bundle-raw-include sap/ui/my/module.js +function test(t){var o=t;console.log(o)}test(); +//# sourceMappingURL=test.js.map`; + t.deepEqual(await resource.getString(), expected, "Correct minified content"); +}); + +test("minify raw module (@ui5-bundle)", async (t) => { + const content = ` +//@ui5-bundle sap/ui/my/module.js +function test(paramA) { + var variableA = paramA; + console.log(variableA); +} +test();`; + + const testResource = resourceFactory.createResource({ + path: "/test.js", + string: content + }); + const [{resource}] = await minifier({ + resources: [testResource] + }); + + const expected = `//@ui5-bundle sap/ui/my/module.js +function test(t){var o=t;console.log(o)}test(); +//# sourceMappingURL=test.js.map`; + t.deepEqual(await resource.getString(), expected, "Correct minified content"); +}); + + +test("minification error", async (t) => { + const content = ` +this code can't be parsed!`; + + const testResource = resourceFactory.createResource({ + path: "/test.js", + string: content + }); + const error = await t.throwsAsync(minifier({ + resources: [testResource] + })); + + t.regex(error.message, /Minification failed with error/, "Error should contain expected message"); + t.regex(error.message, /test\.js/, "Error should contain filename"); + t.regex(error.message, /col/, "Error should contain col"); + t.regex(error.message, /pos/, "Error should contain pos"); + t.regex(error.message, /line/, "Error should contain line"); +}); diff --git a/test/lib/tasks/bundlers/generateLibraryPreload.integration.js b/test/lib/tasks/bundlers/generateLibraryPreload.integration.js index 6fc816ac0..d5e99f08e 100644 --- a/test/lib/tasks/bundlers/generateLibraryPreload.integration.js +++ b/test/lib/tasks/bundlers/generateLibraryPreload.integration.js @@ -85,7 +85,7 @@ test("integration: build sap.ui.core with library preload", async (t) => { const destPath = "./test/tmp/build/sap.ui.core/preload"; const expectedPath = "./test/expected/build/sap.ui.core/preload"; const excludedTasks = ["*"]; - const includedTasks = ["generateLibraryPreload"]; + const includedTasks = ["minify", "generateLibraryPreload"]; return t.notThrowsAsync(builder.build({ tree: sapUiCoreTree, @@ -99,7 +99,7 @@ test("integration: build sap.ui.core with library preload", async (t) => { assert.directoryDeepEqual(destPath, expectedPath); // Check for all file contents - t.deepEqual(expectedFiles.length, 10, "10 files are expected"); + t.deepEqual(expectedFiles.length, 23, "23 files are expected"); expectedFiles.forEach((expectedFile) => { const relativeFile = path.relative(expectedPath, expectedFile); const destFile = path.join(destPath, relativeFile); diff --git a/test/lib/tasks/bundlers/generateStandaloneAppBundle.integration.js b/test/lib/tasks/bundlers/generateStandaloneAppBundle.integration.js index 7b57bb565..141886858 100644 --- a/test/lib/tasks/bundlers/generateStandaloneAppBundle.integration.js +++ b/test/lib/tasks/bundlers/generateStandaloneAppBundle.integration.js @@ -34,7 +34,7 @@ test("integration: build application.b standalone", async (t) => { const destPath = "./test/tmp/build/application.b/standalone"; const expectedPath = "./test/expected/build/application.b/standalone"; const excludedTasks = ["*"]; - const includedTasks = ["generateStandaloneAppBundle"]; + const includedTasks = ["minify", "generateStandaloneAppBundle"]; return builder.build({ tree: applicationBTree, diff --git a/test/lib/tasks/bundlers/generateStandaloneAppBundle.js b/test/lib/tasks/bundlers/generateStandaloneAppBundle.js index 774092cdf..b7a4e9766 100644 --- a/test/lib/tasks/bundlers/generateStandaloneAppBundle.js +++ b/test/lib/tasks/bundlers/generateStandaloneAppBundle.js @@ -21,15 +21,19 @@ test.afterEach.always((t) => { sinon.restore(); }); -test.serial("execute module bundler and write results", async (t) => { - const dummyResource = { +function createDummyResource(id) { + return { getPath: function() { - return "ponyPath"; + return "ponyPath" + id; } }; +} + +test.serial("execute module bundler and write results", async (t) => { + let dummyResourceId = 0; const dummyReaderWriter = { - byGlob: async function() { - return [dummyResource, dummyResource]; + _byGlob: async function() { + return [createDummyResource(dummyResourceId++), createDummyResource(dummyResourceId++)]; }, write: function() {} }; @@ -73,14 +77,10 @@ test.serial("execute module bundler and write results", async (t) => { }); test.serial("execute module bundler and write results without namespace", async (t) => { - const dummyResource = { - getPath: function() { - return "ponyPath"; - } - }; + let dummyResourceId = 0; const dummyReaderWriter = { - byGlob: async function() { - return [dummyResource, dummyResource]; + _byGlob: async function() { + return [createDummyResource(dummyResourceId++), createDummyResource(dummyResourceId++)]; }, write: function() {} }; @@ -113,14 +113,19 @@ test.serial("execute module bundler and write results without namespace", async test.serial("execute module bundler and write results in evo mode", async (t) => { - const dummyResource = { + let dummyResourceId = 0; + + const ui5LoaderDummyResource = { getPath: function() { return "/resources/ui5loader.js"; // Triggers evo mode } }; const dummyReaderWriter = { - byGlob: async function() { - return [dummyResource, dummyResource]; + _byGlob: async function() { + if (dummyResourceId === 0) { + return [ui5LoaderDummyResource, createDummyResource(dummyResourceId++)]; + } + return [createDummyResource(dummyResourceId++), createDummyResource(dummyResourceId++)]; }, write: function() {} }; diff --git a/test/lib/tasks/createDebugFiles.js b/test/lib/tasks/createDebugFiles.js deleted file mode 100644 index 0f49d7fdf..000000000 --- a/test/lib/tasks/createDebugFiles.js +++ /dev/null @@ -1,419 +0,0 @@ -const test = require("ava"); - -const createDebugFiles = require("../../../lib/tasks/createDebugFiles"); -const ui5Fs = require("@ui5/fs"); -const resourceFactory = ui5Fs.resourceFactory; - -test("integration: test.js: dbg file creation", (t) => { - const sourceAdapter = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const content = "console.log('Hello World');"; - - const resource = resourceFactory.createResource({ - path: "/test.js", - string: content - }); - - return sourceAdapter.write(resource).then(() => { - return createDebugFiles({ - workspace: sourceAdapter, - options: { - pattern: "/**/*.js" - } - }).then(() => { - return sourceAdapter.byPath("/test-dbg.js").then((resource) => { - if (!resource) { - t.fail("Could not find /test-dbg.js in target"); - } else { - return resource.getBuffer(); - } - }); - }).then((buffer) => { - t.deepEqual(buffer.toString(), content, "Correct content"); - }); - }); -}); - -test("integration: test.view.js: dbg file creation", (t) => { - const sourceAdapter = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const content = "console.log('Hello World');"; - - const resource = resourceFactory.createResource({ - path: "/test.view.js", - string: content - }); - - return sourceAdapter.write(resource).then(() => { - return createDebugFiles({ - workspace: sourceAdapter, - options: { - pattern: "/**/*.js" - } - }).then(() => { - return sourceAdapter.byPath("/test-dbg.view.js").then((resource) => { - if (!resource) { - t.fail("Could not find /test-dbg.view.js in target"); - } else { - return resource.getBuffer(); - } - }); - }).then((buffer) => { - t.deepEqual(buffer.toString(), content, "Correct content"); - }); - }); -}); - -test("integration: test.controller.js: dbg file creation", (t) => { - const sourceAdapter = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const content = "console.log('Hello World');"; - - const resource = resourceFactory.createResource({ - path: "/test.controller.js", - string: content - }); - - return sourceAdapter.write(resource).then(() => { - return createDebugFiles({ - workspace: sourceAdapter, - options: { - pattern: "/**/*.js" - } - }).then(() => { - return sourceAdapter.byPath("/test-dbg.controller.js").then((resource) => { - if (!resource) { - t.fail("Could not find /test-dbg.controller.js in target"); - } else { - return resource.getBuffer(); - } - }); - }).then((buffer) => { - t.deepEqual(buffer.toString(), content, "Correct content"); - }); - }); -}); - -test("integration: test.designtime.js: dbg file creation", (t) => { - const sourceAdapter = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const content = "sap.ui.define([],function(){return {};});"; - - const resource = resourceFactory.createResource({ - path: "/test.designtime.js", - string: content - }); - - return sourceAdapter.write(resource).then(() => { - return createDebugFiles({ - workspace: sourceAdapter, - options: { - pattern: "/**/*.js" - } - }).then(() => { - return sourceAdapter.byPath("/test-dbg.designtime.js").then((resource) => { - if (!resource) { - t.fail("Could not find /test-dbg.designtime.js in target"); - } else { - return resource.getBuffer(); - } - }); - }).then((buffer) => { - t.deepEqual(buffer.toString(), content, "Correct content"); - }); - }); -}); - -test("integration: test.fragment.js: dbg file creation", (t) => { - const sourceAdapter = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const content = "console.log('Hello World');"; - - const resource = resourceFactory.createResource({ - path: "/test.fragment.js", - string: content - }); - - return sourceAdapter.write(resource).then(() => { - return createDebugFiles({ - workspace: sourceAdapter, - options: { - pattern: "/**/*.js" - } - }).then(() => { - return sourceAdapter.byPath("/test-dbg.fragment.js").then((resource) => { - if (!resource) { - t.fail("Could not find /test-dbg.fragment.js in target locator"); - } else { - return resource.getBuffer(); - } - }); - }).then((buffer) => { - t.deepEqual(buffer.toString(), content, "Correct content"); - }); - }); -}); - -test("integration: test.support.js: dbg file creation", (t) => { - const sourceAdapter = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const content = "sap.ui.define([],function(){return {};});"; - - const resource = resourceFactory.createResource({ - path: "/test.support.js", - string: content - }); - - return sourceAdapter.write(resource).then(() => { - return createDebugFiles({ - workspace: sourceAdapter, - options: { - pattern: "/**/*.js" - } - }).then(() => { - return sourceAdapter.byPath("/test-dbg.support.js").then((resource) => { - if (!resource) { - t.fail("Could not find /test-dbg.support.js in target"); - } else { - return resource.getBuffer(); - } - }); - }).then((buffer) => { - t.deepEqual(buffer.toString(), content, "Correct content"); - }); - }); -}); - -test("integration: test-dbg.js: dbg-dbg file creation", (t) => { - const sourceAdapter = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const content = "console.log('Hello World');"; - - const resource = resourceFactory.createResource({ - path: "/test-dbg.js", - string: content - }); - - return sourceAdapter.write(resource).then(() => { - return createDebugFiles({ - workspace: sourceAdapter, - options: { - pattern: "/**/*.js" - } - }).then(() => { - return sourceAdapter.byPath("/test-dbg-dbg.js").then((resource) => { - if (!resource) { - t.fail("Could not find /test-dbg-dbg.js in target locator"); - } else { - return resource.getBuffer(); - } - }); - }).then((buffer) => { - t.deepEqual(buffer.toString(), content, "Correct content"); - }); - }); -}); - -test("integration: test.xml: *no* dbg file creation", (t) => { - const sourceAdapter = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const content = ""; - - const resource = resourceFactory.createResource({ - path: "/test.xml", - string: content - }); - - return sourceAdapter.write(resource).then(() => { - return createDebugFiles({ - workspace: sourceAdapter, - options: { - pattern: "/**/*.js" - } - }).then(() => { - return sourceAdapter.byPath("/test-dbg.xml").then((resource) => { - if (!resource) { - t.pass("Could not find /test-dbg.xml in target locator as it is not a JavaScript file"); - } else { - t.fail("Found /test-dbg.xml which should not be there (no JavaScript file)"); - } - }); - }); - }); -}); - -test("integration: test1.js, test2.js: dbg file creation", (t) => { - const sourceAdapter = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const content = "console.log('Hello World');"; - - const resources = [ - resourceFactory.createResource({ - path: "/test1.js", - string: content - }), - resourceFactory.createResource({ - path: "/test2.js", - string: content - }) - ]; - - return Promise.all(resources.map((resource) => { - return sourceAdapter.write(resource); - })).then(() => { - return createDebugFiles({ - workspace: sourceAdapter, - options: { - pattern: "/**/*.js" - } - }).then(() => { - return Promise.all([ - sourceAdapter.byPath("/test1-dbg.js"), - sourceAdapter.byPath("/test2-dbg.js") - ]).then((resources) => { - if (!resources || !resources[0] || !resources[1]) { - t.fail("Could not find /test1-dbg.js and/or /test2-dbg.js in target locator"); - } else { - return Promise.all(resources.map((resource) => { - return resource.getBuffer(); - })); - } - }); - }).then((buffers) => { - t.deepEqual(buffers[0].toString(), content, "Content of /test1-dbg.js is correct"); - t.deepEqual(buffers[1].toString(), content, "Content of /test2-dbg.js is correct"); - }); - }); -}); - -test("integration: dbg file creation should not overwrite the existing -dbg file", (t) => { - const sourceAdapter = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const content = "console.log('Hello World');"; - const resource = resourceFactory.createResource({ - path: "/test1.js", - string: content - }); - - const contentDebug = "console.log('Hello Debug World')"; - const debugResource = resourceFactory.createResource({ - path: "/test1-dbg.js", - string: contentDebug - }); - - const workspace = resourceFactory.createWorkspace({ - reader: sourceAdapter - }); - - return Promise.all([ - sourceAdapter.write(resource), - workspace.write(debugResource) - ]).then(() => { - return createDebugFiles({ - workspace, - options: { - pattern: "/**/*.js" - } - }).then(() => { - return workspace.byPath("/test1-dbg.js").then((resource) => { - if (!resource) { - t.fail("Could not find the existing /test1-dbg.js"); - } else { - return resource.getBuffer(); - } - }); - }).then((buffer) => { - t.deepEqual(buffer.toString(), contentDebug, "Content of /test1-dbg.js is correct"); - }); - }); -}); - -test("integration: add '-dbg' suffix only to files and not to the folders in the path", (t) => { - const sourceAdapter = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const content = "console.log('Hello World');"; - const resources = [ - resourceFactory.createResource({ - path: "/someFolder/test.js/test.js", - string: content - }), - resourceFactory.createResource({ - path: "/someFolder/test.view.js/test.view.js", - string: content - }), - resourceFactory.createResource({ - path: "/someFolder/test.fragment.js/test.fragment.js", - string: content - }), - resourceFactory.createResource({ - path: "/someFolder/test.controller.js/test.controller.js", - string: content - }), - resourceFactory.createResource({ - path: "/someFolder/test.designtime.js/test.designtime.js", - string: content - }), - resourceFactory.createResource({ - path: "/someFolder/test.support.js/test.support.js", - string: content - }) - ]; - - return Promise.all(resources.map((resource) => { - return sourceAdapter.write(resource); - })).then(() => { - return createDebugFiles({ - workspace: sourceAdapter, - options: { - pattern: "/**/*.js" - } - }).then(() => { - return Promise.all([ - sourceAdapter.byPath("/someFolder/test.js/test-dbg.js"), - sourceAdapter.byPath("/someFolder/test.view.js/test-dbg.view.js"), - sourceAdapter.byPath("/someFolder/test.fragment.js/test-dbg.fragment.js"), - sourceAdapter.byPath("/someFolder/test.controller.js/test-dbg.controller.js"), - sourceAdapter.byPath("/someFolder/test.designtime.js/test-dbg.designtime.js"), - sourceAdapter.byPath("/someFolder/test.support.js/test-dbg.support.js"), - ]).then((resources) => { - if (!resources || resources.length !== 6) { - t.fail("Could not find all created debug files in target locator"); - } else { - return Promise.all(resources.map((resource) => { - return resource.getBuffer(); - })); - } - }); - }).then((buffers) => { - t.deepEqual(buffers[0].toString(), content, - "Content of '/someFolder/test.js/test-dbg.js' is correct" - ); - t.deepEqual(buffers[1].toString(), content, - "Content of '/someFolder/test.view.js/test-dbg.view.js' is correct" - ); - t.deepEqual(buffers[2].toString(), content, - "Content of '/someFolder/test.fragment.js/test-dbg.fragment.js' is correct" - ); - t.deepEqual(buffers[3].toString(), content, - "Content of '/someFolder/test.controller.js/test-dbg.controller.js' is correct" - ); - t.deepEqual(buffers[4].toString(), content, - "Content of '/someFolder/test.designtime.js/test-dbg.designtime.js' is correct" - ); - t.deepEqual(buffers[5].toString(), content, - "Content of '/someFolder/test.support.js/test-dbg.support.js' is correct" - ); - }); - }); -}); diff --git a/test/lib/tasks/minify.js b/test/lib/tasks/minify.js new file mode 100644 index 000000000..9517de151 --- /dev/null +++ b/test/lib/tasks/minify.js @@ -0,0 +1,77 @@ +const test = require("ava"); +const sinon = require("sinon"); + +const minify = require("../../../lib/tasks/minify"); +const ui5Fs = require("@ui5/fs"); +const resourceFactory = ui5Fs.resourceFactory; +const DuplexCollection = ui5Fs.DuplexCollection; + +test.afterEach.always((t) => { + sinon.restore(); +}); + +test("integration: minify", async (t) => { + const taskUtil = { + setTag: sinon.stub(), + STANDARD_TAGS: { + HasDebugVariant: "1️⃣", + IsDebugVariant: "2️⃣" + } + }; + const reader = resourceFactory.createAdapter({ + virBasePath: "/" + }); + const writer = resourceFactory.createAdapter({ + virBasePath: "/" + }); + const duplexCollection = new DuplexCollection({reader: reader, writer: writer}); + const content = ` +function test(paramA) { + var variableA = paramA; + console.log(variableA); +} +test();`; + const testResource = resourceFactory.createResource({ + path: "/test.js", + string: content + }); + await reader.write(testResource); + + await minify({ + workspace: duplexCollection, + taskUtil, + options: { + pattern: "/test.js" + } + }); + + const expected = `function test(t){var o=t;console.log(o)}test(); +//# sourceMappingURL=test.js.map`; + const res = await writer.byPath("/test.js"); + if (!res) { + t.fail("Could not find /test.js in target locator"); + } + t.deepEqual(await res.getString(), expected, "Correct file content"); + + const resDbg = await writer.byPath("/test-dbg.js"); + if (!resDbg) { + t.fail("Could not find /test-dbg.js in target locator"); + } + t.deepEqual(await resDbg.getString(), content, "Correct debug-file content"); + + const expectedSourceMap = + `{"version":3,"sources":["test-dbg.js"],"names":["test","paramA","variableA","console","log"],` + + `"mappings":"AACA,SAASA,KAAKC,GACb,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test.js"}`; + + const resSourceMap = await writer.byPath("/test.js.map"); + if (!resSourceMap) { + t.fail("Could not find /test-dbg.js.map in target locator"); + } + t.deepEqual(await resSourceMap.getString(), expectedSourceMap, "Correct source map content"); + + t.is(taskUtil.setTag.callCount, 2, "taskUtil.setTag was called twice"); + t.deepEqual(taskUtil.setTag.getCall(0).args, [res, "1️⃣"], "First taskUtil.setTag call with expected arguments"); + t.deepEqual(taskUtil.setTag.getCall(1).args, [resDbg, "2️⃣"], + "Second taskUtil.setTag call with expected arguments"); +}); + diff --git a/test/lib/tasks/taskRepository.js b/test/lib/tasks/taskRepository.js index 720ab5518..7c1ce4323 100644 --- a/test/lib/tasks/taskRepository.js +++ b/test/lib/tasks/taskRepository.js @@ -24,6 +24,24 @@ test("Unknown task retrieval", (t) => { t.deepEqual(error.message, "taskRepository: Unknown Task not-existing", "Correct exception"); }); +test("Removed task retrieval", (t) => { + const error = t.throws(() => { + taskRepository.getTask("createDebugFiles"); + }); + t.deepEqual(error.message, + `Standard task createDebugFiles has been removed in UI5 Tooling 3.0. ` + + `Please see the migration guide at https://sap.github.io/ui5-tooling/updates/migrate-v3/`, + "Correct exception"); + + const error2 = t.throws(() => { + taskRepository.getTask("uglify"); + }); + t.deepEqual(error2.message, + `Standard task uglify has been removed in UI5 Tooling 3.0. ` + + `Please see the migration guide at https://sap.github.io/ui5-tooling/updates/migrate-v3/`, + "Correct exception"); +}); + test("Duplicate task", (t) => { const myTask = {}; taskRepository.addTask("myOtherTask", myTask); diff --git a/test/lib/tasks/uglify.js b/test/lib/tasks/uglify.js deleted file mode 100644 index 509dc350a..000000000 --- a/test/lib/tasks/uglify.js +++ /dev/null @@ -1,219 +0,0 @@ -const test = require("ava"); - -const uglify = require("../../../lib/tasks/uglify"); -const ui5Fs = require("@ui5/fs"); -const resourceFactory = ui5Fs.resourceFactory; -const DuplexCollection = ui5Fs.DuplexCollection; - -test("integration: uglify", (t) => { - const reader = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const writer = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const duplexCollection = new DuplexCollection({reader: reader, writer: writer}); - const content = ` -function test(paramA) { - var variableA = paramA; - console.log(variableA); -} -test();`; - const testResource = resourceFactory.createResource({ - path: "/test.js", - string: content - }); - const expected = "function test(t){var o=t;console.log(o)}test();"; - - return reader.write(testResource) - .then(() => { - return reader.byPath("/test.js"); - }).then(() => { - return uglify({ - workspace: duplexCollection, - options: { - pattern: "/test.js" - } - }); - }).then(() => { - return writer.byPath("/test.js").then((resource) => { - if (!resource) { - t.fail("Could not find /test.js in target locator"); - } else { - return resource.getBuffer(); - } - }); - }).then((buffer) => { - return t.deepEqual(buffer.toString(), expected, "Correct content"); - }); -}); - -test("integration: uglify copyright", (t) => { - const reader = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const writer = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const duplexCollection = new DuplexCollection({reader: reader, writer: writer}); - const content = ` -/* - * Copyright jQuery Foundation and other contributors - */ -function test(paramA) { - var variableA = paramA; - console.log(variableA); -} -test();`; - const testResource = resourceFactory.createResource({ - path: "/test.js", - string: content - }); - const expected = `/* - * Copyright jQuery Foundation and other contributors - */ -function test(t){var o=t;console.log(o)}test();`; - - return reader.write(testResource) - .then(() => { - return reader.byPath("/test.js"); - }).then(() => { - return uglify({ - workspace: duplexCollection, - options: { - pattern: "/test.js" - } - }); - }).then(() => { - return writer.byPath("/test.js").then((resource) => { - if (!resource) { - t.fail("Could not find /test.js in target locator"); - } else { - return resource.getBuffer(); - } - }); - }).then((buffer) => { - return t.deepEqual(buffer.toString(), expected, "Correct content"); - }); -}); - -test("integration: uglify raw module (@ui5-bundle-raw-include)", (t) => { - const reader = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const writer = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const duplexCollection = new DuplexCollection({reader: reader, writer: writer}); - const content = ` -//@ui5-bundle-raw-include sap/ui/my/module.js -function test(paramA) { - var variableA = paramA; - console.log(variableA); -} -test();`; - const testResource = resourceFactory.createResource({ - path: "/test.js", - string: content - }); - const expected = `//@ui5-bundle-raw-include sap/ui/my/module.js -function test(t){var o=t;console.log(o)}test();`; - - return reader.write(testResource) - .then(() => { - return reader.byPath("/test.js"); - }).then(() => { - return uglify({ - workspace: duplexCollection, - options: { - pattern: "/test.js" - } - }); - }).then(() => { - return writer.byPath("/test.js").then((resource) => { - if (!resource) { - t.fail("Could not find /test.js in target locator"); - } else { - return resource.getBuffer(); - } - }); - }).then((buffer) => { - return t.deepEqual(buffer.toString(), expected, "Correct content"); - }); -}); - -test("integration: uglify raw module (@ui5-bundle)", (t) => { - const reader = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const writer = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const duplexCollection = new DuplexCollection({reader: reader, writer: writer}); - const content = ` -//@ui5-bundle sap/ui/my/module.js -function test(paramA) { - var variableA = paramA; - console.log(variableA); -} -test();`; - const testResource = resourceFactory.createResource({ - path: "/test.js", - string: content - }); - const expected = `//@ui5-bundle sap/ui/my/module.js -function test(t){var o=t;console.log(o)}test();`; - - return reader.write(testResource) - .then(() => { - return reader.byPath("/test.js"); - }).then(() => { - return uglify({ - workspace: duplexCollection, - options: { - pattern: "/test.js" - } - }); - }).then(() => { - return writer.byPath("/test.js").then((resource) => { - if (!resource) { - t.fail("Could not find /test.js in target locator"); - } else { - return resource.getBuffer(); - } - }); - }).then((buffer) => { - return t.deepEqual(buffer.toString(), expected, "Correct content"); - }); -}); - -test("integration: uglify error handling", async (t) => { - const reader = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const writer = resourceFactory.createAdapter({ - virBasePath: "/" - }); - const duplexCollection = new DuplexCollection({reader: reader, writer: writer}); - const content = ` -this code can't be parsed!`; - const testResource = resourceFactory.createResource({ - path: "/test.js", - string: content - }); - - await reader.write(testResource); - - const error = await t.throwsAsync(uglify({ - workspace: duplexCollection, - options: { - pattern: "/test.js" - } - })); - - t.regex(error.message, /Uglification failed with error/, "Error should contain expected message"); - t.regex(error.message, /test\.js/, "Error should contain filename"); - t.regex(error.message, /col/, "Error should contain col"); - t.regex(error.message, /pos/, "Error should contain pos"); - t.regex(error.message, /line/, "Error should contain line"); -}); diff --git a/test/lib/types/AbstractBuilder.js b/test/lib/types/AbstractBuilder.js index 430036784..65033e58f 100644 --- a/test/lib/types/AbstractBuilder.js +++ b/test/lib/types/AbstractBuilder.js @@ -159,14 +159,14 @@ test("Instantiation with custom task and unknown beforeTask", (t) => { const project = clone(applicationBTree); project.builder = { customTasks: [{ - name: "uglify", + name: "minify", beforeTask: "someTask" }] }; const error = t.throws(() => { new CustomBuilder({project}); }); - t.deepEqual(error.message, "Could not find task someTask, referenced by custom task uglify, " + + t.deepEqual(error.message, "Could not find task someTask, referenced by custom task minify, " + "to be scheduled for project application.b", "Correct exception thrown"); }); diff --git a/test/lib/types/application/ApplicationBuilder.js b/test/lib/types/application/ApplicationBuilder.js index b37cb222f..4bf00ac38 100644 --- a/test/lib/types/application/ApplicationBuilder.js +++ b/test/lib/types/application/ApplicationBuilder.js @@ -62,12 +62,11 @@ test("Instantiation", (t) => { "replaceVersion", "generateFlexChangesBundle", "generateManifestBundle", + "minify", "generateComponentPreload", "generateStandaloneAppBundle", "transformBootstrapHtml", "generateBundle", - "createDebugFiles", - "uglify", "generateVersionInfo", "generateCachebusterInfo", "generateApiIndex", @@ -86,12 +85,11 @@ test("Instantiation without component preload project configuration", (t) => { "replaceVersion", "generateFlexChangesBundle", "generateManifestBundle", + "minify", "generateComponentPreload", "generateStandaloneAppBundle", "transformBootstrapHtml", "generateBundle", - "createDebugFiles", - "uglify", "generateVersionInfo", "generateCachebusterInfo", "generateApiIndex", @@ -110,11 +108,10 @@ test("Instantiation without project namespace", (t) => { "replaceCopyright", "replaceVersion", "generateFlexChangesBundle", + "minify", "generateStandaloneAppBundle", "transformBootstrapHtml", "generateBundle", - "createDebugFiles", - "uglify", "generateVersionInfo", "generateApiIndex", "generateResourcesJson" @@ -124,25 +121,24 @@ test("Instantiation without project namespace", (t) => { test("Instantiation with custom tasks", (t) => { const project = clone(applicationBTree); project.builder.customTasks = [ - {name: "replaceVersion", afterTask: "uglify"}, - {name: "uglify", beforeTask: "replaceVersion"} + {name: "replaceVersion", afterTask: "minify"}, + {name: "minify", beforeTask: "replaceVersion"} ]; const appBuilder = new ApplicationBuilder({parentLogger, project}); t.truthy(appBuilder); t.deepEqual(appBuilder.taskExecutionOrder, [ "escapeNonAsciiCharacters", "replaceCopyright", - "uglify--1", + "minify--1", "replaceVersion", "generateFlexChangesBundle", "generateManifestBundle", + "minify", + "replaceVersion--1", "generateComponentPreload", "generateStandaloneAppBundle", "transformBootstrapHtml", "generateBundle", - "createDebugFiles", - "uglify", - "replaceVersion--1", "generateVersionInfo", "generateCachebusterInfo", "generateApiIndex", diff --git a/test/lib/types/library/LibraryBuilder.js b/test/lib/types/library/LibraryBuilder.js index a6b483b82..4afcbbac7 100644 --- a/test/lib/types/library/LibraryBuilder.js +++ b/test/lib/types/library/LibraryBuilder.js @@ -20,13 +20,12 @@ test("Instantiation", (t) => { "replaceBuildtime", "generateJsdoc", "executeJsdocSdkTransformation", + "minify", "generateLibraryManifest", "generateManifestBundle", "generateLibraryPreload", "buildThemes", "generateThemeDesignerResources", - "createDebugFiles", - "uglify", "generateResourcesJson" ], "LibraryBuilder is instantiated with standard tasks"); });