From 4b438a9e9b9bc65a55bb2a95c616337685c566d3 Mon Sep 17 00:00:00 2001 From: Stian-Schikora <80123510+Stian-Schikora@users.noreply.github.com> Date: Thu, 29 Aug 2024 22:25:53 +0200 Subject: [PATCH] Version10 bugfixes (#48) * Converting to powerscripts * updated changelog * Changelog * Update to org create scratch * Add double wait to support longer scratch creation for snapShots * Updated dependency validation * Versioning * Improve handling of dependency install for scratch creation chain --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- src/commands/commands.ts | 3 ++- src/commands/packageCommands.ts | 15 +++++++++------ src/extension.ts | 2 +- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2eb5aa6..31b6ea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to the "dxmate" extension will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) + +## [2.0.10] - 2024-08-29 +## Fixed +- Fixed dependency validation for projects with no dependencies + +## Changed +- Added longer wait for scratch creation process to better support creation from snapshots and source orgs + ## [2.0.9] - 2024-02-19 ## Changed - Converted package dependency install to use sf powerscripts instead of deprecated sfpowerkit diff --git a/package.json b/package.json index e26daf2..c3e1c91 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Support tools for SFDX development", "publisher": "Accenture", "icon": "lightning.png", - "version": "2.0.9", + "version": "2.0.10", "repository": { "type": "git", "url": "https://github.com/Accenture/DX-Mate.git" diff --git a/src/commands/commands.ts b/src/commands/commands.ts index a4bcdb2..02de9a0 100644 --- a/src/commands/commands.ts +++ b/src/commands/commands.ts @@ -50,7 +50,8 @@ export function createScratchOrgJob(scratchName: string, durationDays: string) { "-f ./config/project-scratch-def.json " + "--alias " + scratchName + " --duration-days " + durationDays + - " --set-default"; + " --set-default" + + " --wait 10"; let shellJob = new Job('Create New Scratch Org'); const onHandlingFinished = () => { diff --git a/src/commands/packageCommands.ts b/src/commands/packageCommands.ts index 2c64310..0ccbcef 100644 --- a/src/commands/packageCommands.ts +++ b/src/commands/packageCommands.ts @@ -84,13 +84,13 @@ export function installDependencies() { /** * Submits the install dependencies job after validation. Returns a boolean promise that resolves to true if the job was added - * @param packageName + * @param alias - Conditional alias defined if submitting job in a new scratch creation process * @returns */ -export async function installDependenciesJob() { +export async function installDependenciesJob(alias?: string) { let dependencies = getProjectDependencies(); - if(!dependencies) { + if(!dependencies || dependencies.size === 0) { //No dependencies dxmateOutput.appendLine('No Dependencies to install'); dxmateOutput.show(); @@ -103,9 +103,12 @@ export async function installDependenciesJob() { let keyParams = getPackageKeys(); //Get package.json, and find dependencies. keysParam must be a list //Verify sfpowerkit is installed, or else run the installation - let orgInfo = await getDefaultOrgInfo(); - let orgObj = JSON.parse(orgInfo as string); - let targetOrg = orgObj?.result?.alias; + let targetOrg = alias; + if(!targetOrg) { + let orgInfo = await getDefaultOrgInfo(); + let orgObj = JSON.parse(orgInfo as string); + targetOrg = orgObj?.result?.alias; + } let devhub = await getDefaultDevhubAlias(); let devhubObj = JSON.parse(devhub as string); diff --git a/src/extension.ts b/src/extension.ts index 7edb1c5..9f81499 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -142,7 +142,7 @@ async function setupScratchOrg() { console.log('RUNNING SCRATCH ORG CREATE'); createScratchOrgJob(alias as string, duration as string); //Dependency job includes a secondary validate process that afterwards resolves a promise - await installDependenciesJob(); + await installDependenciesJob(alias); //Submitting job before scratch is created sourcePushMetadataJob(); deployUnpackagableJob(); openScratchOrgJob();