@simplysf/simply-cicd 0.23.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -35
- package/lib/commands/simply/cicd/build/check-permission-sets.d.ts +1 -1
- package/lib/commands/simply/cicd/build/check-permission-sets.js +1 -1
- package/lib/commands/simply/cicd/build/check-permission-sets.js.map +1 -1
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js +1 -2
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js.map +1 -1
- package/lib/commands/simply/cicd/build/create-fallback-tag.d.ts +1 -1
- package/lib/commands/simply/cicd/build/create-fallback-tag.js +1 -3
- package/lib/commands/simply/cicd/build/create-fallback-tag.js.map +1 -1
- package/lib/commands/simply/cicd/build/create-package-version.js +1 -3
- package/lib/commands/simply/cicd/build/create-package-version.js.map +1 -1
- package/lib/commands/simply/cicd/build/create-scratch.d.ts +1 -1
- package/lib/commands/simply/cicd/build/create-scratch.js +1 -3
- package/lib/commands/simply/cicd/build/create-scratch.js.map +1 -1
- package/lib/commands/simply/cicd/build/delete-scratch.js +1 -3
- package/lib/commands/simply/cicd/build/delete-scratch.js.map +1 -1
- package/lib/commands/simply/cicd/build/determine-package-changes.js +1 -2
- package/lib/commands/simply/cicd/build/determine-package-changes.js.map +1 -1
- package/lib/commands/simply/cicd/build/generate-flexipage-diff.d.ts +1 -1
- package/lib/commands/simply/cicd/build/generate-flexipage-diff.js +1 -1
- package/lib/commands/simply/cicd/build/generate-flexipage-diff.js.map +1 -1
- package/lib/commands/simply/cicd/build/generate-flow-diff.d.ts +1 -1
- package/lib/commands/simply/cicd/build/generate-flow-diff.js +1 -1
- package/lib/commands/simply/cicd/build/generate-flow-diff.js.map +1 -1
- package/lib/commands/simply/cicd/build/install-dependencies.js +1 -3
- package/lib/commands/simply/cicd/build/install-dependencies.js.map +1 -1
- package/lib/commands/simply/cicd/build/lwc-jest.d.ts +1 -1
- package/lib/commands/simply/cicd/build/lwc-jest.js +1 -1
- package/lib/commands/simply/cicd/build/lwc-jest.js.map +1 -1
- package/lib/commands/simply/cicd/build/publish-utam-page-objects.d.ts +1 -1
- package/lib/commands/simply/cicd/build/publish-utam-page-objects.js +1 -1
- package/lib/commands/simply/cicd/build/publish-utam-page-objects.js.map +1 -1
- package/lib/commands/simply/cicd/build/push-scratch.js +1 -3
- package/lib/commands/simply/cicd/build/push-scratch.js.map +1 -1
- package/lib/commands/simply/cicd/build/test-scratch.js +1 -3
- package/lib/commands/simply/cicd/build/test-scratch.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js +2 -2
- package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js +2 -2
- package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js +2 -2
- package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js +2 -2
- package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/validate.js +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/validate.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js +2 -2
- package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/install-packaged.js +1 -1
- package/lib/commands/simply/cicd/deploy/project/install-packaged.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/post-deploy.js +2 -2
- package/lib/commands/simply/cicd/deploy/project/post-deploy.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/post-destructive.js +2 -2
- package/lib/commands/simply/cicd/deploy/project/post-destructive.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/pre-destructive.js +2 -2
- package/lib/commands/simply/cicd/deploy/project/pre-destructive.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/run-apex-tests.js +1 -1
- package/lib/commands/simply/cicd/deploy/project/run-apex-tests.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/validate.js +1 -1
- package/lib/commands/simply/cicd/deploy/project/validate.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/validate.js +1 -1
- package/lib/commands/simply/cicd/deploy/validate.js.map +1 -1
- package/lib/commands/simply/cicd/notify/build.d.ts +2 -3
- package/lib/commands/simply/cicd/notify/build.js +1 -3
- package/lib/commands/simply/cicd/notify/build.js.map +1 -1
- package/lib/commands/simply/cicd/notify/happy-soup.d.ts +2 -3
- package/lib/commands/simply/cicd/notify/happy-soup.js +4 -6
- package/lib/commands/simply/cicd/notify/happy-soup.js.map +1 -1
- package/lib/commands/simply/cicd/notify/project.d.ts +1 -2
- package/lib/commands/simply/cicd/notify/project.js +3 -5
- package/lib/commands/simply/cicd/notify/project.js.map +1 -1
- package/lib/commands/simply/cicd/notify/teams.js +1 -2
- package/lib/commands/simply/cicd/notify/teams.js.map +1 -1
- package/lib/commands/simply/cicd/sfdx-dependabot.d.ts +1 -2
- package/lib/commands/simply/cicd/sfdx-dependabot.js +1 -4
- package/lib/commands/simply/cicd/sfdx-dependabot.js.map +1 -1
- package/lib/common/deploy/stageCommand.d.ts +0 -49
- package/lib/common/deploy/stageCommand.js +0 -54
- package/lib/common/deploy/stageCommand.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +3 -12
- package/lib/common/build/checkPermissionSets.d.ts +0 -22
- package/lib/common/build/checkPermissionSets.js +0 -102
- package/lib/common/build/checkPermissionSets.js.map +0 -1
- package/lib/common/build/cleanupScratchOrgs.d.ts +0 -6
- package/lib/common/build/cleanupScratchOrgs.js +0 -91
- package/lib/common/build/cleanupScratchOrgs.js.map +0 -1
- package/lib/common/build/createFallbackTag.d.ts +0 -24
- package/lib/common/build/createFallbackTag.js +0 -147
- package/lib/common/build/createFallbackTag.js.map +0 -1
- package/lib/common/build/createPackageVersion.d.ts +0 -42
- package/lib/common/build/createPackageVersion.js +0 -198
- package/lib/common/build/createPackageVersion.js.map +0 -1
- package/lib/common/build/createScratchOrg.d.ts +0 -14
- package/lib/common/build/createScratchOrg.js +0 -192
- package/lib/common/build/createScratchOrg.js.map +0 -1
- package/lib/common/build/deleteScratchOrg.d.ts +0 -13
- package/lib/common/build/deleteScratchOrg.js +0 -62
- package/lib/common/build/deleteScratchOrg.js.map +0 -1
- package/lib/common/build/deltaRunner.d.ts +0 -73
- package/lib/common/build/deltaRunner.js +0 -109
- package/lib/common/build/deltaRunner.js.map +0 -1
- package/lib/common/build/determinePackageChanges.d.ts +0 -11
- package/lib/common/build/determinePackageChanges.js +0 -90
- package/lib/common/build/determinePackageChanges.js.map +0 -1
- package/lib/common/build/devHubs.d.ts +0 -12
- package/lib/common/build/devHubs.js +0 -42
- package/lib/common/build/devHubs.js.map +0 -1
- package/lib/common/build/flexipageDelta.d.ts +0 -18
- package/lib/common/build/flexipageDelta.js +0 -35
- package/lib/common/build/flexipageDelta.js.map +0 -1
- package/lib/common/build/flowDelta.d.ts +0 -17
- package/lib/common/build/flowDelta.js +0 -34
- package/lib/common/build/flowDelta.js.map +0 -1
- package/lib/common/build/installDependencies.d.ts +0 -10
- package/lib/common/build/installDependencies.js +0 -39
- package/lib/common/build/installDependencies.js.map +0 -1
- package/lib/common/build/lwcJest.d.ts +0 -25
- package/lib/common/build/lwcJest.js +0 -126
- package/lib/common/build/lwcJest.js.map +0 -1
- package/lib/common/build/publishUtamPageObjects.d.ts +0 -50
- package/lib/common/build/publishUtamPageObjects.js +0 -283
- package/lib/common/build/publishUtamPageObjects.js.map +0 -1
- package/lib/common/build/pushScratch.d.ts +0 -9
- package/lib/common/build/pushScratch.js +0 -60
- package/lib/common/build/pushScratch.js.map +0 -1
- package/lib/common/build/scratchOrgAuth.d.ts +0 -18
- package/lib/common/build/scratchOrgAuth.js +0 -52
- package/lib/common/build/scratchOrgAuth.js.map +0 -1
- package/lib/common/build/scratchOrgInfo.d.ts +0 -14
- package/lib/common/build/scratchOrgInfo.js +0 -21
- package/lib/common/build/scratchOrgInfo.js.map +0 -1
- package/lib/common/build/skipGuard.d.ts +0 -8
- package/lib/common/build/skipGuard.js +0 -42
- package/lib/common/build/skipGuard.js.map +0 -1
- package/lib/common/build/testScratch.d.ts +0 -15
- package/lib/common/build/testScratch.js +0 -42
- package/lib/common/build/testScratch.js.map +0 -1
- package/lib/common/build/utamPageObjects.d.ts +0 -143
- package/lib/common/build/utamPageObjects.js +0 -245
- package/lib/common/build/utamPageObjects.js.map +0 -1
- package/lib/common/build/versionTagFormat.d.ts +0 -57
- package/lib/common/build/versionTagFormat.js +0 -194
- package/lib/common/build/versionTagFormat.js.map +0 -1
- package/lib/common/deploy/deployCommon.d.ts +0 -105
- package/lib/common/deploy/deployCommon.js +0 -358
- package/lib/common/deploy/deployCommon.js.map +0 -1
- package/lib/common/deploy/deployHappySoup.d.ts +0 -56
- package/lib/common/deploy/deployHappySoup.js +0 -160
- package/lib/common/deploy/deployHappySoup.js.map +0 -1
- package/lib/common/deploy/deployProject.d.ts +0 -27
- package/lib/common/deploy/deployProject.js +0 -114
- package/lib/common/deploy/deployProject.js.map +0 -1
- package/lib/common/deploy/runDeployStage.d.ts +0 -16
- package/lib/common/deploy/runDeployStage.js +0 -65
- package/lib/common/deploy/runDeployStage.js.map +0 -1
- package/lib/common/deploy/validate.d.ts +0 -11
- package/lib/common/deploy/validate.js +0 -54
- package/lib/common/deploy/validate.js.map +0 -1
- package/lib/common/env.d.ts +0 -9
- package/lib/common/env.js +0 -47
- package/lib/common/env.js.map +0 -1
- package/lib/common/exec/sfCli.d.ts +0 -27
- package/lib/common/exec/sfCli.js +0 -50
- package/lib/common/exec/sfCli.js.map +0 -1
- package/lib/common/flags/env.d.ts +0 -44
- package/lib/common/flags/env.js +0 -81
- package/lib/common/flags/env.js.map +0 -1
- package/lib/common/git.d.ts +0 -32
- package/lib/common/git.js +0 -106
- package/lib/common/git.js.map +0 -1
- package/lib/common/happySoup/resolveOriginProject.d.ts +0 -22
- package/lib/common/happySoup/resolveOriginProject.js +0 -61
- package/lib/common/happySoup/resolveOriginProject.js.map +0 -1
- package/lib/common/logger.d.ts +0 -10
- package/lib/common/logger.js +0 -33
- package/lib/common/logger.js.map +0 -1
- package/lib/common/notify/buildNotification.d.ts +0 -53
- package/lib/common/notify/buildNotification.js +0 -176
- package/lib/common/notify/buildNotification.js.map +0 -1
- package/lib/common/notify/getCommitStories.d.ts +0 -30
- package/lib/common/notify/getCommitStories.js +0 -70
- package/lib/common/notify/getCommitStories.js.map +0 -1
- package/lib/common/notify/getRemoteCommitStories.d.ts +0 -10
- package/lib/common/notify/getRemoteCommitStories.js +0 -45
- package/lib/common/notify/getRemoteCommitStories.js.map +0 -1
- package/lib/common/notify/happySoupNotification.d.ts +0 -26
- package/lib/common/notify/happySoupNotification.js +0 -139
- package/lib/common/notify/happySoupNotification.js.map +0 -1
- package/lib/common/notify/projectNotification.d.ts +0 -46
- package/lib/common/notify/projectNotification.js +0 -177
- package/lib/common/notify/projectNotification.js.map +0 -1
- package/lib/common/notify/renderTemplate.d.ts +0 -3
- package/lib/common/notify/renderTemplate.js +0 -24
- package/lib/common/notify/renderTemplate.js.map +0 -1
- package/lib/common/notify/sendNotification.d.ts +0 -2
- package/lib/common/notify/sendNotification.js +0 -50
- package/lib/common/notify/sendNotification.js.map +0 -1
- package/lib/common/notify/templates.d.ts +0 -13
- package/lib/common/notify/templates.js +0 -118
- package/lib/common/notify/templates.js.map +0 -1
- package/lib/common/schemas/deployConfig.d.ts +0 -25
- package/lib/common/schemas/deployConfig.js +0 -55
- package/lib/common/schemas/deployConfig.js.map +0 -1
- package/lib/common/schemas/deployProgress.d.ts +0 -33
- package/lib/common/schemas/deployProgress.js +0 -46
- package/lib/common/schemas/deployProgress.js.map +0 -1
- package/lib/common/schemas/deployRules.d.ts +0 -34
- package/lib/common/schemas/deployRules.js +0 -40
- package/lib/common/schemas/deployRules.js.map +0 -1
- package/lib/common/sfApex.d.ts +0 -22
- package/lib/common/sfApex.js +0 -169
- package/lib/common/sfApex.js.map +0 -1
- package/lib/common/sfAuth.d.ts +0 -19
- package/lib/common/sfAuth.js +0 -78
- package/lib/common/sfAuth.js.map +0 -1
- package/lib/common/sfConfig.d.ts +0 -23
- package/lib/common/sfConfig.js +0 -82
- package/lib/common/sfConfig.js.map +0 -1
- package/lib/common/sfPackages.d.ts +0 -31
- package/lib/common/sfPackages.js +0 -143
- package/lib/common/sfPackages.js.map +0 -1
- package/lib/common/sfPlugins.d.ts +0 -11
- package/lib/common/sfPlugins.js +0 -134
- package/lib/common/sfPlugins.js.map +0 -1
- package/lib/common/sfdxDependabot/dependabotRun.d.ts +0 -95
- package/lib/common/sfdxDependabot/dependabotRun.js +0 -287
- package/lib/common/sfdxDependabot/dependabotRun.js.map +0 -1
- package/lib/common/sfdxDependabot/updater.d.ts +0 -14
- package/lib/common/sfdxDependabot/updater.js +0 -94
- package/lib/common/sfdxDependabot/updater.js.map +0 -1
- package/lib/config/defaultDeploymentPlugins.d.ts +0 -2
- package/lib/config/defaultDeploymentPlugins.js +0 -18
- package/lib/config/defaultDeploymentPlugins.js.map +0 -1
- package/lib/config/trustedPlugins.d.ts +0 -2
- package/lib/config/trustedPlugins.js +0 -18
- package/lib/config/trustedPlugins.js.map +0 -1
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type DeleteScratchOrgOptions = {
|
|
2
|
-
/** Required only when the Dev Hub and/or scratch org were JWT-authenticated (no refresh token available). */
|
|
3
|
-
jwtKeyFile?: string;
|
|
4
|
-
debug?: boolean;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Authenticates to the Dev Hub that owns the scratch org and deletes it.
|
|
8
|
-
*
|
|
9
|
-
* `devHubAlias` must already be authenticated by the calling pipeline. Deletion failures are
|
|
10
|
-
* logged, not thrown, matching the original behavior: a scratch org that fails to delete just
|
|
11
|
-
* needs manual cleanup later, and shouldn't fail an otherwise-successful pipeline run.
|
|
12
|
-
*/
|
|
13
|
-
export declare function deleteScratchOrg(options: DeleteScratchOrgOptions, devHubAlias: string): Promise<void>;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, SimplySF.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { runSf } from '../exec/sfCli.js';
|
|
17
|
-
import { logger } from '../logger.js';
|
|
18
|
-
import { authenticateOrg } from '../sfAuth.js';
|
|
19
|
-
import { resolveDevHubs } from './devHubs.js';
|
|
20
|
-
import { ensureScratchOrgSession } from './scratchOrgAuth.js';
|
|
21
|
-
import { readScratchOrgInfo } from './scratchOrgInfo.js';
|
|
22
|
-
/**
|
|
23
|
-
* Authenticates to the Dev Hub that owns the scratch org and deletes it.
|
|
24
|
-
*
|
|
25
|
-
* `devHubAlias` must already be authenticated by the calling pipeline. Deletion failures are
|
|
26
|
-
* logged, not thrown, matching the original behavior: a scratch org that fails to delete just
|
|
27
|
-
* needs manual cleanup later, and shouldn't fail an otherwise-successful pipeline run.
|
|
28
|
-
*/
|
|
29
|
-
export async function deleteScratchOrg(options, devHubAlias) {
|
|
30
|
-
logger.info('Deleting scratch org...');
|
|
31
|
-
try {
|
|
32
|
-
const scratchOrgInfo = await readScratchOrgInfo();
|
|
33
|
-
const [hub] = await resolveDevHubs([devHubAlias]);
|
|
34
|
-
if (hub.username !== scratchOrgInfo.authFields.devHubUsername) {
|
|
35
|
-
throw new Error(`--dev-hub ${devHubAlias} (${hub.username}) does not match the Dev Hub that created this scratch org (${scratchOrgInfo.authFields.devHubUsername ?? 'unknown'}).`);
|
|
36
|
-
}
|
|
37
|
-
if (hub.privateKeyFile) {
|
|
38
|
-
// JWT-authenticated Dev Hub: no refresh token exists, so re-mint a session explicitly.
|
|
39
|
-
// A refresh-token-authenticated Dev Hub needs no action here — @salesforce/core refreshes
|
|
40
|
-
// its already-persisted session automatically.
|
|
41
|
-
await authenticateOrg({
|
|
42
|
-
username: hub.username,
|
|
43
|
-
clientId: hub.clientId,
|
|
44
|
-
instanceUrl: hub.instanceUrl,
|
|
45
|
-
jwtKeyFile: hub.privateKeyFile,
|
|
46
|
-
setDefaultDevHub: true,
|
|
47
|
-
debug: options.debug,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
await ensureScratchOrgSession(scratchOrgInfo.authFields, {
|
|
51
|
-
jwtKeyFile: options.jwtKeyFile,
|
|
52
|
-
setDefault: true,
|
|
53
|
-
debug: options.debug,
|
|
54
|
-
});
|
|
55
|
-
await runSf(['org', 'delete', 'scratch', '--no-prompt'], { stdio: 'inherit' });
|
|
56
|
-
logger.success('Scratch org deleted.');
|
|
57
|
-
}
|
|
58
|
-
catch (e) {
|
|
59
|
-
logger.error('Failed to delete scratch org. It may need to be deleted manually.', e.message);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=deleteScratchOrg.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deleteScratchOrg.js","sourceRoot":"","sources":["../../../src/common/build/deleteScratchOrg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAQzD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAgC,EAAE,WAAmB;IAC1F,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACvC,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,MAAM,kBAAkB,EAAE,CAAC;QAClD,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QAClD,IAAI,GAAG,CAAC,QAAQ,KAAK,cAAc,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;YAC9D,MAAM,IAAI,KAAK,CACb,aAAa,WAAW,KAAK,GAAG,CAAC,QAAQ,+DAA+D,cAAc,CAAC,UAAU,CAAC,cAAc,IAAI,SAAS,IAAI,CAClK,CAAC;QACJ,CAAC;QAED,IAAI,GAAG,CAAC,cAAc,EAAE,CAAC;YACvB,uFAAuF;YACvF,0FAA0F;YAC1F,+CAA+C;YAC/C,MAAM,eAAe,CAAC;gBACpB,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,WAAW,EAAE,GAAG,CAAC,WAAW;gBAC5B,UAAU,EAAE,GAAG,CAAC,cAAc;gBAC9B,gBAAgB,EAAE,IAAI;gBACtB,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC,CAAC;QACL,CAAC;QAED,MAAM,uBAAuB,CAAC,cAAc,CAAC,UAAU,EAAE;YACvD,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC;QAEH,MAAM,KAAK,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAC/E,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,CAAC,mEAAmE,EAAG,CAAW,CAAC,OAAO,CAAC,CAAC;IAC1G,CAAC;AACH,CAAC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { type VcsProviderKind } from '@simplysf/simply-cicd-core';
|
|
2
|
-
/**
|
|
3
|
-
* One of the upstream `@syntax-syllogism/flow-delta` diff tools. Each ships a diff binary plus one
|
|
4
|
-
* reporter binary per platform, named `<binary>-<provider kind>`.
|
|
5
|
-
*/
|
|
6
|
-
export type DeltaTool = {
|
|
7
|
-
/** The diff binary, e.g. `flow-delta`. */
|
|
8
|
-
binary: string;
|
|
9
|
-
/** Glob the diff binary scans. */
|
|
10
|
-
path: string;
|
|
11
|
-
/** Output directory used when the caller doesn't name one. */
|
|
12
|
-
defaultOut: string;
|
|
13
|
-
/** Sentence-case label for log lines, e.g. `Flow`. */
|
|
14
|
-
label: string;
|
|
15
|
-
};
|
|
16
|
-
export declare const FLOW_DELTA: DeltaTool;
|
|
17
|
-
export declare const FLEXIPAGE_DELTA: DeltaTool;
|
|
18
|
-
/**
|
|
19
|
-
* Pipeline context handed to the reporter. Everything is optional: each reporter falls back to its
|
|
20
|
-
* platform's own CI environment variables, which the child process inherits, for anything we don't
|
|
21
|
-
* pass explicitly.
|
|
22
|
-
*/
|
|
23
|
-
export type DeltaReporterContext = {
|
|
24
|
-
/** Which platform's reporter to run. Defaults to `gitlab`. */
|
|
25
|
-
vcsProvider?: VcsProviderKind;
|
|
26
|
-
/** Hostname of the VCS instance, used to derive the reporter's `--api-url`. */
|
|
27
|
-
vcsHost?: string;
|
|
28
|
-
/** Token the reporter authenticates with when posting the diff. */
|
|
29
|
-
projectAccessToken?: string;
|
|
30
|
-
commitSha?: string;
|
|
31
|
-
/** GitLab: numeric project ID. */
|
|
32
|
-
ciProjectId?: string;
|
|
33
|
-
/** GitLab: merge request internal ID. */
|
|
34
|
-
ciMergeRequestIid?: string;
|
|
35
|
-
/** GitHub: `owner/repo`. */
|
|
36
|
-
ciRepository?: string;
|
|
37
|
-
/** GitHub: pull request number. */
|
|
38
|
-
ciPullRequestNumber?: string;
|
|
39
|
-
/** GitHub: Actions run ID, used to build artifact links. */
|
|
40
|
-
ciRunId?: string;
|
|
41
|
-
/** GitHub: server URL, for non-github.com instances. */
|
|
42
|
-
ciServerUrl?: string;
|
|
43
|
-
};
|
|
44
|
-
export type RunDeltaOptions = DeltaReporterContext & {
|
|
45
|
-
from: string;
|
|
46
|
-
to: string;
|
|
47
|
-
out?: string;
|
|
48
|
-
debug?: boolean;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Builds the reporter argv for the selected platform. The two reporters take different context
|
|
52
|
-
* flags — GitLab addresses a merge request by project ID and IID, GitHub a pull request by
|
|
53
|
-
* `owner/repo` and number — which is the whole reason this is routed through the VCS choice.
|
|
54
|
-
*/
|
|
55
|
-
export declare function buildReporterArgs(kind: VcsProviderKind, out: string, context: DeltaReporterContext): string[];
|
|
56
|
-
/**
|
|
57
|
-
* Runs a delta tool: the diff binary over the `from..to` range, then the reporter binary for the
|
|
58
|
-
* selected platform to post the result back to the change request. Does not catch its own errors;
|
|
59
|
-
* callers decide how to handle them.
|
|
60
|
-
*/
|
|
61
|
-
export declare function runDelta(tool: DeltaTool, options: RunDeltaOptions): Promise<void>;
|
|
62
|
-
export type GenerateDiffOptions = RunDeltaOptions & {
|
|
63
|
-
disabled?: boolean;
|
|
64
|
-
};
|
|
65
|
-
export type GenerateDiffResult = {
|
|
66
|
-
skipped: boolean;
|
|
67
|
-
success: boolean;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Action-handler wrapper around `runDelta`: checks the job-level skip flag, then runs the delta and
|
|
71
|
-
* logs (rather than throws) on failure, since a diff-posting step shouldn't fail the build.
|
|
72
|
-
*/
|
|
73
|
-
export declare function generateDiff(tool: DeltaTool, options: GenerateDiffOptions): Promise<GenerateDiffResult>;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, SimplySF.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { execa } from 'execa';
|
|
17
|
-
import { createVcsProvider } from '@simplysf/simply-cicd-core';
|
|
18
|
-
import { logger } from '../logger.js';
|
|
19
|
-
import { installFlowDeltaPlugin } from '../sfPlugins.js';
|
|
20
|
-
export const FLOW_DELTA = {
|
|
21
|
-
binary: 'flow-delta',
|
|
22
|
-
path: '**/*.flow-meta.xml',
|
|
23
|
-
defaultOut: 'flow-delta-out',
|
|
24
|
-
label: 'Flow',
|
|
25
|
-
};
|
|
26
|
-
export const FLEXIPAGE_DELTA = {
|
|
27
|
-
binary: 'flexipage-delta',
|
|
28
|
-
path: '**/*.flexipage-meta.xml',
|
|
29
|
-
defaultOut: 'flexipage-delta-out',
|
|
30
|
-
label: 'Flexipage',
|
|
31
|
-
};
|
|
32
|
-
/** Appends `--flag value` only when a value is present, so the reporter's env fallbacks still apply. */
|
|
33
|
-
function pushIfPresent(args, flag, value) {
|
|
34
|
-
if (value) {
|
|
35
|
-
args.push(flag, value);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Builds the reporter argv for the selected platform. The two reporters take different context
|
|
40
|
-
* flags — GitLab addresses a merge request by project ID and IID, GitHub a pull request by
|
|
41
|
-
* `owner/repo` and number — which is the whole reason this is routed through the VCS choice.
|
|
42
|
-
*/
|
|
43
|
-
export function buildReporterArgs(kind, out, context) {
|
|
44
|
-
const args = ['--in', out];
|
|
45
|
-
pushIfPresent(args, '--token', context.projectAccessToken);
|
|
46
|
-
pushIfPresent(args, '--commit-sha', context.commitSha);
|
|
47
|
-
// Ask the provider where its API lives rather than rebuilding the URL here.
|
|
48
|
-
if (context.projectAccessToken) {
|
|
49
|
-
const { apiUrl } = createVcsProvider(kind, { host: context.vcsHost, token: context.projectAccessToken });
|
|
50
|
-
args.push('--api-url', apiUrl);
|
|
51
|
-
}
|
|
52
|
-
if (kind === 'github') {
|
|
53
|
-
pushIfPresent(args, '--repo', context.ciRepository);
|
|
54
|
-
pushIfPresent(args, '--pr', context.ciPullRequestNumber);
|
|
55
|
-
pushIfPresent(args, '--run-id', context.ciRunId);
|
|
56
|
-
pushIfPresent(args, '--server-url', context.ciServerUrl);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
pushIfPresent(args, '--project-id', context.ciProjectId);
|
|
60
|
-
pushIfPresent(args, '--mr-iid', context.ciMergeRequestIid);
|
|
61
|
-
}
|
|
62
|
-
return args;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Runs a delta tool: the diff binary over the `from..to` range, then the reporter binary for the
|
|
66
|
-
* selected platform to post the result back to the change request. Does not catch its own errors;
|
|
67
|
-
* callers decide how to handle them.
|
|
68
|
-
*/
|
|
69
|
-
export async function runDelta(tool, options) {
|
|
70
|
-
const { from, to, out = tool.defaultOut, debug = false, vcsProvider = 'gitlab' } = options;
|
|
71
|
-
if (!from || !to) {
|
|
72
|
-
throw new Error('Missing "from" or "to" commit SHA. Provide --from/--to arguments.');
|
|
73
|
-
}
|
|
74
|
-
await installFlowDeltaPlugin(debug);
|
|
75
|
-
await execa(tool.binary, ['--repo', '.', '--from', from, '--to', to, '--path', tool.path, '--changed-only', '--out', out, '--json'], { stdio: 'inherit' });
|
|
76
|
-
await execa(`${tool.binary}-${vcsProvider}`, buildReporterArgs(vcsProvider, out, options), { stdio: 'inherit' });
|
|
77
|
-
}
|
|
78
|
-
function extractErrorMessage(error, tool) {
|
|
79
|
-
if (error instanceof Error && error.message) {
|
|
80
|
-
return error.message;
|
|
81
|
-
}
|
|
82
|
-
if (typeof error === 'string') {
|
|
83
|
-
return error;
|
|
84
|
-
}
|
|
85
|
-
return `Unknown error running ${tool.binary}`;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Action-handler wrapper around `runDelta`: checks the job-level skip flag, then runs the delta and
|
|
89
|
-
* logs (rather than throws) on failure, since a diff-posting step shouldn't fail the build.
|
|
90
|
-
*/
|
|
91
|
-
export async function generateDiff(tool, options) {
|
|
92
|
-
const lowerLabel = tool.label.toLowerCase();
|
|
93
|
-
if (options.disabled) {
|
|
94
|
-
logger.info(`${tool.label} diff generation is disabled. Skipping.`);
|
|
95
|
-
return { skipped: true, success: false };
|
|
96
|
-
}
|
|
97
|
-
logger.info(`Generating ${lowerLabel} diff using ${tool.binary}...`);
|
|
98
|
-
try {
|
|
99
|
-
await runDelta(tool, options);
|
|
100
|
-
logger.success(`${tool.label} diff generation completed.`);
|
|
101
|
-
return { skipped: false, success: true };
|
|
102
|
-
}
|
|
103
|
-
catch (error) {
|
|
104
|
-
logger.error(`${tool.label} diff generation failed.`);
|
|
105
|
-
logger.error(extractErrorMessage(error, tool));
|
|
106
|
-
return { skipped: false, success: false };
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=deltaRunner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deltaRunner.js","sourceRoot":"","sources":["../../../src/common/build/deltaRunner.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type DeterminePackageChangesOptions = {
|
|
2
|
-
out?: string;
|
|
3
|
-
debug?: boolean;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Detects whether any files under the default package directory (or `sfdx-project.json` itself)
|
|
7
|
-
* have changed since the last release tag, and writes the result as a dotenv file. Any failure
|
|
8
|
-
* during detection (missing/invalid sfdx-project.json, git errors) defaults to `PACKAGE_CHANGED=TRUE`
|
|
9
|
-
* so a build never silently skips work it should have done.
|
|
10
|
-
*/
|
|
11
|
-
export declare function determinePackageChanges(options: DeterminePackageChangesOptions): Promise<void>;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, SimplySF.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { promises as fs } from 'node:fs';
|
|
17
|
-
import { execa } from 'execa';
|
|
18
|
-
import { getDefaultPackageDirectory, readSfdxProject } from '@simplysf/simply-core';
|
|
19
|
-
import { logger } from '../logger.js';
|
|
20
|
-
import { VersionTagFormat } from './versionTagFormat.js';
|
|
21
|
-
async function resolveLastTag(tagMatchPattern) {
|
|
22
|
-
try {
|
|
23
|
-
const { stdout } = await execa('git', ['describe', '--tags', '--abbrev=0', '--match', tagMatchPattern]);
|
|
24
|
-
return stdout.trim();
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
logger.info(`No previous release tag (${tagMatchPattern}) found. A full package build is required.`);
|
|
28
|
-
return '';
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
async function detectChangesSincePackagePath(packagePath, lastTag) {
|
|
32
|
-
logger.info(`Running git diff on path: "${packagePath}" and "sfdx-project.json"`);
|
|
33
|
-
const { stdout: diffOutput } = await execa('git', [
|
|
34
|
-
'diff',
|
|
35
|
-
'--name-only',
|
|
36
|
-
lastTag,
|
|
37
|
-
'HEAD',
|
|
38
|
-
'--',
|
|
39
|
-
packagePath,
|
|
40
|
-
'sfdx-project.json',
|
|
41
|
-
]);
|
|
42
|
-
if (diffOutput.trim().length > 0) {
|
|
43
|
-
logger.info(`Changes detected in package directory or project config:\n${diffOutput}`);
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
logger.success('No changes detected in package directory or project config.');
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
async function detectPackageChanges() {
|
|
50
|
-
const projectJson = await readSfdxProject();
|
|
51
|
-
const defaultDir = getDefaultPackageDirectory(projectJson);
|
|
52
|
-
if (!defaultDir?.path) {
|
|
53
|
-
logger.warn('No default package directory found in sfdx-project.json. Defaulting to PACKAGE_CHANGED=FALSE.');
|
|
54
|
-
return { packageChanged: false, lastTag: '' };
|
|
55
|
-
}
|
|
56
|
-
logger.info('Fetching remote tags...');
|
|
57
|
-
await execa('git', ['fetch', '--tags']);
|
|
58
|
-
const tagMatchPattern = VersionTagFormat.fromProject(projectJson).matchPattern(defaultDir.versionNumber);
|
|
59
|
-
const lastTag = await resolveLastTag(tagMatchPattern);
|
|
60
|
-
if (!lastTag) {
|
|
61
|
-
return { packageChanged: true, lastTag: '' };
|
|
62
|
-
}
|
|
63
|
-
logger.info(`Last package tag found: ${lastTag}`);
|
|
64
|
-
const packageChanged = await detectChangesSincePackagePath(defaultDir.path, lastTag);
|
|
65
|
-
return { packageChanged, lastTag };
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Detects whether any files under the default package directory (or `sfdx-project.json` itself)
|
|
69
|
-
* have changed since the last release tag, and writes the result as a dotenv file. Any failure
|
|
70
|
-
* during detection (missing/invalid sfdx-project.json, git errors) defaults to `PACKAGE_CHANGED=TRUE`
|
|
71
|
-
* so a build never silently skips work it should have done.
|
|
72
|
-
*/
|
|
73
|
-
export async function determinePackageChanges(options) {
|
|
74
|
-
logger.info('Determining package changes...');
|
|
75
|
-
const outFile = options.out ?? 'changes.env';
|
|
76
|
-
let packageChanged;
|
|
77
|
-
let lastTag;
|
|
78
|
-
try {
|
|
79
|
-
({ packageChanged, lastTag } = await detectPackageChanges());
|
|
80
|
-
}
|
|
81
|
-
catch (err) {
|
|
82
|
-
logger.error(`Error during change detection: ${err.message}. Defaulting to full build.`);
|
|
83
|
-
packageChanged = true;
|
|
84
|
-
lastTag = '';
|
|
85
|
-
}
|
|
86
|
-
const envContent = `PACKAGE_CHANGED=${packageChanged ? 'TRUE' : 'FALSE'}\nLAST_TAG=${lastTag}\n`;
|
|
87
|
-
await fs.writeFile(outFile, envContent, 'utf-8');
|
|
88
|
-
logger.success(`Wrote change detection results to ${outFile}`);
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=determinePackageChanges.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"determinePackageChanges.js","sourceRoot":"","sources":["../../../src/common/build/determinePackageChanges.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type ResolvedDevHub = {
|
|
2
|
-
/** The alias (or username) the caller passed in. */
|
|
3
|
-
alias: string;
|
|
4
|
-
/** The Dev Hub's canonical username, resolved from the alias. */
|
|
5
|
-
username: string;
|
|
6
|
-
instanceUrl: string;
|
|
7
|
-
clientId?: string;
|
|
8
|
-
/** Only present when the Dev Hub was JWT-authenticated. */
|
|
9
|
-
privateKeyFile?: string;
|
|
10
|
-
};
|
|
11
|
-
/** Resolves multiple Dev Hub aliases in parallel. Each must already be authenticated. */
|
|
12
|
-
export declare function resolveDevHubs(aliases: string[]): Promise<ResolvedDevHub[]>;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, SimplySF.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { AuthInfo } from '@salesforce/core';
|
|
17
|
-
/**
|
|
18
|
-
* Resolves a Dev Hub alias to its already-authenticated config. `simply-cicd` never authenticates
|
|
19
|
-
* Dev Hubs itself — the alias must already be authenticated (by the calling pipeline, however it
|
|
20
|
-
* chooses to do that: JWT, web, SFDX auth-url, or Client Credentials) before this runs.
|
|
21
|
-
*
|
|
22
|
-
* `clientId`/`instanceUrl`/`privateKey` are all stored in plaintext in a Dev Hub's `AuthInfo` (only
|
|
23
|
-
* token/password/secret-named fields are encrypted at rest), so no decryption is needed to read them.
|
|
24
|
-
*
|
|
25
|
-
* @throws {SfError} `NamedOrgNotFoundError` if the alias hasn't already been authenticated.
|
|
26
|
-
*/
|
|
27
|
-
async function resolveDevHub(alias) {
|
|
28
|
-
const authInfo = await AuthInfo.create({ username: alias });
|
|
29
|
-
const fields = authInfo.getFields();
|
|
30
|
-
return {
|
|
31
|
-
alias,
|
|
32
|
-
username: authInfo.getUsername(),
|
|
33
|
-
instanceUrl: fields.instanceUrl ?? '',
|
|
34
|
-
clientId: fields.clientId,
|
|
35
|
-
privateKeyFile: fields.privateKey,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/** Resolves multiple Dev Hub aliases in parallel. Each must already be authenticated. */
|
|
39
|
-
export async function resolveDevHubs(aliases) {
|
|
40
|
-
return Promise.all(aliases.map(resolveDevHub));
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=devHubs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devHubs.js","sourceRoot":"","sources":["../../../src/common/build/devHubs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAa5C;;;;;;;;;GASG;AACH,KAAK,UAAU,aAAa,CAAC,KAAa;IACxC,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;IAEpC,OAAO;QACL,KAAK;QACL,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE;QAChC,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,EAAE;QACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,cAAc,EAAE,MAAM,CAAC,UAAU;KAClC,CAAC;AACJ,CAAC;AAED,yFAAyF;AACzF,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAiB;IACpD,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type GenerateDiffOptions, type GenerateDiffResult, type RunDeltaOptions } from './deltaRunner.js';
|
|
2
|
-
export type RunFlexipageDeltaOptions = RunDeltaOptions;
|
|
3
|
-
export type GenerateFlexipageDiffOptions = GenerateDiffOptions;
|
|
4
|
-
export type GenerateFlexipageDiffResult = GenerateDiffResult;
|
|
5
|
-
/**
|
|
6
|
-
* Runs the upstream `flexipage-delta` binary over the commit range, then the reporter binary for
|
|
7
|
-
* the selected VCS platform. Does not catch its own errors; callers decide how to handle them.
|
|
8
|
-
*/
|
|
9
|
-
export declare function runFlexipageDelta(options: RunFlexipageDeltaOptions): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Action-handler wrapper around `runFlexipageDelta`: checks the job-level skip flag, then runs the
|
|
12
|
-
* flexipage delta and logs (rather than throws) on failure, since a diff-posting step shouldn't
|
|
13
|
-
* fail the build.
|
|
14
|
-
*
|
|
15
|
-
* Fixes a bug from the original: the CLI wired its skip flag as `--disabled`, but this function
|
|
16
|
-
* checked `options.disableFlexipageDiff` — a property nothing ever set — so `--disabled` was a no-op.
|
|
17
|
-
*/
|
|
18
|
-
export declare function generateFlexipageDiff(options: GenerateFlexipageDiffOptions): Promise<GenerateFlexipageDiffResult>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, SimplySF.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { FLEXIPAGE_DELTA, generateDiff, runDelta, } from './deltaRunner.js';
|
|
17
|
-
/**
|
|
18
|
-
* Runs the upstream `flexipage-delta` binary over the commit range, then the reporter binary for
|
|
19
|
-
* the selected VCS platform. Does not catch its own errors; callers decide how to handle them.
|
|
20
|
-
*/
|
|
21
|
-
export async function runFlexipageDelta(options) {
|
|
22
|
-
return runDelta(FLEXIPAGE_DELTA, options);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Action-handler wrapper around `runFlexipageDelta`: checks the job-level skip flag, then runs the
|
|
26
|
-
* flexipage delta and logs (rather than throws) on failure, since a diff-posting step shouldn't
|
|
27
|
-
* fail the build.
|
|
28
|
-
*
|
|
29
|
-
* Fixes a bug from the original: the CLI wired its skip flag as `--disabled`, but this function
|
|
30
|
-
* checked `options.disableFlexipageDiff` — a property nothing ever set — so `--disabled` was a no-op.
|
|
31
|
-
*/
|
|
32
|
-
export async function generateFlexipageDiff(options) {
|
|
33
|
-
return generateDiff(FLEXIPAGE_DELTA, options);
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=flexipageDelta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flexipageDelta.js","sourceRoot":"","sources":["../../../src/common/build/flexipageDelta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,eAAe,EACf,YAAY,EACZ,QAAQ,GAIT,MAAM,kBAAkB,CAAC;AAM1B;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAiC;IACvE,OAAO,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAAqC;IAErC,OAAO,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type GenerateDiffOptions, type GenerateDiffResult, type RunDeltaOptions } from './deltaRunner.js';
|
|
2
|
-
export type RunFlowDeltaOptions = RunDeltaOptions;
|
|
3
|
-
export type GenerateFlowDiffOptions = GenerateDiffOptions;
|
|
4
|
-
export type GenerateFlowDiffResult = GenerateDiffResult;
|
|
5
|
-
/**
|
|
6
|
-
* Runs the upstream `flow-delta` binary over the commit range, then the reporter binary for the
|
|
7
|
-
* selected VCS platform. Does not catch its own errors; callers decide how to handle them.
|
|
8
|
-
*/
|
|
9
|
-
export declare function runFlowDelta(options: RunFlowDeltaOptions): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Action-handler wrapper around `runFlowDelta`: checks the job-level skip flag, then runs the flow
|
|
12
|
-
* delta and logs (rather than throws) on failure, since a diff-posting step shouldn't fail the build.
|
|
13
|
-
*
|
|
14
|
-
* Fixes a bug from the original: the CLI wired its skip flag as `--disabled`, but this function
|
|
15
|
-
* checked `options.disableFlowDiff` — a property nothing ever set — so `--disabled` was a no-op.
|
|
16
|
-
*/
|
|
17
|
-
export declare function generateFlowDiff(options: GenerateFlowDiffOptions): Promise<GenerateFlowDiffResult>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, SimplySF.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { FLOW_DELTA, generateDiff, runDelta, } from './deltaRunner.js';
|
|
17
|
-
/**
|
|
18
|
-
* Runs the upstream `flow-delta` binary over the commit range, then the reporter binary for the
|
|
19
|
-
* selected VCS platform. Does not catch its own errors; callers decide how to handle them.
|
|
20
|
-
*/
|
|
21
|
-
export async function runFlowDelta(options) {
|
|
22
|
-
return runDelta(FLOW_DELTA, options);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Action-handler wrapper around `runFlowDelta`: checks the job-level skip flag, then runs the flow
|
|
26
|
-
* delta and logs (rather than throws) on failure, since a diff-posting step shouldn't fail the build.
|
|
27
|
-
*
|
|
28
|
-
* Fixes a bug from the original: the CLI wired its skip flag as `--disabled`, but this function
|
|
29
|
-
* checked `options.disableFlowDiff` — a property nothing ever set — so `--disabled` was a no-op.
|
|
30
|
-
*/
|
|
31
|
-
export async function generateFlowDiff(options) {
|
|
32
|
-
return generateDiff(FLOW_DELTA, options);
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=flowDelta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flowDelta.js","sourceRoot":"","sources":["../../../src/common/build/flowDelta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,UAAU,EACV,YAAY,EACZ,QAAQ,GAIT,MAAM,kBAAkB,CAAC;AAM1B;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAA4B;IAC7D,OAAO,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAgC;IACrE,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type PackageInstallUpgradeType } from '../sfPackages.js';
|
|
2
|
-
export type InstallDependenciesOptions = {
|
|
3
|
-
/** Required only when the scratch org's Dev Hub was JWT-authenticated (no refresh token available). */
|
|
4
|
-
jwtKeyFile?: string;
|
|
5
|
-
debug?: boolean;
|
|
6
|
-
installType?: 'All' | 'Delta' | 'Upgrade';
|
|
7
|
-
upgradeType?: PackageInstallUpgradeType;
|
|
8
|
-
};
|
|
9
|
-
/** Authenticates to the scratch org (recorded in `SCRATCH_ORG_INFO.json`) and installs its packaged dependencies. */
|
|
10
|
-
export declare function installDependencies(options: InstallDependenciesOptions): Promise<void>;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, SimplySF.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { logger } from '../logger.js';
|
|
17
|
-
import { installPackageDependencies as installPackageDependenciesCommon, } from '../sfPackages.js';
|
|
18
|
-
import { ensureScratchOrgSession } from './scratchOrgAuth.js';
|
|
19
|
-
import { readScratchOrgInfo } from './scratchOrgInfo.js';
|
|
20
|
-
/** Authenticates to the scratch org (recorded in `SCRATCH_ORG_INFO.json`) and installs its packaged dependencies. */
|
|
21
|
-
export async function installDependencies(options) {
|
|
22
|
-
logger.info('Installing package dependencies into scratch org...');
|
|
23
|
-
const scratchOrgInfo = await readScratchOrgInfo();
|
|
24
|
-
await ensureScratchOrgSession(scratchOrgInfo.authFields, {
|
|
25
|
-
jwtKeyFile: options.jwtKeyFile,
|
|
26
|
-
setDefault: true,
|
|
27
|
-
debug: options.debug,
|
|
28
|
-
});
|
|
29
|
-
// The install runs in-process (not via a child `sf` invocation that would read the default org
|
|
30
|
-
// just written to config), so target the scratch org explicitly by its username.
|
|
31
|
-
await installPackageDependenciesCommon({
|
|
32
|
-
alias: scratchOrgInfo.authFields.username,
|
|
33
|
-
wait: '240',
|
|
34
|
-
installType: options.installType,
|
|
35
|
-
upgradeType: options.upgradeType,
|
|
36
|
-
});
|
|
37
|
-
logger.success('Package dependencies installed.');
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=installDependencies.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installDependencies.js","sourceRoot":"","sources":["../../../src/common/build/installDependencies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,0BAA0B,IAAI,gCAAgC,GAE/D,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAUzD,qHAAqH;AACrH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAmC;IAC3E,MAAM,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;IACnE,MAAM,cAAc,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAClD,MAAM,uBAAuB,CAAC,cAAc,CAAC,UAAU,EAAE;QACvD,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC;IACH,+FAA+F;IAC/F,iFAAiF;IACjF,MAAM,gCAAgC,CAAC;QACrC,KAAK,EAAE,cAAc,CAAC,UAAU,CAAC,QAAQ;QACzC,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,WAAW,EAAE,OAAO,CAAC,WAAW;KACjC,CAAC,CAAC;IACH,MAAM,CAAC,OAAO,CAAC,iCAAiC,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/** Where `runLwcJest` writes the JUnit report, mirroring `runApexTests`'s `./test-results/apex`. */
|
|
2
|
-
export declare const LWC_JEST_RESULTS_DIR = "./test-results/lwc";
|
|
3
|
-
export declare const LWC_JEST_RESULTS_FILE = "test-result.xml";
|
|
4
|
-
export type RunLwcJestOptions = {
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
failOnTestFailure?: boolean;
|
|
7
|
-
projectDir?: string;
|
|
8
|
-
};
|
|
9
|
-
export type RunLwcJestResult = {
|
|
10
|
-
skipped: boolean;
|
|
11
|
-
success: boolean;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Builds an ES module Jest config that loads the project's own config and adds `jest-junit` to its
|
|
15
|
-
* reporters, rather than replacing them the way a CLI `--reporters` would. `rootDir` is pinned to the
|
|
16
|
-
* project, since Jest would otherwise default it to the wrapper's own (temporary) directory.
|
|
17
|
-
*/
|
|
18
|
-
export declare function buildJunitJestConfig(projectConfigFile: string, projectDir: string): string;
|
|
19
|
-
/**
|
|
20
|
-
* Installs the LWC Jest test libraries and runs the project's LWC Jest tests with coverage, writing
|
|
21
|
-
* a JUnit report to `./test-results/lwc/test-result.xml` alongside any reporters the project's own
|
|
22
|
-
* Jest config sets. A failure is logged and returned, unless `failOnTestFailure` is set, in which
|
|
23
|
-
* case it also throws.
|
|
24
|
-
*/
|
|
25
|
-
export declare function runLwcJest(options: RunLwcJestOptions): Promise<RunLwcJestResult>;
|