From 07a5be2b6d9aa23cf78ddd17951c832d6dec7bef Mon Sep 17 00:00:00 2001 From: Florian Vogt Date: Fri, 11 Nov 2022 10:00:54 +0100 Subject: [PATCH] [BREAKING] Removal of manifestBundler and generateManifestBundle (#838) BREAKING CHANGE: The manifestBundler processor and generateManifestBundle task has been removed because it is no longer required for the HTML5 repository in Cloud Foundry. --- lib/processors/bundlers/manifestBundler.js | 181 -------- lib/tasks/bundlers/generateManifestBundle.js | 58 --- lib/tasks/taskRepository.js | 3 +- package-lock.json | 150 +------ package.json | 4 +- test/lib/package-exports.js | 2 - .../processors/bundlers/manifestBundler.js | 399 ------------------ .../generateManifestBundle.integration.js | 162 ------- .../tasks/bundlers/generateManifestBundle.js | 79 ---- test/lib/tasks/generateCachebusterInfo.js | 4 +- test/lib/tasks/taskRepository.js | 7 +- 11 files changed, 16 insertions(+), 1033 deletions(-) delete mode 100644 lib/processors/bundlers/manifestBundler.js delete mode 100644 lib/tasks/bundlers/generateManifestBundle.js delete mode 100644 test/lib/processors/bundlers/manifestBundler.js delete mode 100644 test/lib/tasks/bundlers/generateManifestBundle.integration.js delete mode 100644 test/lib/tasks/bundlers/generateManifestBundle.js diff --git a/lib/processors/bundlers/manifestBundler.js b/lib/processors/bundlers/manifestBundler.js deleted file mode 100644 index 71b98529c..000000000 --- a/lib/processors/bundlers/manifestBundler.js +++ /dev/null @@ -1,181 +0,0 @@ -import posixPath from "node:path/posix"; -import yazl from "yazl"; -import {createResource} from "@ui5/fs/resourceFactory"; -import logger from "@ui5/logger"; -const log = logger.getLogger("builder:processors:bundlers:manifestBundler"); - -/** - * Repository to handle i18n resource files - * - * @private - */ -class I18nResourceList { - /** - * Constructor - */ - constructor() { - this.propertyFiles = new Map(); - } - - /** - * Adds a i18n resource to the repository - * - * @param {string} directory Path to the i18n resource - * @param {@ui5/fs/Resource} resource i18n resource - */ - add(directory, resource) { - const normalizedDirectory = posixPath.normalize(directory); - if (!this.propertyFiles.has(normalizedDirectory)) { - this.propertyFiles.set(normalizedDirectory, [resource]); - } else { - this.propertyFiles.get(normalizedDirectory).push(resource); - } - } - - /** - * Gets all registered i18n files within the provided path - * - * @param {string} directory Path to search for - * @returns {Array} Array of resources files - */ - get(directory) { - return this.propertyFiles.get(posixPath.normalize(directory)) || []; - } -} - - -/** - * @public - * @module @ui5/builder/processors/bundlers/manifestBundler - */ - -/** - * Creates a manifest bundle from the provided resources. - * - * @public - * @function default - * @static - * - * @param {object} parameters Parameters - * @param {@ui5/fs/Resource[]} parameters.resources List of resources to be processed - * @param {object} parameters.options Options - * @param {string} parameters.options.namespace Namespace of the project - * @param {string} parameters.options.bundleName Name of the bundled zip file - * @param {string} parameters.options.propertiesExtension Extension name of the properties files, e.g. ".properties" - * @param {string} parameters.options.descriptor Descriptor name - * @returns {Promise<@ui5/fs/Resource[]>} Promise resolving with manifest bundle resources - */ -export default ({resources, options: {namespace, bundleName, propertiesExtension, descriptor}}) => { - function bundleNameToUrl(bundleName, appId) { - if (!bundleName.startsWith(appId)) { - return null; - } - const relativeBundleName = bundleName.substring(appId.length + 1); - return relativeBundleName.replace(/\./g, "/") + propertiesExtension; - } - - function addDescriptorI18nInfos(descriptorI18nInfos, manifest) { - function addI18nInfo(i18nPath) { - if (i18nPath.startsWith("ui5:")) { - log.warn(`Using the ui5:// protocol for i18n bundles is currently not supported ('${i18nPath}' in ${manifest.path})`); - return; - } - descriptorI18nInfos.set( - posixPath.join(posixPath.dirname(manifest.path), posixPath.dirname(i18nPath)), - posixPath.basename(i18nPath, propertiesExtension) - ); - } - - const content = JSON.parse(manifest.content); - const appI18n = content["sap.app"]["i18n"]; - let bundleUrl; - // i18n section in sap.app can be either a string or an object with bundleUrl - if (typeof appI18n === "object") { - if (appI18n.bundleUrl) { - bundleUrl = appI18n.bundleUrl; - } else if (appI18n.bundleName) { - bundleUrl = bundleNameToUrl(appI18n.bundleName, content["sap.app"]["id"]); - } - } else if (typeof appI18n === "string") { - bundleUrl = appI18n; - } else { - bundleUrl = "i18n/i18n.properties"; - } - if (bundleUrl) { - addI18nInfo(bundleUrl); - } - - if (typeof appI18n === "object" && Array.isArray(appI18n.enhanceWith)) { - appI18n.enhanceWith.forEach((enhanceWithEntry) => { - let bundleUrl; - if (enhanceWithEntry.bundleUrl) { - bundleUrl = enhanceWithEntry.bundleUrl; - } else if (enhanceWithEntry.bundleName) { - bundleUrl = bundleNameToUrl(enhanceWithEntry.bundleName, content["sap.app"]["id"]); - } - if (bundleUrl) { - addI18nInfo(bundleUrl); - } - }); - } - } - - return Promise.all(resources.map((resource) => - resource.getBuffer().then((content) => { - const basename = posixPath.basename(resource.getPath()); - return { - name: basename, - isManifest: basename === descriptor, - path: resource.getPath(), - content: content - }; - }) - )).then((resources) => { - const archiveContent = new Map(); - const descriptorI18nInfos = new Map(); - const i18nResourceList = new I18nResourceList(); - - resources.forEach((resource) => { - if (resource.isManifest) { - addDescriptorI18nInfos(descriptorI18nInfos, resource); - archiveContent.set(resource.path, resource.content); - } else { - const directory = posixPath.dirname(resource.path); - i18nResourceList.add(directory, resource); - } - }); - - descriptorI18nInfos.forEach((rootName, directory) => { - const i18nResources = i18nResourceList.get(directory) - .filter((resource) => resource.name.startsWith(rootName)); - - if (i18nResources.length) { - i18nResources.forEach((resource) => archiveContent.set(resource.path, resource.content)); - } else { - log.warn(`Could not find any resources for i18n bundle '${directory}'`); - } - }); - - return archiveContent; - }).then((archiveContent) => new Promise((resolve) => { - const zip = new yazl.ZipFile(); - const basePath = `/resources/${namespace}/`; - archiveContent.forEach((content, path) => { - if (!path.startsWith(basePath)) { - log.verbose(`Not bundling resource with path ${path} since it is not based on path ${basePath}`); - return; - } - // Remove base path. Absolute paths are not allowed in ZIP files - const normalizedPath = path.replace(basePath, ""); - zip.addBuffer(content, normalizedPath); - }); - zip.end(); - - const pathPrefix = "/resources/" + namespace + "/"; - const res = createResource({ - path: pathPrefix + bundleName, - stream: zip.outputStream - }); - resolve([res]); - })); -}; diff --git a/lib/tasks/bundlers/generateManifestBundle.js b/lib/tasks/bundlers/generateManifestBundle.js deleted file mode 100644 index 268709cd8..000000000 --- a/lib/tasks/bundlers/generateManifestBundle.js +++ /dev/null @@ -1,58 +0,0 @@ -import logger from "@ui5/logger"; -const log = logger.getLogger("builder:tasks:bundlers:generateManifestBundle"); -import manifestBundler from "../../processors/bundlers/manifestBundler.js"; - -const DESCRIPTOR = "manifest.json"; -const PROPERTIES_EXT = ".properties"; -const BUNDLE_NAME = "manifest-bundle.zip"; - -/** - * @public - * @module @ui5/builder/tasks/bundlers/generateManifestBundle - */ - -/* eslint "jsdoc/check-param-names": ["error", {"disableExtraPropertyReporting":true}] */ -/** - * Task for manifestBundler. - * - * @public - * @function default - * @static - * - * @param {object} parameters Parameters - * @param {@ui5/fs/DuplexCollection} parameters.workspace DuplexCollection to read and write files - * @param {object} parameters.options Options - * @param {string} parameters.options.projectName Project name - * @param {string} parameters.options.projectNamespace Project namespace - * @returns {Promise} Promise resolving with undefined once data has been written - */ -export default async function({workspace, options = {}}) { - const {projectName} = options; - // Backward compatibility: "namespace" option got renamed to "projectNamespace" - const namespace = options.projectNamespace || options.namespace; - - if (!projectName || !namespace) { - throw new Error("[generateManifestBundle]: One or more mandatory options not provided"); - } - - const allResources = await workspace.byGlob(`/resources/${namespace}/**/{${DESCRIPTOR},*${PROPERTIES_EXT}}`); - if (allResources.length === 0) { - log.verbose(`Could not find a "${DESCRIPTOR}" file for project ${projectName}, ` + - `creation of "${BUNDLE_NAME}" is skipped!`); - return; - } - - const processedResources = await manifestBundler({ - resources: allResources, - options: { - descriptor: DESCRIPTOR, - propertiesExtension: PROPERTIES_EXT, - bundleName: BUNDLE_NAME, - namespace - } - }); - - await Promise.all(processedResources.map((resource) => { - return workspace.write(resource); - })); -} diff --git a/lib/tasks/taskRepository.js b/lib/tasks/taskRepository.js index ac69d6630..69a7aceea 100644 --- a/lib/tasks/taskRepository.js +++ b/lib/tasks/taskRepository.js @@ -11,7 +11,6 @@ const taskInfos = { transformBootstrapHtml: {path: "./transformBootstrapHtml.js"}, generateLibraryManifest: {path: "./generateLibraryManifest.js"}, generateVersionInfo: {path: "./generateVersionInfo.js"}, - generateManifestBundle: {path: "./bundlers/generateManifestBundle.js"}, generateFlexChangesBundle: {path: "./bundlers/generateFlexChangesBundle.js"}, generateComponentPreload: {path: "./bundlers/generateComponentPreload.js"}, generateResourcesJson: {path: "./generateResourcesJson.js"}, @@ -26,7 +25,7 @@ export async function getTask(taskName) { const taskInfo = taskInfos[taskName]; if (!taskInfo) { - if (["createDebugFiles", "uglify"].includes(taskName)) { + if (["createDebugFiles", "uglify", "generateManifestBundle"].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/`); diff --git a/package-lock.json b/package-lock.json index 8ac6dfb36..e99836d25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,8 +25,7 @@ "rimraf": "^3.0.2", "semver": "^7.3.8", "terser": "^5.15.1", - "xml2js": "^0.4.23", - "yazl": "^2.5.1" + "xml2js": "^0.4.23" }, "devDependencies": { "@istanbuljs/esm-loader-hook": "^0.2.0", @@ -43,7 +42,6 @@ "eslint-plugin-ava": "^13.2.0", "eslint-plugin-jsdoc": "^39.6.2", "esmock": "^2.0.7", - "extract-zip": "^2.0.1", "nyc": "^15.1.0", "open-cli": "^7.1.0", "recursive-readdir": "^2.2.3", @@ -775,13 +773,6 @@ "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", "dev": true }, - "node_modules/@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==", - "dev": true, - "optional": true - }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", @@ -794,16 +785,6 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, - "node_modules/@types/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", - "dev": true, - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@ui5/builder": { "version": "3.0.0-beta.1", "resolved": "https://registry.npmjs.org/@ui5/builder/-/builder-3.0.0-beta.1.tgz", @@ -1632,6 +1613,7 @@ "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, "engines": { "node": "*" } @@ -3922,26 +3904,6 @@ "node": "*" } }, - "node_modules/extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - }, - "bin": { - "extract-zip": "cli.js" - }, - "engines": { - "node": ">= 10.17.0" - }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3989,15 +3951,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, - "dependencies": { - "pend": "~1.2.0" - } - }, "node_modules/figgy-pudding": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", @@ -4445,21 +4398,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -7289,12 +7227,6 @@ "url": "https://github.com/sponsors/Borewit" } }, - "node_modules/pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true - }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -9631,20 +9563,11 @@ "node": ">=12" } }, - "node_modules/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, "node_modules/yazl": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", + "dev": true, "dependencies": { "buffer-crc32": "~0.2.3" } @@ -10238,13 +10161,6 @@ "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", "dev": true }, - "@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==", - "dev": true, - "optional": true - }, "@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", @@ -10257,16 +10173,6 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, - "@types/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", - "dev": true, - "optional": true, - "requires": { - "@types/node": "*" - } - }, "@ui5/builder": { "version": "3.0.0-beta.1", "resolved": "https://registry.npmjs.org/@ui5/builder/-/builder-3.0.0-beta.1.tgz", @@ -10898,7 +10804,8 @@ "buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==" + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true }, "buffer-from": { "version": "1.1.2", @@ -12674,18 +12581,6 @@ "wolfy87-eventemitter": "*" } }, - "extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, - "requires": { - "@types/yauzl": "^2.9.1", - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - } - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -12730,15 +12625,6 @@ "reusify": "^1.0.4" } }, - "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, - "requires": { - "pend": "~1.2.0" - } - }, "figgy-pudding": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", @@ -13106,15 +12992,6 @@ "integrity": "sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==", "dev": true }, - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -15335,12 +15212,6 @@ "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==", "dev": true }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true - }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -17119,20 +16990,11 @@ "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true }, - "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, - "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, "yazl": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", + "dev": true, "requires": { "buffer-crc32": "~0.2.3" } diff --git a/package.json b/package.json index 273d51284..edc7812d3 100644 --- a/package.json +++ b/package.json @@ -134,8 +134,7 @@ "rimraf": "^3.0.2", "semver": "^7.3.8", "terser": "^5.15.1", - "xml2js": "^0.4.23", - "yazl": "^2.5.1" + "xml2js": "^0.4.23" }, "devDependencies": { "@istanbuljs/esm-loader-hook": "^0.2.0", @@ -152,7 +151,6 @@ "eslint-plugin-ava": "^13.2.0", "eslint-plugin-jsdoc": "^39.6.2", "esmock": "^2.0.7", - "extract-zip": "^2.0.1", "nyc": "^15.1.0", "open-cli": "^7.1.0", "recursive-readdir": "^2.2.3", diff --git a/test/lib/package-exports.js b/test/lib/package-exports.js index 1bb694323..093d15ec5 100644 --- a/test/lib/package-exports.js +++ b/test/lib/package-exports.js @@ -18,7 +18,6 @@ test("check number of exports", (t) => { // Public API contract (exported modules) [ "processors/bundlers/flexChangesBundler", - "processors/bundlers/manifestBundler", "processors/bundlers/moduleBundler", "processors/jsdoc/apiIndexGenerator", "processors/jsdoc/jsdocGenerator", @@ -34,7 +33,6 @@ test("check number of exports", (t) => { "tasks/bundlers/generateComponentPreload", "tasks/bundlers/generateFlexChangesBundle", "tasks/bundlers/generateLibraryPreload", - "tasks/bundlers/generateManifestBundle", "tasks/bundlers/generateStandaloneAppBundle", "tasks/bundlers/generateBundle", "tasks/generateCachebusterInfo", diff --git a/test/lib/processors/bundlers/manifestBundler.js b/test/lib/processors/bundlers/manifestBundler.js deleted file mode 100644 index ea6a73b07..000000000 --- a/test/lib/processors/bundlers/manifestBundler.js +++ /dev/null @@ -1,399 +0,0 @@ -import test from "ava"; -import yazl from "yazl"; -import sinonGlobal from "sinon"; -import esmock from "esmock"; - -test.beforeEach(async (t) => { - const sinon = t.context.sinon = sinonGlobal.createSandbox(); - - t.context.log = { - verbose: sinon.stub(), - warn: sinon.stub(), - error: sinon.stub(), - }; - - t.context.zip = new yazl.ZipFile(); - sinon.spy(t.context.zip, "addBuffer"); - - t.context.manifestBundler = await esmock("../../../../lib/processors/bundlers/manifestBundler.js", { - "@ui5/logger": { - getLogger: sinon.stub().withArgs("builder:processors:bundlers:manifestBundler").returns(t.context.log) - }, - "yazl": { - ZipFile: sinon.stub().returns(t.context.zip) - } - }); -}); - -test.afterEach.always((t) => { - t.context.sinon.restore(); -}); - -test.serial("manifestBundler with empty resources", async (t) => { - const {manifestBundler} = t.context; - const resources = []; - const options = {}; - await manifestBundler({resources, options}); - t.is(t.context.zip.addBuffer.callCount, 0); - t.is(t.context.log.verbose.callCount, 0); - t.is(t.context.log.warn.callCount, 0); - t.is(t.context.log.error.callCount, 0); -}); - -test.serial("manifestBundler with manifest path not starting with '/resources'", async (t) => { - const {manifestBundler} = t.context; - const resources = []; - resources.push({ - name: "manifest.json", - getPath: () => "pony/manifest.json", - getBuffer: async () => JSON.stringify({ - "sap.app": {} - }) - }); - const options = { - descriptor: "manifest.json", - namespace: "pony" - }; - - await manifestBundler({resources, options}); - - t.is(t.context.zip.addBuffer.callCount, 0, "should not be called"); - - t.is(t.context.log.verbose.callCount, 1); - t.deepEqual(t.context.log.verbose.getCall(0).args, - ["Not bundling resource with path pony/manifest.json since it is not based on path /resources/pony/"], - "should be called with correct arguments"); - t.is(t.context.log.warn.callCount, 1); - t.deepEqual(t.context.log.warn.getCall(0).args, - ["Could not find any resources for i18n bundle 'pony/i18n'"]); - t.is(t.context.log.error.callCount, 0); -}); - -test.serial("manifestBundler with manifest without i18n section in sap.app", async (t) => { - const {manifestBundler} = t.context; - const resources = []; - resources.push({ - name: "manifest.json", - getPath: () => "/resources/pony/manifest.json", - getBuffer: async () => JSON.stringify({ - "sap.app": {} - }) - }); - const options = { - descriptor: "manifest.json", - namespace: "pony" - }; - - await manifestBundler({resources, options}); - - t.is(t.context.zip.addBuffer.callCount, 1, "should be called once"); - t.deepEqual(t.context.zip.addBuffer.getCall(0).args, ["{\"sap.app\":{}}", "manifest.json"], - "should be called with correct arguments"); - - t.is(t.context.log.verbose.callCount, 0); - t.is(t.context.log.warn.callCount, 1); - t.deepEqual(t.context.log.warn.getCall(0).args, - ["Could not find any resources for i18n bundle '/resources/pony/i18n'"]); - t.is(t.context.log.error.callCount, 0); -}); - -test.serial("manifestBundler with manifest with i18n string", async (t) => { - const {manifestBundler} = t.context; - const resources = []; - resources.push({ - name: "manifest.json", - getPath: () => "/resources/pony/manifest.json", - getBuffer: async () => JSON.stringify({ - "sap.app": { - "i18n": "i18n-bundle/i18n.properties" - } - }) - }); - resources.push({ - name: "i18n.properties", - getPath: () => "/resources/pony/i18n-bundle/i18n.properties", - getBuffer: async () => "A=B" - }); - const options = { - descriptor: "manifest.json", - namespace: "pony" - }; - - await manifestBundler({resources, options}); - - t.is(t.context.zip.addBuffer.callCount, 2); - t.deepEqual(t.context.zip.addBuffer.getCall(0).args, - ["{\"sap.app\":{\"i18n\":\"i18n-bundle/i18n.properties\"}}", "manifest.json"], - "should be called with correct arguments"); - t.deepEqual(t.context.zip.addBuffer.getCall(1).args, - ["A=B", "i18n-bundle/i18n.properties"], - "should be called with correct arguments"); - - t.is(t.context.log.verbose.callCount, 0); - t.is(t.context.log.warn.callCount, 0); - t.is(t.context.log.error.callCount, 0); -}); - -test.serial("manifestBundler with manifest with i18n object (bundleUrl)", async (t) => { - const {manifestBundler} = t.context; - const resources = []; - const manifestString = JSON.stringify({ - "sap.app": { - "i18n": { - "bundleUrl": "i18n/i18n.properties", - "supportedLocales": ["en", "de"], - "fallbackLocale": "en" - } - } - }); - resources.push({ - name: "manifest.json", - getPath: () => "/resources/pony/manifest.json", - getBuffer: async () => manifestString - }); - resources.push({ - name: "i18n_de.properties", - getPath: () => "/resources/pony/i18n/i18n_de.properties", - getBuffer: async () => "A=B" - }); - resources.push({ - name: "i18n_en.properties", - getPath: () => "/resources/pony/i18n/i18n_en.properties", - getBuffer: async () => "A=C" - }); - const options = { - descriptor: "manifest.json", - namespace: "pony", - propertiesExtension: ".properties" - }; - - await manifestBundler({resources, options}); - - t.is(t.context.zip.addBuffer.callCount, 3, "should be called 3 times"); - t.deepEqual(t.context.zip.addBuffer.getCall(0).args, [manifestString, "manifest.json"], - "should be called with correct arguments"); - t.deepEqual(t.context.zip.addBuffer.getCall(1).args, ["A=B", "i18n/i18n_de.properties"], - "should be called with correct arguments"); - t.deepEqual(t.context.zip.addBuffer.getCall(2).args, ["A=C", "i18n/i18n_en.properties"], - "should be called with correct arguments"); - - t.is(t.context.log.verbose.callCount, 0); - t.is(t.context.log.warn.callCount, 0); - t.is(t.context.log.error.callCount, 0); -}); - -test.serial("manifestBundler with manifest with i18n object (bundleName)", async (t) => { - const {manifestBundler} = t.context; - const resources = []; - const manifestString = JSON.stringify({ - "sap.app": { - "id": "pony", - "i18n": { - "bundleName": "pony.i18n.i18n", - "supportedLocales": ["en", "de"], - "fallbackLocale": "en" - } - } - }); - resources.push({ - name: "manifest.json", - getPath: () => "/resources/pony/manifest.json", - getBuffer: async () => manifestString - }); - resources.push({ - name: "i18n_de.properties", - getPath: () => "/resources/pony/i18n/i18n_de.properties", - getBuffer: async () => "A=B" - }); - resources.push({ - name: "i18n_en.properties", - getPath: () => "/resources/pony/i18n/i18n_en.properties", - getBuffer: async () => "A=C" - }); - const options = { - descriptor: "manifest.json", - namespace: "pony", - propertiesExtension: ".properties" - }; - - await manifestBundler({resources, options}); - - t.is(t.context.zip.addBuffer.callCount, 3, "should be called 3 times"); - t.deepEqual(t.context.zip.addBuffer.getCall(0).args, [manifestString, "manifest.json"], - "should be called with correct arguments"); - t.deepEqual(t.context.zip.addBuffer.getCall(1).args, ["A=B", "i18n/i18n_de.properties"], - "should be called with correct arguments"); - t.deepEqual(t.context.zip.addBuffer.getCall(2).args, ["A=C", "i18n/i18n_en.properties"], - "should be called with correct arguments"); - - t.is(t.context.log.verbose.callCount, 0); - t.is(t.context.log.warn.callCount, 0); - t.is(t.context.log.error.callCount, 0); -}); - -test.serial("manifestBundler with manifest with i18n enhanceWith", async (t) => { - const {manifestBundler} = t.context; - const resources = []; - const manifestString = JSON.stringify({ - "sap.app": { - "id": "pony", - "i18n": { - "bundleUrl": "i18n/i18n.properties", - "enhanceWith": [ - { - "bundleUrl": "enhancement1/i18n.properties" - }, - { - "bundleName": "pony.enhancement2.i18n" - } - ] - } - } - }); - resources.push({ - name: "manifest.json", - getPath: () => "/resources/pony/manifest.json", - getBuffer: async () => manifestString - }); - resources.push({ - name: "i18n_de.properties", - getPath: () => "/resources/pony/i18n/i18n_de.properties", - getBuffer: async () => "A=B" - }); - resources.push({ - name: "i18n_en.properties", - getPath: () => "/resources/pony/i18n/i18n_en.properties", - getBuffer: async () => "A=C" - }); - resources.push({ - name: "i18n.properties", - getPath: () => "/resources/pony/enhancement1/i18n.properties", - getBuffer: async () => "A=enhancement1" - }); - resources.push({ - name: "i18n.properties", - getPath: () => "/resources/pony/enhancement2/i18n.properties", - getBuffer: async () => "A=enhancement2" - }); - const options = { - descriptor: "manifest.json", - namespace: "pony", - propertiesExtension: ".properties" - }; - - await manifestBundler({resources, options}); - - t.is(t.context.zip.addBuffer.callCount, 5, "should be called 5 times"); - t.deepEqual(t.context.zip.addBuffer.getCall(0).args, [manifestString, "manifest.json"], - "should be called with correct arguments"); - t.deepEqual(t.context.zip.addBuffer.getCall(1).args, ["A=B", "i18n/i18n_de.properties"], - "should be called with correct arguments"); - t.deepEqual(t.context.zip.addBuffer.getCall(2).args, ["A=C", "i18n/i18n_en.properties"], - "should be called with correct arguments"); - t.deepEqual(t.context.zip.addBuffer.getCall(3).args, ["A=enhancement1", "enhancement1/i18n.properties"], - "should be called with correct arguments"); - t.deepEqual(t.context.zip.addBuffer.getCall(4).args, ["A=enhancement2", "enhancement2/i18n.properties"], - "should be called with correct arguments"); - - t.is(t.context.log.verbose.callCount, 0); - t.is(t.context.log.warn.callCount, 0); - t.is(t.context.log.error.callCount, 0); -}); - -test.serial("manifestBundler with manifest with missing i18n files", async (t) => { - const {manifestBundler} = t.context; - const resources = []; - const manifestString = JSON.stringify({ - "sap.app": { - "id": "pony", - "i18n": { - "bundleUrl": "i18n/i18n.properties", - "enhanceWith": [ - { - "bundleUrl": "enhancement1/i18n.properties" - }, - { - "bundleName": "pony.enhancement2.i18n" - } - ] - } - } - }); - resources.push({ - name: "manifest.json", - getPath: () => "/resources/pony/manifest.json", - getBuffer: async () => manifestString - }); - const options = { - descriptor: "manifest.json", - namespace: "pony", - propertiesExtension: ".properties" - }; - - await manifestBundler({resources, options}); - - t.is(t.context.zip.addBuffer.callCount, 1, "should be called 1 time"); - t.deepEqual(t.context.zip.addBuffer.getCall(0).args, [manifestString, "manifest.json"], - "should be called with correct arguments"); - - t.is(t.context.log.verbose.callCount, 0); - t.is(t.context.log.warn.callCount, 3); - t.deepEqual(t.context.log.warn.getCall(0).args, [ - `Could not find any resources for i18n bundle '/resources/pony/i18n'` - ]); - t.deepEqual(t.context.log.warn.getCall(1).args, [ - `Could not find any resources for i18n bundle '/resources/pony/enhancement1'` - ]); - t.deepEqual(t.context.log.warn.getCall(2).args, [ - `Could not find any resources for i18n bundle '/resources/pony/enhancement2'` - ]); - - t.is(t.context.log.error.callCount, 0); -}); - -test.serial("manifestBundler with manifest with ui5:// url", async (t) => { - const {manifestBundler} = t.context; - const resources = []; - const manifestString = JSON.stringify({ - "sap.app": { - "id": "pony", - "i18n": { - "bundleUrl": "ui5://pony/i18n/i18n.properties" - } - } - }); - resources.push({ - name: "manifest.json", - getPath: () => "/resources/pony/manifest.json", - getBuffer: async () => manifestString - }); - resources.push({ - name: "i18n_de.properties", - getPath: () => "/resources/pony/i18n/i18n_de.properties", - getBuffer: async () => "A=B" - }); - resources.push({ - name: "i18n_en.properties", - getPath: () => "/resources/pony/i18n/i18n_en.properties", - getBuffer: async () => "A=C" - }); - const options = { - descriptor: "manifest.json", - namespace: "pony", - propertiesExtension: ".properties" - }; - - await manifestBundler({resources, options}); - - t.is(t.context.zip.addBuffer.callCount, 1, "should be called 1 time"); - t.deepEqual(t.context.zip.addBuffer.getCall(0).args, [manifestString, "manifest.json"], - "should be called with correct arguments"); - - t.is(t.context.log.verbose.callCount, 0); - t.is(t.context.log.warn.callCount, 1); - t.deepEqual(t.context.log.warn.getCall(0).args, [ - `Using the ui5:// protocol for i18n bundles is currently not supported ` + - `('ui5://pony/i18n/i18n.properties' in /resources/pony/manifest.json)` - ]); - t.is(t.context.log.error.callCount, 0); -}); diff --git a/test/lib/tasks/bundlers/generateManifestBundle.integration.js b/test/lib/tasks/bundlers/generateManifestBundle.integration.js deleted file mode 100644 index 0123c78f9..000000000 --- a/test/lib/tasks/bundlers/generateManifestBundle.integration.js +++ /dev/null @@ -1,162 +0,0 @@ -import test from "ava"; -import {fileURLToPath} from "node:url"; -import path from "node:path"; -import chai from "chai"; -import chaiFs from "chai-fs"; -chai.use(chaiFs); -const assert = chai.assert; -import extractZip from "extract-zip"; -import recursive from "recursive-readdir"; -import {graphFromObject} from "@ui5/project/graph"; -import * as taskRepository from "../../../../lib/tasks/taskRepository.js"; - -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const applicationBPath = path.join(__dirname, "..", "..", "..", "fixtures", "application.b"); -const libraryCore = path.join(__dirname, "..", "..", "..", "fixtures", "sap.ui.core-evo"); -const libraryKPath = path.join(__dirname, "..", "..", "..", "fixtures", "library.k"); - - -const findFiles = (folder) => { - return new Promise((resolve, reject) => { - recursive(folder, (err, files) => { - if (err) { - reject(err); - } else { - resolve(files); - } - }); - }); -}; - -test("integration: Build application.b with manifestBundler", async (t) => { - const destPath = path.join("test", "tmp", "build", "application.b", "dest"); - const destBundle = path.resolve(path.join(destPath, "manifest-bundle")); - const expectedPath = path.join("test", "expected", "build", "application.b", "dest", "manifest-bundle"); - const excludedTasks = ["*"]; - const includedTasks = ["escapeNonAsciiCharacters", "generateManifestBundle"]; - - const graph = await graphFromObject({ - dependencyTree: applicationBTree - }); - - graph.setTaskRepository(taskRepository); - await graph.build({ - destPath, - excludedTasks, - includedTasks - }); - await extractZip(destBundle + ".zip", {dir: destBundle}); - - const expectedFiles = await findFiles(expectedPath); - - // Check for all directories and files - assert.directoryDeepEqual(destBundle, expectedPath); - - // Check for all file contents - expectedFiles.forEach((expectedFile) => { - const relativeFile = path.relative(expectedPath, expectedFile); - const destFile = path.join(destBundle, relativeFile); - assert.fileEqual(destFile, expectedFile); - }); - t.pass("No assertion exception"); -}); - -test("integration: Build library.k with manifestBundler", async (t) => { - const destPath = path.join("test", "tmp", "build", "library.k", "dest"); - const destBundle = path.resolve(path.join(destPath, "resources", "library", "k", "manifest-bundle")); - const expectedPath = - path.join("test", "expected", "build", "library.k", "dest", "resources", "library", "k", "manifest-bundle"); - const excludedTasks = ["*"]; - const includedTasks = ["generateLibraryManifest", "generateManifestBundle"]; - - const graph = await graphFromObject({ - dependencyTree: libraryKTree - }); - - graph.setTaskRepository(taskRepository); - await graph.build({ - destPath, - excludedTasks, - includedTasks - }); - - await extractZip(destBundle + ".zip", {dir: destBundle}); - - const expectedFiles = await findFiles(expectedPath); - - // Check for all directories and files - assert.directoryDeepEqual(destBundle, expectedPath); - - // Check for all file contents - expectedFiles.forEach((expectedFile) => { - const relativeFile = path.relative(expectedPath, expectedFile); - const destFile = path.join(destBundle, relativeFile); - assert.fileEqual(destFile, expectedFile); - }); - t.pass(); -}); - -const applicationBTree = { - "id": "application.b", - "version": "1.0.0", - "path": applicationBPath, - "dependencies": [], - "configuration": { - "specVersion": "2.0", - "type": "application", - "metadata": { - "name": "application.b" - }, - "resources": { - "configuration": { - "paths": { - "webapp": "webapp" - }, - "propertiesFileSourceEncoding": "ISO-8859-1" - } - } - } -}; - -const libraryKTree = { - "id": "library.k", - "version": "1.0.0", - "path": libraryKPath, - "dependencies": [ - { - "id": "sap.ui.core-evo", - "version": "1.0.0", - "path": libraryCore, - "dependencies": [], - "configuration": { - "specVersion": "2.0", - "type": "library", - "metadata": { - "name": "sap.ui.core" - }, - "resources": { - "configuration": { - "paths": { - "src": "main/src" - } - } - } - } - } - ], - "configuration": { - "specVersion": "2.0", - "type": "library", - "metadata": { - "name": "library.k" - }, - "resources": { - "configuration": { - "paths": { - "src": "src", - "test": "test" - } - } - } - } -}; diff --git a/test/lib/tasks/bundlers/generateManifestBundle.js b/test/lib/tasks/bundlers/generateManifestBundle.js deleted file mode 100644 index 89c9fe37d..000000000 --- a/test/lib/tasks/bundlers/generateManifestBundle.js +++ /dev/null @@ -1,79 +0,0 @@ -import test from "ava"; -import sinon from "sinon"; -import esmock from "esmock"; -import chai from "chai"; -import chaiFS from "chai-fs"; -chai.use(chaiFS); -import generateManifestBundle from "../../../../lib/tasks/bundlers/generateManifestBundle.js"; - -test.serial("generateManifestBundle", async (t) => { - const byGlobStub = sinon.stub().resolves(["some resource", "some other resource"]); - const writeStub = sinon.stub().resolves(); - const workspace = { - byGlob: byGlobStub, - write: writeStub - }; - const manifestBundlerStub = sinon.stub().resolves(["some new resource", "some other new resource"]); - const generateManifestBundle = await esmock("../../../../lib/tasks/bundlers/generateManifestBundle.js", { - "../../../../lib/processors/bundlers/manifestBundler": manifestBundlerStub - }); - - await generateManifestBundle({ - workspace, - options: { - projectName: "some project", - namespace: "some/project" - } - }); - t.is(byGlobStub.callCount, 1, "workspace.byGlob got called once"); - t.is(byGlobStub.getCall(0).args[0], "/resources/some/project/**/{manifest.json,*.properties}", - "workspace.byGlob got called with the correct arguments"); - - t.is(manifestBundlerStub.callCount, 1, "manifestBundler got called once"); - t.deepEqual(manifestBundlerStub.getCall(0).args[0], { - resources: ["some resource", "some other resource"], - options: { - descriptor: "manifest.json", - propertiesExtension: ".properties", - bundleName: "manifest-bundle.zip", - namespace: "some/project" - } - }, "manifestBundler got called with the correct arguments"); - - t.is(writeStub.callCount, 2, "workspace.write got called twice"); - t.is(writeStub.getCall(0).args[0], "some new resource", - "workspace.write got called with the correct arguments"); - t.is(writeStub.getCall(1).args[0], "some other new resource", - "workspace.write got called with the correct arguments"); -}); - -test.serial("generateManifestBundle with no resources", async (t) => { - const byGlobStub = sinon.stub().resolves([]); - const workspace = { - byGlob: byGlobStub - }; - - const manifestBundlerStub = sinon.stub().resolves([]); - const generateManifestBundle = await esmock("../../../../lib/tasks/bundlers/generateManifestBundle.js", { - "../../../../lib/processors/bundlers/manifestBundler": manifestBundlerStub - }); - - await generateManifestBundle({ - workspace, - options: { - projectName: "some project", - namespace: "some/project" - } - }); - t.is(byGlobStub.callCount, 1, "workspace.byGlob got called once"); - t.is(byGlobStub.getCall(0).args[0], "/resources/some/project/**/{manifest.json,*.properties}", - "workspace.byGlob got called with the correct arguments"); - - t.is(manifestBundlerStub.callCount, 0, "manifestBundler not called"); -}); - -test("generateManifestBundle with missing parameters", async (t) => { - const error = await t.throwsAsync(generateManifestBundle({})); - t.is(error.message, "[generateManifestBundle]: One or more mandatory options not provided", - "Rejected with correct error message"); -}); diff --git a/test/lib/tasks/generateCachebusterInfo.js b/test/lib/tasks/generateCachebusterInfo.js index e5bb48b91..d372e2e57 100644 --- a/test/lib/tasks/generateCachebusterInfo.js +++ b/test/lib/tasks/generateCachebusterInfo.js @@ -28,7 +28,7 @@ const findFiles = (folder) => { }); }; -test("integration: Build application.g with manifestBundler", async (t) => { +test("integration: Build application.g", async (t) => { const destPath = path.join("test", "tmp", "build", "application.g", "cachebuster"); const expectedPath = path.join("test", "expected", "build", "application.g", "cachebuster"); const excludedTasks = ["escapeNonAsciiCharacters", "generateVersionInfo"]; @@ -64,7 +64,7 @@ test("integration: Build application.g with manifestBundler", async (t) => { t.pass(); }); -test("integration: Build application.g with manifestBundler and cachebuster using hashes", async (t) => { +test("integration: Build application.g with cachebuster using hashes", async (t) => { const destPath = path.join("test", "tmp", "build", "application.g", "cachebuster_hash"); const expectedPath = path.join("test", "expected", "build", "application.g", "cachebuster"); const excludedTasks = ["escapeNonAsciiCharacters", "generateVersionInfo"]; diff --git a/test/lib/tasks/taskRepository.js b/test/lib/tasks/taskRepository.js index a8aa1457a..922bdc7dc 100644 --- a/test/lib/tasks/taskRepository.js +++ b/test/lib/tasks/taskRepository.js @@ -26,7 +26,6 @@ test("getAllTaskNames", (t) => { "transformBootstrapHtml", "generateLibraryManifest", "generateVersionInfo", - "generateManifestBundle", "generateFlexChangesBundle", "generateComponentPreload", "generateResourcesJson", @@ -55,4 +54,10 @@ test("Removed task retrieval", async (t) => { `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"); + + const error3 = await t.throwsAsync(getTask("generateManifestBundle")); + t.deepEqual(error3.message, + `Standard task generateManifestBundle 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"); });