Skip to content

Commit

Permalink
[INTERNAL] Cleanup based on code review
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomByte committed Dec 23, 2021
1 parent bb0a01c commit a53c0cc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
3 changes: 0 additions & 3 deletions lib/lbt/resources/LocatorResourcePool.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ const ResourcePool = require("./ResourcePool");
const LocatorResource = require("./LocatorResource");

class LocatorResourcePool extends ResourcePool {
constructor({ignoreMissingModules} = {}) {
super({ignoreMissingModules});
}
prepare(resources) {
resources = resources.filter( (res) => !res.getStatInfo().isDirectory() );
return Promise.all(
Expand Down
3 changes: 1 addition & 2 deletions lib/lbt/resources/ResourcePool.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const FioriElementsAnalyzer = require("../analyzer/FioriElementsAnalyzer");
const XMLCompositeAnalyzer = require("../analyzer/XMLCompositeAnalyzer");
const JSModuleAnalyzer = require("../analyzer/JSModuleAnalyzer");
const XMLTemplateAnalyzer = require("../analyzer/XMLTemplateAnalyzer");
const ModuleName = require("../utils/ModuleName");

const LibraryFileAnalyzer = require("./LibraryFileAnalyzer");
const ModuleInfo = require("./ModuleInfo");
Expand Down Expand Up @@ -59,7 +58,7 @@ function scanFileOrDir(fileOrDir, name, pool) {
*/

async function determineDependencyInfo(resource, rawInfo, pool) {
const info = new ModuleInfo(ModuleName.getNonDebugName(resource.name) || resource.name);
const info = new ModuleInfo(resource.name);
info.size = resource.fileSize;
if ( /\.js$/.test(resource.name) ) {
// console.log("analyzing %s", resource.file);
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/bundlers/generateBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ module.exports = function({
// 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, getClonedResource) {
combo = combo.transformer(async function(resourcePath, getResource) {
if (taskUtil.getTag(resourcePath, taskUtil.STANDARD_TAGS.IsDebugVariant)) {
const resource = await getClonedResource();
const resource = await getResource();
const nonDbgPath = ModuleName.getNonDebugName(resource.getPath());
if (!nonDbgPath) {
throw new Error(`Failed to resolve non-debug name for ${resource.getPath()}`);
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/bundlers/generateLibraryPreload.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ module.exports = function({workspace, dependencies, taskUtil, options: {projectN
}).filter(function(resource) {
// Remove any non-debug variants
return !taskUtil.getTag(resource, taskUtil.STANDARD_TAGS.HasDebugVariant);
}).transformer(async function(resourcePath, getClonedResource) {
}).transformer(async function(resourcePath, getResource) {
if (taskUtil.getTag(resourcePath, taskUtil.STANDARD_TAGS.IsDebugVariant)) {
const resource = await getClonedResource();
const resource = await getResource();
const nonDbgPath = ModuleName.getNonDebugName(resource.getPath());
if (!nonDbgPath) {
throw new Error(`Failed to resolve non-debug name for ${resource.getPath()}`);
Expand Down

0 comments on commit a53c0cc

Please sign in to comment.