From 8a5b10bbce072d2278a9514210d9e8ff7218c802 Mon Sep 17 00:00:00 2001 From: kumar-ankita Date: Fri, 20 Sep 2024 17:43:40 +0530 Subject: [PATCH 1/3] creating change lists and backup change lists --- src/utils/generatePackageXml.ts | 70 +++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 src/utils/generatePackageXml.ts diff --git a/src/utils/generatePackageXml.ts b/src/utils/generatePackageXml.ts new file mode 100644 index 0000000..95422b7 --- /dev/null +++ b/src/utils/generatePackageXml.ts @@ -0,0 +1,70 @@ +import * as fs from 'fs'; +import * as path from 'path'; + +// Method to generate package.xml with additional types +function createChangeList(apexClasses: string[], lwcComponents: string[]): void { + const apexXml = apexClasses.map((name) => `${name}`).join('\n '); + const lwcXml = lwcComponents.map((name) => `${name}`).join('\n '); + + const additionalTypes = ` + + * + OmniDataTransform + + + * + OmniIntegrationProcedure + + + * + OmniScript + + + * + OmniUiCard + + `; + + const packageXmlContent = ` + + + + ${apexXml} + ApexClass + + + ${lwcXml} + LightningComponentBundle + + ${additionalTypes} + 57.0 + +`; + + const filePath = path.join(__dirname, 'package.xml'); + fs.writeFileSync(filePath, packageXmlContent.trim()); +} + +// Backup method without additional types +function backupChangeList(apexClasses: string[], lwcComponents: string[]): void { + const apexXml = apexClasses.map((name) => `${name}`).join('\n '); + const lwcXml = lwcComponents.map((name) => `${name}`).join('\n '); + + const packageXmlContent = ` + + + + ${apexXml} + ApexClass + + + ${lwcXml} + LightningComponentBundle + + 57.0 + +`; + + const filePath = path.join(__dirname, 'backup-package.xml'); + fs.writeFileSync(filePath, packageXmlContent.trim()); +} From cfac3da238e0a1b48db974c2666cdf0c7bd2b6c5 Mon Sep 17 00:00:00 2001 From: kumar-ankita Date: Fri, 20 Sep 2024 17:44:39 +0530 Subject: [PATCH 2/3] creating change lists and backup change lists --- src/utils/generatePackageXml.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/utils/generatePackageXml.ts b/src/utils/generatePackageXml.ts index 95422b7..6ab6196 100644 --- a/src/utils/generatePackageXml.ts +++ b/src/utils/generatePackageXml.ts @@ -68,3 +68,13 @@ function backupChangeList(apexClasses: string[], lwcComponents: string[]): void const filePath = path.join(__dirname, 'backup-package.xml'); fs.writeFileSync(filePath, packageXmlContent.trim()); } + +// remove all this code later --- only for testing +const apexClasses = ['MyApexClass1', 'MyApexClass2']; +const lwcComponents = ['MyLwcComponent1', 'MyLwcComponent2']; + +// creating normal package.xml with additional types +createChangeList(apexClasses, lwcComponents); + +// creating backup-package.xml without additional types +backupChangeList(apexClasses, lwcComponents); From bf0e26c2560c1622c1f3ce5b491cb8835fbf3bd5 Mon Sep 17 00:00:00 2001 From: kumar-ankita Date: Sat, 21 Sep 2024 10:17:08 +0530 Subject: [PATCH 3/3] removing lint error --- src/utils/generatePackageXml.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/generatePackageXml.ts b/src/utils/generatePackageXml.ts index 6ab6196..dcf794d 100644 --- a/src/utils/generatePackageXml.ts +++ b/src/utils/generatePackageXml.ts @@ -69,7 +69,7 @@ function backupChangeList(apexClasses: string[], lwcComponents: string[]): void fs.writeFileSync(filePath, packageXmlContent.trim()); } -// remove all this code later --- only for testing +// remove all this code later --- only for testing const apexClasses = ['MyApexClass1', 'MyApexClass2']; const lwcComponents = ['MyLwcComponent1', 'MyLwcComponent2'];