From d3a92ff966ce2417ccb0a21d32d4f7cc0a115632 Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Thu, 31 Aug 2023 23:58:44 +0530 Subject: [PATCH 1/2] Updated the logic to remove the successful lwc so that they don't get redeploy --- lib/datapacksjob.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/datapacksjob.js b/lib/datapacksjob.js index 8dc831bc..301966e1 100644 --- a/lib/datapacksjob.js +++ b/lib/datapacksjob.js @@ -2783,6 +2783,9 @@ DataPacksJob.prototype.deployJob = async function(jobInfo) { VlocityUtils.error('Can\'t find compiled LWC components path. Skipping...'); }else{ try { + if (fs.readdirSync(tempSfdxLwcFolder+'/lwc').length === 0){ + return; + } VlocityUtils.log('Deploying generated LWC components'); this.vlocity.datapacksutils.addPackageDirToSfdxProjectJson(tempSfdxLwcFolder); const mdapiTempFolder = path.join(jobInfo.tempFolder, 'mdapi'); @@ -2815,6 +2818,7 @@ DataPacksJob.prototype.deployJob = async function(jobInfo) { var metadataKey = `${metadata.componentType}/${metadata.fullName}`; VlocityUtils.success('Metadata Deployed', metadataKey); jobInfo.currentStatus[metadataKey] = 'Success'; + this.rmdirCustom(tempSfdxLwcFolder+'/lwc/'+metadata.fullName); } } ); @@ -2828,6 +2832,7 @@ DataPacksJob.prototype.deployJob = async function(jobInfo) { var metadataKey = `${metadata.componentType}/${metadata.fullName}`; VlocityUtils.success('Metadata Deployed', metadataKey); jobInfo.currentStatus[metadataKey] = 'Success'; + this.rmdirCustom(tempSfdxLwcFolder+'/lwc/'+metadata.fullName); } } ); From e18a9e993486d0268446dfe01f4c456b47f02891 Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Thu, 21 Sep 2023 23:28:11 +0530 Subject: [PATCH 2/2] Ignore the local compilation of VlocityCards when ignoreLocalCompilationCards used --- lib/datapacktypes/vlocitycard.js | 41 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/lib/datapacktypes/vlocitycard.js b/lib/datapacktypes/vlocitycard.js index 387875f3..212bf658 100644 --- a/lib/datapacktypes/vlocitycard.js +++ b/lib/datapacktypes/vlocitycard.js @@ -175,34 +175,35 @@ VlocityCard.prototype.onDeployFinish = async function(jobInfo) { return; } - //--------Load Flexcard compiler------- - // Make sure we load the package version - await this.vlocity.utilityservice.getPackageVersion(); - - const compilerName = 'flexcard-compiler'; - const namespace = this.vlocity.namespace; - const packageVersion = this.vlocity.PackageVersion; - - const flexCardsCompiler = await VlocityUtils.loadCompiler(compilerName, - jobInfo, packageVersion, namespace); - if(flexCardsCompiler){ - for (let i = 0; i < idsArray.length; i++) { - let flexCardID = idsArray[i]; - await this.compileFlexCardsLwc(flexCardID,jobInfo,flexCardsCompiler) ; - } + if (!jobInfo.ignoreLocalCompilationCards){ + //--------Load Flexcard compiler------- + // Make sure we load the package version + await this.vlocity.utilityservice.getPackageVersion(); + + const compilerName = 'flexcard-compiler'; + const namespace = this.vlocity.namespace; + const packageVersion = this.vlocity.PackageVersion; + + const flexCardsCompiler = await VlocityUtils.loadCompiler(compilerName, + jobInfo, packageVersion, namespace); + if(flexCardsCompiler){ + for (let i = 0; i < idsArray.length; i++) { + let flexCardID = idsArray[i]; + await this.compileFlexCardsLwc(flexCardID,jobInfo,flexCardsCompiler) ; + } + } else{ + hasFlexCardCompiler= false; + } } else{ - hasFlexCardCompiler= false; - } - + hasFlexCardCompiler= false; + } } catch (e) { - hasFlexCardCompiler= false; VlocityUtils.error('Error while loading Flexcard Compiler', e); } // If we were unable to load the compiler package, use the legacy method if(!hasFlexCardCompiler){ - await this.flexCardDeployWithPuppeteer(jobInfo) ; return; }