Skip to content

Commit

Permalink
Version10 bugfixes (#48)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Stian-Schikora authored Aug 29, 2024
1 parent b25b0e5 commit 4b438a9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
15 changes: 9 additions & 6 deletions src/commands/packageCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 4b438a9

Please sign in to comment.