Skip to content

Commit

Permalink
chore: fix eslint issues in zipper
Browse files Browse the repository at this point in the history
  • Loading branch information
petermuessig committed Aug 24, 2024
1 parent aa5aae5 commit f5e4aa2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
34 changes: 17 additions & 17 deletions packages/ui5-task-zipper/lib/zipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ const determineProjectName = (collection) => {
};

/**
* Turn absolute data source paths in the manifest.json into relative paths
*
* @param {Buffer} buffer Buffer of the manifest.json file
* @param {object} zip ZipFile instance
* returns {void}
*/
* Turn absolute data source paths in the manifest.json into relative paths
*
* @param {Buffer} buffer Buffer of the manifest.json file
* @param {object} zip ZipFile instance
* returns {void}
*/
const absoluteToRelativePaths = (buffer, zip) => {
const manifest = JSON.parse(buffer.toString("utf-8"));
if (manifest["sap.app"]["dataSources"]) {
Expand All @@ -38,7 +38,7 @@ const absoluteToRelativePaths = (buffer, zip) => {
}
}
zip.addBuffer(Buffer.from(JSON.stringify(manifest, null, 4), "utf-8"), "manifest.json");
}
};

/**
* Zips the application content of the output folder
Expand All @@ -56,7 +56,7 @@ const absoluteToRelativePaths = (buffer, zip) => {
* @param {object} parameters.taskUtil the task utilities
* @returns {Promise<undefined>} Promise resolving with undefined once data has been written
*/
module.exports = async function({ log, workspace, dependencies, options, taskUtil }) {
module.exports = async function ({ log, workspace, dependencies, options, taskUtil }) {
const { OmitFromBuildResult } = taskUtil.STANDARD_TAGS;

// debug mode?
Expand All @@ -76,14 +76,14 @@ module.exports = async function({ log, workspace, dependencies, options, taskUti
includeDependencies === true
? dependencies
: taskUtil.resourceFactory.createReaderCollection({
readers: !includeDependencies
? []
: dependencies._readers.filter((reader) => {
const projectName = determineProjectName(reader);
return includeDependencies.indexOf(projectName) !== -1;
}),
name: "Filtered reader collection of ui5-task-zipper",
});
readers: !includeDependencies
? []
: dependencies._readers.filter((reader) => {
const projectName = determineProjectName(reader);
return includeDependencies.indexOf(projectName) !== -1;
}),
name: "Filtered reader collection of ui5-task-zipper",
});

// retrieve the resource path prefix (to get all application resources)
const prefixPath = `/resources/${options.projectNamespace}/`;
Expand Down Expand Up @@ -173,7 +173,7 @@ module.exports = async function({ log, workspace, dependencies, options, taskUti
* UI5 Tooling will ensure that those dependencies have been
* built before executing the task.
*/
module.exports.determineRequiredDependencies = async function({ availableDependencies, options }) {
module.exports.determineRequiredDependencies = async function ({ availableDependencies, options }) {
const includeDependencies = options?.configuration?.includeDependencies;
if (includeDependencies) {
if (Array.isArray(includeDependencies)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui5-task-zipper/test/zipper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,6 @@ test("Absolute paths for data sources in manifest.json are turned into relative
const zip = path.join(t.context.tmpDir, "dist", "ui5ecosystemdemoapp.zip");

const fileContent = await promisifiedNeedleInHaystack(zip, "manifest.json", true);
t.regex(fileContent, new RegExp("\"uri\": \"backend\/\","), "Manifest.json does not include relative path for the backend data source");
t.regex(fileContent, new RegExp("\"uri\": \"backend/\","), "Manifest.json does not include relative path for the backend data source");

});

0 comments on commit f5e4aa2

Please sign in to comment.