@simplysf/simply-cicd 0.3.0
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 +1621 -0
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.d.ts +21 -0
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js +47 -0
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js.map +1 -0
- package/lib/commands/simply/cicd/build/create-fallback-tag.d.ts +25 -0
- package/lib/commands/simply/cicd/build/create-fallback-tag.js +63 -0
- package/lib/commands/simply/cicd/build/create-fallback-tag.js.map +1 -0
- package/lib/commands/simply/cicd/build/create-package-version.d.ts +32 -0
- package/lib/commands/simply/cicd/build/create-package-version.js +110 -0
- package/lib/commands/simply/cicd/build/create-package-version.js.map +1 -0
- package/lib/commands/simply/cicd/build/create-scratch.d.ts +25 -0
- package/lib/commands/simply/cicd/build/create-scratch.js +63 -0
- package/lib/commands/simply/cicd/build/create-scratch.js.map +1 -0
- package/lib/commands/simply/cicd/build/delete-scratch.d.ts +21 -0
- package/lib/commands/simply/cicd/build/delete-scratch.js +53 -0
- package/lib/commands/simply/cicd/build/delete-scratch.js.map +1 -0
- package/lib/commands/simply/cicd/build/determine-package-changes.d.ts +17 -0
- package/lib/commands/simply/cicd/build/determine-package-changes.js +44 -0
- package/lib/commands/simply/cicd/build/determine-package-changes.js.map +1 -0
- package/lib/commands/simply/cicd/build/generate-flexipage-diff.d.ts +20 -0
- package/lib/commands/simply/cicd/build/generate-flexipage-diff.js +47 -0
- package/lib/commands/simply/cicd/build/generate-flexipage-diff.js.map +1 -0
- package/lib/commands/simply/cicd/build/generate-flow-diff.d.ts +20 -0
- package/lib/commands/simply/cicd/build/generate-flow-diff.js +47 -0
- package/lib/commands/simply/cicd/build/generate-flow-diff.js.map +1 -0
- package/lib/commands/simply/cicd/build/install-dependencies.d.ts +18 -0
- package/lib/commands/simply/cicd/build/install-dependencies.js +58 -0
- package/lib/commands/simply/cicd/build/install-dependencies.js.map +1 -0
- package/lib/commands/simply/cicd/build/lwc-jest.d.ts +14 -0
- package/lib/commands/simply/cicd/build/lwc-jest.js +37 -0
- package/lib/commands/simply/cicd/build/lwc-jest.js.map +1 -0
- package/lib/commands/simply/cicd/build/push-scratch.d.ts +19 -0
- package/lib/commands/simply/cicd/build/push-scratch.js +57 -0
- package/lib/commands/simply/cicd/build/push-scratch.js.map +1 -0
- package/lib/commands/simply/cicd/build/test-scratch.d.ts +18 -0
- package/lib/commands/simply/cicd/build/test-scratch.js +58 -0
- package/lib/commands/simply/cicd/build/test-scratch.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.d.ts +29 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js +36 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.d.ts +23 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js +82 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.d.ts +21 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js +57 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.d.ts +29 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js +36 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.d.ts +29 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js +36 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.d.ts +29 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js +36 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.d.ts +28 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js +89 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/validate.d.ts +15 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/validate.js +49 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/validate.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.d.ts +28 -0
- package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js +36 -0
- package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/install-packaged.d.ts +24 -0
- package/lib/commands/simply/cicd/deploy/project/install-packaged.js +69 -0
- package/lib/commands/simply/cicd/deploy/project/install-packaged.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/post-deploy.d.ts +28 -0
- package/lib/commands/simply/cicd/deploy/project/post-deploy.js +36 -0
- package/lib/commands/simply/cicd/deploy/project/post-deploy.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/post-destructive.d.ts +28 -0
- package/lib/commands/simply/cicd/deploy/project/post-destructive.js +36 -0
- package/lib/commands/simply/cicd/deploy/project/post-destructive.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/pre-destructive.d.ts +28 -0
- package/lib/commands/simply/cicd/deploy/project/pre-destructive.js +36 -0
- package/lib/commands/simply/cicd/deploy/project/pre-destructive.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/run-apex-tests.d.ts +26 -0
- package/lib/commands/simply/cicd/deploy/project/run-apex-tests.js +66 -0
- package/lib/commands/simply/cicd/deploy/project/run-apex-tests.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/validate.d.ts +14 -0
- package/lib/commands/simply/cicd/deploy/project/validate.js +51 -0
- package/lib/commands/simply/cicd/deploy/project/validate.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/validate.d.ts +14 -0
- package/lib/commands/simply/cicd/deploy/validate.js +50 -0
- package/lib/commands/simply/cicd/deploy/validate.js.map +1 -0
- package/lib/commands/simply/cicd/notify/happy-soup.d.ts +32 -0
- package/lib/commands/simply/cicd/notify/happy-soup.js +193 -0
- package/lib/commands/simply/cicd/notify/happy-soup.js.map +1 -0
- package/lib/commands/simply/cicd/notify/project.d.ts +51 -0
- package/lib/commands/simply/cicd/notify/project.js +376 -0
- package/lib/commands/simply/cicd/notify/project.js.map +1 -0
- package/lib/commands/simply/cicd/notify/teams.d.ts +18 -0
- package/lib/commands/simply/cicd/notify/teams.js +77 -0
- package/lib/commands/simply/cicd/notify/teams.js.map +1 -0
- package/lib/commands/simply/cicd/sfdx-dependabot.d.ts +84 -0
- package/lib/commands/simply/cicd/sfdx-dependabot.js +469 -0
- package/lib/commands/simply/cicd/sfdx-dependabot.js.map +1 -0
- package/lib/common/build/cleanupScratchOrgs.d.ts +7 -0
- package/lib/common/build/cleanupScratchOrgs.js +91 -0
- package/lib/common/build/cleanupScratchOrgs.js.map +1 -0
- package/lib/common/build/createFallbackTag.d.ts +24 -0
- package/lib/common/build/createFallbackTag.js +96 -0
- package/lib/common/build/createFallbackTag.js.map +1 -0
- package/lib/common/build/createPackageVersion.d.ts +27 -0
- package/lib/common/build/createPackageVersion.js +164 -0
- package/lib/common/build/createPackageVersion.js.map +1 -0
- package/lib/common/build/createScratchOrg.d.ts +14 -0
- package/lib/common/build/createScratchOrg.js +191 -0
- package/lib/common/build/createScratchOrg.js.map +1 -0
- package/lib/common/build/deleteScratchOrg.d.ts +12 -0
- package/lib/common/build/deleteScratchOrg.js +58 -0
- package/lib/common/build/deleteScratchOrg.js.map +1 -0
- package/lib/common/build/determinePackageChanges.d.ts +13 -0
- package/lib/common/build/determinePackageChanges.js +98 -0
- package/lib/common/build/determinePackageChanges.js.map +1 -0
- package/lib/common/build/devHubs.d.ts +8 -0
- package/lib/common/build/devHubs.js +30 -0
- package/lib/common/build/devHubs.js.map +1 -0
- package/lib/common/build/flags.d.ts +36 -0
- package/lib/common/build/flags.js +120 -0
- package/lib/common/build/flags.js.map +1 -0
- package/lib/common/build/flexipageDelta.d.ts +31 -0
- package/lib/common/build/flexipageDelta.js +92 -0
- package/lib/common/build/flexipageDelta.js.map +1 -0
- package/lib/common/build/flowDelta.d.ts +30 -0
- package/lib/common/build/flowDelta.js +91 -0
- package/lib/common/build/flowDelta.js.map +1 -0
- package/lib/common/build/installDependencies.d.ts +7 -0
- package/lib/common/build/installDependencies.js +36 -0
- package/lib/common/build/installDependencies.js.map +1 -0
- package/lib/common/build/lwcJest.d.ts +9 -0
- package/lib/common/build/lwcJest.js +36 -0
- package/lib/common/build/lwcJest.js.map +1 -0
- package/lib/common/build/pushScratch.d.ts +8 -0
- package/lib/common/build/pushScratch.js +63 -0
- package/lib/common/build/pushScratch.js.map +1 -0
- package/lib/common/build/scratchOrgInfo.d.ts +10 -0
- package/lib/common/build/scratchOrgInfo.js +21 -0
- package/lib/common/build/scratchOrgInfo.js.map +1 -0
- package/lib/common/build/skipGuard.d.ts +8 -0
- package/lib/common/build/skipGuard.js +41 -0
- package/lib/common/build/skipGuard.js.map +1 -0
- package/lib/common/build/testScratch.d.ts +14 -0
- package/lib/common/build/testScratch.js +45 -0
- package/lib/common/build/testScratch.js.map +1 -0
- package/lib/common/deploy/deployCommon.d.ts +101 -0
- package/lib/common/deploy/deployCommon.js +361 -0
- package/lib/common/deploy/deployCommon.js.map +1 -0
- package/lib/common/deploy/deployHappySoup.d.ts +54 -0
- package/lib/common/deploy/deployHappySoup.js +143 -0
- package/lib/common/deploy/deployHappySoup.js.map +1 -0
- package/lib/common/deploy/deployProject.d.ts +24 -0
- package/lib/common/deploy/deployProject.js +114 -0
- package/lib/common/deploy/deployProject.js.map +1 -0
- package/lib/common/deploy/flags.d.ts +34 -0
- package/lib/common/deploy/flags.js +91 -0
- package/lib/common/deploy/flags.js.map +1 -0
- package/lib/common/deploy/runDeployStage.d.ts +16 -0
- package/lib/common/deploy/runDeployStage.js +65 -0
- package/lib/common/deploy/runDeployStage.js.map +1 -0
- package/lib/common/deploy/stageCommand.d.ts +106 -0
- package/lib/common/deploy/stageCommand.js +131 -0
- package/lib/common/deploy/stageCommand.js.map +1 -0
- package/lib/common/deploy/validate.d.ts +11 -0
- package/lib/common/deploy/validate.js +54 -0
- package/lib/common/deploy/validate.js.map +1 -0
- package/lib/common/env.d.ts +9 -0
- package/lib/common/env.js +47 -0
- package/lib/common/env.js.map +1 -0
- package/lib/common/exec/sfCli.d.ts +27 -0
- package/lib/common/exec/sfCli.js +50 -0
- package/lib/common/exec/sfCli.js.map +1 -0
- package/lib/common/flags/env.d.ts +44 -0
- package/lib/common/flags/env.js +81 -0
- package/lib/common/flags/env.js.map +1 -0
- package/lib/common/git.d.ts +19 -0
- package/lib/common/git.js +79 -0
- package/lib/common/git.js.map +1 -0
- package/lib/common/logger.d.ts +10 -0
- package/lib/common/logger.js +33 -0
- package/lib/common/logger.js.map +1 -0
- package/lib/common/notify/getCommitStories.d.ts +16 -0
- package/lib/common/notify/getCommitStories.js +69 -0
- package/lib/common/notify/getCommitStories.js.map +1 -0
- package/lib/common/notify/renderTemplate.d.ts +3 -0
- package/lib/common/notify/renderTemplate.js +24 -0
- package/lib/common/notify/renderTemplate.js.map +1 -0
- package/lib/common/notify/sendNotification.d.ts +2 -0
- package/lib/common/notify/sendNotification.js +50 -0
- package/lib/common/notify/sendNotification.js.map +1 -0
- package/lib/common/notify/templates.d.ts +11 -0
- package/lib/common/notify/templates.js +85 -0
- package/lib/common/notify/templates.js.map +1 -0
- package/lib/common/schemas/deployConfig.d.ts +25 -0
- package/lib/common/schemas/deployConfig.js +55 -0
- package/lib/common/schemas/deployConfig.js.map +1 -0
- package/lib/common/schemas/deployProgress.d.ts +10 -0
- package/lib/common/schemas/deployProgress.js +27 -0
- package/lib/common/schemas/deployProgress.js.map +1 -0
- package/lib/common/schemas/deployRules.d.ts +34 -0
- package/lib/common/schemas/deployRules.js +40 -0
- package/lib/common/schemas/deployRules.js.map +1 -0
- package/lib/common/sfApex.d.ts +22 -0
- package/lib/common/sfApex.js +158 -0
- package/lib/common/sfApex.js.map +1 -0
- package/lib/common/sfAuth.d.ts +30 -0
- package/lib/common/sfAuth.js +99 -0
- package/lib/common/sfAuth.js.map +1 -0
- package/lib/common/sfConfig.d.ts +6 -0
- package/lib/common/sfConfig.js +45 -0
- package/lib/common/sfConfig.js.map +1 -0
- package/lib/common/sfPackages.d.ts +12 -0
- package/lib/common/sfPackages.js +53 -0
- package/lib/common/sfPackages.js.map +1 -0
- package/lib/common/sfPlugins.d.ts +11 -0
- package/lib/common/sfPlugins.js +134 -0
- package/lib/common/sfPlugins.js.map +1 -0
- package/lib/common/sfdxDependabot/updater.d.ts +14 -0
- package/lib/common/sfdxDependabot/updater.js +94 -0
- package/lib/common/sfdxDependabot/updater.js.map +1 -0
- package/lib/common/vcs/gitlab.d.ts +21 -0
- package/lib/common/vcs/gitlab.js +208 -0
- package/lib/common/vcs/gitlab.js.map +1 -0
- package/lib/common/vcs/index.d.ts +4 -0
- package/lib/common/vcs/index.js +26 -0
- package/lib/common/vcs/index.js.map +1 -0
- package/lib/common/vcs/types.d.ts +69 -0
- package/lib/common/vcs/types.js +17 -0
- package/lib/common/vcs/types.js.map +1 -0
- package/lib/config/defaultDeploymentPlugins.d.ts +2 -0
- package/lib/config/defaultDeploymentPlugins.js +18 -0
- package/lib/config/defaultDeploymentPlugins.js.map +1 -0
- package/lib/config/trustedPlugins.d.ts +2 -0
- package/lib/config/trustedPlugins.js +18 -0
- package/lib/config/trustedPlugins.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +17 -0
- package/lib/index.js.map +1 -0
- package/messages/simply.cicd.build.cleanup-scratch-orgs.md +11 -0
- package/messages/simply.cicd.build.create-fallback-tag.md +21 -0
- package/messages/simply.cicd.build.create-package-version.md +49 -0
- package/messages/simply.cicd.build.create-scratch.md +21 -0
- package/messages/simply.cicd.build.delete-scratch.md +13 -0
- package/messages/simply.cicd.build.determine-package-changes.md +15 -0
- package/messages/simply.cicd.build.generate-flexipage-diff.md +11 -0
- package/messages/simply.cicd.build.generate-flow-diff.md +11 -0
- package/messages/simply.cicd.build.install-dependencies.md +17 -0
- package/messages/simply.cicd.build.lwc-jest.md +11 -0
- package/messages/simply.cicd.build.md +75 -0
- package/messages/simply.cicd.build.push-scratch.md +21 -0
- package/messages/simply.cicd.build.test-scratch.md +17 -0
- package/messages/simply.cicd.deploy.happy-soup.deploy-unpackaged.md +11 -0
- package/messages/simply.cicd.deploy.happy-soup.deployment-close-out.md +39 -0
- package/messages/simply.cicd.deploy.happy-soup.install-packaged.md +15 -0
- package/messages/simply.cicd.deploy.happy-soup.post-deploy.md +11 -0
- package/messages/simply.cicd.deploy.happy-soup.post-destructive.md +11 -0
- package/messages/simply.cicd.deploy.happy-soup.pre-destructive.md +11 -0
- package/messages/simply.cicd.deploy.happy-soup.tag-deployment.md +35 -0
- package/messages/simply.cicd.deploy.happy-soup.validate.md +25 -0
- package/messages/simply.cicd.deploy.md +75 -0
- package/messages/simply.cicd.deploy.project.deploy-unpackaged.md +11 -0
- package/messages/simply.cicd.deploy.project.install-packaged.md +23 -0
- package/messages/simply.cicd.deploy.project.post-deploy.md +11 -0
- package/messages/simply.cicd.deploy.project.post-destructive.md +11 -0
- package/messages/simply.cicd.deploy.project.pre-destructive.md +11 -0
- package/messages/simply.cicd.deploy.project.run-apex-tests.md +15 -0
- package/messages/simply.cicd.deploy.project.validate.md +25 -0
- package/messages/simply.cicd.deploy.validate.md +25 -0
- package/messages/simply.cicd.md +3 -0
- package/messages/simply.cicd.notify.happy-soup.md +73 -0
- package/messages/simply.cicd.notify.project.md +125 -0
- package/messages/simply.cicd.notify.teams.md +27 -0
- package/messages/simply.cicd.sfdx-dependabot.md +91 -0
- package/package.json +214 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
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 { logger } from '../logger.js';
|
|
18
|
+
/** Installs the LWC Jest test libraries and runs the project's LWC Jest tests with coverage. */
|
|
19
|
+
export async function runLwcJest(options) {
|
|
20
|
+
if (options.disabled) {
|
|
21
|
+
logger.warn('lwc-jest is disabled. Skipping.');
|
|
22
|
+
return { skipped: true, success: false };
|
|
23
|
+
}
|
|
24
|
+
logger.info('Running LWC Jest tests...');
|
|
25
|
+
try {
|
|
26
|
+
await execa('npm', ['install', '@salesforce/sfdx-lwc-jest', '@sa11y/jest'], { stdio: 'pipe' });
|
|
27
|
+
await execa('npx', ['sfdx-lwc-jest', '--coverage', '--', '--passWithNoTests'], { stdio: 'inherit' });
|
|
28
|
+
logger.success('LWC Jest tests completed.');
|
|
29
|
+
return { skipped: false, success: true };
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
logger.error('LWC Jest tests failed.');
|
|
33
|
+
return { skipped: false, success: false };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=lwcJest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lwcJest.js","sourceRoot":"","sources":["../../../src/common/build/lwcJest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAKtC,gGAAgG;AAChG,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAA0B;IACzD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IACzC,IAAI,CAAC;QACH,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,SAAS,EAAE,2BAA2B,EAAE,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/F,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACrG,MAAM,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;QAC5C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type PushScratchOptions = {
|
|
2
|
+
jwtKeyFile: string;
|
|
3
|
+
debug?: boolean;
|
|
4
|
+
ignoreWarnings?: boolean;
|
|
5
|
+
scratchOrgSourceDir?: string;
|
|
6
|
+
};
|
|
7
|
+
/** Authenticates to the scratch org, strips ECA-related metadata, and pushes source to it. */
|
|
8
|
+
export declare function pushToScratch(options: PushScratchOptions): Promise<void>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
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 { getDefaultPackageDirectory, readSfdxProject } from '@simplysf/simply-core';
|
|
18
|
+
import { runSf } from '../exec/sfCli.js';
|
|
19
|
+
import { logger } from '../logger.js';
|
|
20
|
+
import { authenticateOrg } from '../sfAuth.js';
|
|
21
|
+
import { readScratchOrgInfo } from './scratchOrgInfo.js';
|
|
22
|
+
const INCOMPATIBLE_METADATA_PATTERNS = [
|
|
23
|
+
'*.eca-meta.xml',
|
|
24
|
+
'*.ecaGlblOauth-meta.xml',
|
|
25
|
+
'*.ecaOauth-meta.xml',
|
|
26
|
+
'*.ecaOauthPlcy-meta.xml',
|
|
27
|
+
'*.ecaPlcy-meta.xml',
|
|
28
|
+
];
|
|
29
|
+
async function removeIncompatibleMetadata() {
|
|
30
|
+
logger.info('Removing incompatible metadata before push...');
|
|
31
|
+
for (const pattern of INCOMPATIBLE_METADATA_PATTERNS) {
|
|
32
|
+
// eslint-disable-next-line no-await-in-loop -- deletions must not race each other on the same tree
|
|
33
|
+
await execa('find', [process.cwd(), '-type', 'f', '-name', pattern, '-delete']);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** Authenticates to the scratch org, strips ECA-related metadata, and pushes source to it. */
|
|
37
|
+
export async function pushToScratch(options) {
|
|
38
|
+
logger.info('Pushing source to scratch org...');
|
|
39
|
+
const scratchOrgInfo = await readScratchOrgInfo();
|
|
40
|
+
await authenticateOrg({
|
|
41
|
+
username: scratchOrgInfo.authFields.username,
|
|
42
|
+
clientId: scratchOrgInfo.authFields.clientId,
|
|
43
|
+
instanceUrl: scratchOrgInfo.authFields.instanceUrl,
|
|
44
|
+
jwtKeyFile: options.jwtKeyFile,
|
|
45
|
+
setDefault: true,
|
|
46
|
+
debug: options.debug,
|
|
47
|
+
});
|
|
48
|
+
await removeIncompatibleMetadata();
|
|
49
|
+
const pushArgs = ['project', 'deploy', 'start', '--ignore-conflicts', '--wait', '120'];
|
|
50
|
+
if (options.ignoreWarnings) {
|
|
51
|
+
pushArgs.push('--ignore-warnings');
|
|
52
|
+
}
|
|
53
|
+
if (options.scratchOrgSourceDir) {
|
|
54
|
+
pushArgs.push('--source-dir', options.scratchOrgSourceDir);
|
|
55
|
+
const seedMetadataDir = getDefaultPackageDirectory(await readSfdxProject())?.seedMetadata?.path;
|
|
56
|
+
if (seedMetadataDir) {
|
|
57
|
+
pushArgs.push('--source-dir', seedMetadataDir);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
await runSf(pushArgs, { stdio: 'inherit' });
|
|
61
|
+
logger.success('Source pushed to scratch org.');
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=pushScratch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pushScratch.js","sourceRoot":"","sources":["../../../src/common/build/pushScratch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACpF,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,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,8BAA8B,GAAG;IACrC,gBAAgB;IAChB,yBAAyB;IACzB,qBAAqB;IACrB,yBAAyB;IACzB,oBAAoB;CACrB,CAAC;AAEF,KAAK,UAAU,0BAA0B;IACvC,MAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IAC7D,KAAK,MAAM,OAAO,IAAI,8BAA8B,EAAE,CAAC;QACrD,mGAAmG;QACnG,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;IAClF,CAAC;AACH,CAAC;AASD,8FAA8F;AAC9F,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAA2B;IAC7D,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IAChD,MAAM,cAAc,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAClD,MAAM,eAAe,CAAC;QACpB,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,QAAQ;QAC5C,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,QAAQ;QAC5C,WAAW,EAAE,cAAc,CAAC,UAAU,CAAC,WAAW;QAClD,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC;IAEH,MAAM,0BAA0B,EAAE,CAAC;IAEnC,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IACvF,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;QAC3B,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACrC,CAAC;IACD,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;QAChC,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAC3D,MAAM,eAAe,GAAG,0BAA0B,CAAC,MAAM,eAAe,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC;QAChG,IAAI,eAAe,EAAE,CAAC;YACpB,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAED,MAAM,KAAK,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ScratchOrgInfo = {
|
|
2
|
+
authFields: {
|
|
3
|
+
username: string;
|
|
4
|
+
clientId: string;
|
|
5
|
+
instanceUrl: string;
|
|
6
|
+
devHubUsername?: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
/** Reads and parses `SCRATCH_ORG_INFO.json` (written by `build create-scratch`) from the current directory. */
|
|
10
|
+
export declare function readScratchOrgInfo(): Promise<ScratchOrgInfo>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
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
|
+
/** Reads and parses `SCRATCH_ORG_INFO.json` (written by `build create-scratch`) from the current directory. */
|
|
18
|
+
export async function readScratchOrgInfo() {
|
|
19
|
+
return JSON.parse(await fs.readFile('SCRATCH_ORG_INFO.json', 'utf-8'));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=scratchOrgInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scratchOrgInfo.js","sourceRoot":"","sources":["../../../src/common/build/scratchOrgInfo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AAWzC,+GAA+G;AAC/G,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAmB,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a warning message (and thus "should skip") if `job` should be skipped given the current
|
|
3
|
+
* `PACKAGE_CHANGED` environment variable set by `determine-package-changes` earlier in the
|
|
4
|
+
* pipeline: scratch-org-lifecycle jobs skip when nothing changed, `create-fallback-tag` skips when
|
|
5
|
+
* something did (since a real package version will be created instead). Returns `undefined`
|
|
6
|
+
* (don't skip) otherwise.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getSkipReason(job: string): string | undefined;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
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
|
+
/** Jobs that only make sense to run when the package actually changed. */
|
|
17
|
+
const PACKAGE_CHANGED_GATED_JOBS = new Set([
|
|
18
|
+
'create-scratch',
|
|
19
|
+
'install-dependencies',
|
|
20
|
+
'push-scratch',
|
|
21
|
+
'test-scratch',
|
|
22
|
+
'delete-scratch',
|
|
23
|
+
'create-package-version',
|
|
24
|
+
]);
|
|
25
|
+
/**
|
|
26
|
+
* Returns a warning message (and thus "should skip") if `job` should be skipped given the current
|
|
27
|
+
* `PACKAGE_CHANGED` environment variable set by `determine-package-changes` earlier in the
|
|
28
|
+
* pipeline: scratch-org-lifecycle jobs skip when nothing changed, `create-fallback-tag` skips when
|
|
29
|
+
* something did (since a real package version will be created instead). Returns `undefined`
|
|
30
|
+
* (don't skip) otherwise.
|
|
31
|
+
*/
|
|
32
|
+
export function getSkipReason(job) {
|
|
33
|
+
if (PACKAGE_CHANGED_GATED_JOBS.has(job) && process.env.PACKAGE_CHANGED === 'FALSE') {
|
|
34
|
+
return `No package changes detected (PACKAGE_CHANGED=FALSE). Skipping job: ${job}`;
|
|
35
|
+
}
|
|
36
|
+
if (job === 'create-fallback-tag' && process.env.PACKAGE_CHANGED === 'TRUE') {
|
|
37
|
+
return 'Package changes detected (PACKAGE_CHANGED=TRUE). Skipping fallback tag creation.';
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=skipGuard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skipGuard.js","sourceRoot":"","sources":["../../../src/common/build/skipGuard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,0EAA0E;AAC1E,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC;IACzC,gBAAgB;IAChB,sBAAsB;IACtB,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,wBAAwB;CACzB,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,IAAI,0BAA0B,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,OAAO,EAAE,CAAC;QACnF,OAAO,sEAAsE,GAAG,EAAE,CAAC;IACrF,CAAC;IAED,IAAI,GAAG,KAAK,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,MAAM,EAAE,CAAC;QAC5E,OAAO,kFAAkF,CAAC;IAC5F,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type RunScratchApexTestsOptions = {
|
|
2
|
+
jwtKeyFile: string;
|
|
3
|
+
debug?: boolean;
|
|
4
|
+
/** Skips just the Apex test run, independent of the job-level --disabled flag. */
|
|
5
|
+
disableApexTests?: boolean;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Authenticates to the scratch org and runs its Apex tests.
|
|
9
|
+
*
|
|
10
|
+
* The original coi-cicd `--disable-apex-tests` flag was checked against the wrong option name
|
|
11
|
+
* internally (it re-checked the generic `--disabled` flag), making it a no-op. Here it actually
|
|
12
|
+
* gates the test run.
|
|
13
|
+
*/
|
|
14
|
+
export declare function runScratchApexTests(options: RunScratchApexTestsOptions): Promise<void>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
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 { authenticateOrg } from '../sfAuth.js';
|
|
18
|
+
import { runApexTests as runApexTestsCommon } from '../sfApex.js';
|
|
19
|
+
import { readScratchOrgInfo } from './scratchOrgInfo.js';
|
|
20
|
+
/**
|
|
21
|
+
* Authenticates to the scratch org and runs its Apex tests.
|
|
22
|
+
*
|
|
23
|
+
* The original coi-cicd `--disable-apex-tests` flag was checked against the wrong option name
|
|
24
|
+
* internally (it re-checked the generic `--disabled` flag), making it a no-op. Here it actually
|
|
25
|
+
* gates the test run.
|
|
26
|
+
*/
|
|
27
|
+
export async function runScratchApexTests(options) {
|
|
28
|
+
if (options.disableApexTests) {
|
|
29
|
+
logger.warn('Apex tests are disabled via --disable-apex-tests. Skipping.');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
logger.info('Authenticating to scratch org for tests...');
|
|
33
|
+
const scratchOrgInfo = await readScratchOrgInfo();
|
|
34
|
+
await authenticateOrg({
|
|
35
|
+
username: scratchOrgInfo.authFields.username,
|
|
36
|
+
clientId: scratchOrgInfo.authFields.clientId,
|
|
37
|
+
instanceUrl: scratchOrgInfo.authFields.instanceUrl,
|
|
38
|
+
jwtKeyFile: options.jwtKeyFile,
|
|
39
|
+
setDefault: true,
|
|
40
|
+
debug: options.debug,
|
|
41
|
+
});
|
|
42
|
+
// A default org is now set, so no alias is needed.
|
|
43
|
+
await runApexTestsCommon({ testLevel: 'RunLocalTests', wait: '60' });
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=testScratch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testScratch.js","sourceRoot":"","sources":["../../../src/common/build/testScratch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AASzD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAmC;IAC3E,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;QAC3E,OAAO;IACT,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;IAC1D,MAAM,cAAc,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAClD,MAAM,eAAe,CAAC;QACpB,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,QAAQ;QAC5C,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,QAAQ;QAC5C,WAAW,EAAE,cAAc,CAAC,UAAU,CAAC,WAAW;QAClD,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC;IAEH,mDAAmD;IACnD,MAAM,kBAAkB,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { type DeployConfig } from '../schemas/deployConfig.js';
|
|
3
|
+
import { type DeployProgress } from '../schemas/deployProgress.js';
|
|
4
|
+
import type { VcsProviderKind } from '../vcs/index.js';
|
|
5
|
+
export type OrgAuthConfig = {
|
|
6
|
+
alias?: string;
|
|
7
|
+
authUrl?: string;
|
|
8
|
+
clientId?: string;
|
|
9
|
+
instanceUrl?: string;
|
|
10
|
+
jwtKeyFile?: string;
|
|
11
|
+
username?: string;
|
|
12
|
+
};
|
|
13
|
+
/** A deployment entry from `deploy.json`, plus the synthetic `{ name: 'local' }` project deployment. */
|
|
14
|
+
export type StageDeployment = {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
name: string;
|
|
17
|
+
slug?: string;
|
|
18
|
+
ref?: string;
|
|
19
|
+
postDeploy?: boolean;
|
|
20
|
+
postDestructive?: boolean;
|
|
21
|
+
preDestructive?: boolean;
|
|
22
|
+
unpackagedDeploy?: boolean;
|
|
23
|
+
testLevel?: string;
|
|
24
|
+
tests?: string;
|
|
25
|
+
};
|
|
26
|
+
export type StageProperty = 'postDeploy' | 'postDestructive' | 'preDestructive' | 'unpackagedDeploy';
|
|
27
|
+
/** Validates `data` against a zod schema, throwing a formatted error (one bullet per issue) if it fails. */
|
|
28
|
+
export declare function validateWithSchema<T>(schema: z.ZodType<T>, data: unknown, fileName: string): T;
|
|
29
|
+
/**
|
|
30
|
+
* Read a JSON file and validate it against a zod schema.
|
|
31
|
+
*
|
|
32
|
+
* @param filePath - The file to read. Its name appears in the error on a schema violation.
|
|
33
|
+
* @param schema - The schema to validate against.
|
|
34
|
+
* @returns The validated contents.
|
|
35
|
+
* @throws {Error} With one bullet per schema issue, via {@link validateWithSchema}.
|
|
36
|
+
* @throws {NodeJS.ErrnoException} If the file can't be read — callers check for `ENOENT` to
|
|
37
|
+
* treat a missing file as non-fatal.
|
|
38
|
+
* @throws {SyntaxError} If the file isn't valid JSON.
|
|
39
|
+
*/
|
|
40
|
+
export declare function loadValidatedJsonFile<T>(filePath: string, schema: z.ZodType<T>): Promise<T>;
|
|
41
|
+
/** Validates a deployment configuration against a set of deployment rules (e.g. "prod must run postDeploy"). */
|
|
42
|
+
export declare function validateDeploymentRules(deploymentConfig: DeployConfig, rulesFile: string): Promise<void>;
|
|
43
|
+
export declare const STAGE_TO_SCRIPT_NAME_MAP: Record<string, string>;
|
|
44
|
+
export declare const STAGE_TO_PROPERTY_MAP: Record<string, string>;
|
|
45
|
+
export declare const STAGE_CONFIG: Record<string, {
|
|
46
|
+
property: StageProperty;
|
|
47
|
+
}>;
|
|
48
|
+
/** Atomically updates a progress file: writes to a temp file first, then renames it into place. */
|
|
49
|
+
export declare function updateProgress(deployProgressFile: string, newProgress: DeployProgress): Promise<void>;
|
|
50
|
+
export type ExecuteStageScriptConfig = {
|
|
51
|
+
alias?: string;
|
|
52
|
+
testLevel?: string;
|
|
53
|
+
tests?: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Executes a stage-specific script (e.g. `bin/preDestructive.sh`) for a deployment: installs npm
|
|
57
|
+
* production dependencies if a `package.json` exists, sets executable/writable permissions on the
|
|
58
|
+
* repo's working directories, and runs the script with `--target-org`/`--test-level`/`--tests`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function executeStageScript(deployment: StageDeployment, stage: string, repoDir: string, config: ExecuteStageScriptConfig): Promise<void>;
|
|
61
|
+
export type InstallPackageDependenciesConfig = OrgAuthConfig & {
|
|
62
|
+
wait?: string;
|
|
63
|
+
installType?: 'All' | 'Delta' | 'Upgrade';
|
|
64
|
+
};
|
|
65
|
+
/** Authenticates to the target org, then installs its packaged dependencies. */
|
|
66
|
+
export declare function installPackageDependencies(config: InstallPackageDependenciesConfig): Promise<void>;
|
|
67
|
+
/** Logs a per-job duration summary for the given stage, from the recorded progress file durations. */
|
|
68
|
+
export declare function printDeploymentSummary(deployProgress: DeployProgress, stage: string): void;
|
|
69
|
+
export type RunApexTestsConfig = OrgAuthConfig & {
|
|
70
|
+
testLevel?: string;
|
|
71
|
+
testSuite?: string;
|
|
72
|
+
wait?: string;
|
|
73
|
+
debugMode?: boolean;
|
|
74
|
+
};
|
|
75
|
+
/** Authenticates to the target org, then runs its Apex tests. */
|
|
76
|
+
export declare function runApexTests(config: RunApexTestsConfig): Promise<void>;
|
|
77
|
+
export type RunDeploymentStepsConfig = OrgAuthConfig & {
|
|
78
|
+
deployConfigFile: string;
|
|
79
|
+
deployRulesFile: string;
|
|
80
|
+
deployProgressFile: string;
|
|
81
|
+
stage: string;
|
|
82
|
+
startFrom?: string;
|
|
83
|
+
isProjectDeployment?: boolean;
|
|
84
|
+
debug?: boolean;
|
|
85
|
+
testLevel?: string;
|
|
86
|
+
tests?: string;
|
|
87
|
+
ciJobToken: string;
|
|
88
|
+
vcsHost: string;
|
|
89
|
+
vcsProvider: VcsProviderKind;
|
|
90
|
+
};
|
|
91
|
+
export type RunDeploymentStepsResult = {
|
|
92
|
+
deployProgress: DeployProgress;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Runs a complete set of deployment jobs for a stage: authenticates, loads (and validates) the
|
|
96
|
+
* progress and config files, determines where to resume from, then clones/prepares/executes each
|
|
97
|
+
* job in order — persisting progress after every job so a mid-run crash can resume cleanly.
|
|
98
|
+
*/
|
|
99
|
+
export declare function runDeploymentSteps(config: RunDeploymentStepsConfig): Promise<RunDeploymentStepsResult>;
|
|
100
|
+
/** Determines the deploy config file path: explicit path wins, else derived from the branch name. */
|
|
101
|
+
export declare function determineDeployConfigFile(sourceBranchName?: string, deployConfigFile?: string): string | undefined;
|