@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,99 @@
|
|
|
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 { mkdtemp, writeFile } from 'node:fs/promises';
|
|
17
|
+
import { tmpdir } from 'node:os';
|
|
18
|
+
import { join } from 'node:path';
|
|
19
|
+
import { runSf } from './exec/sfCli.js';
|
|
20
|
+
import { logger } from './logger.js';
|
|
21
|
+
/** Authenticates to a Salesforce organization using either a JWT flow or an SFDX auth URL. */
|
|
22
|
+
export async function authenticateOrg(options) {
|
|
23
|
+
const { alias, authUrl, clientId, instanceUrl, jwtKeyFile, username, setDefault, setDefaultDevHub, debug } = options;
|
|
24
|
+
const authEntity = alias ?? username ?? 'unknown org';
|
|
25
|
+
logger.info(`Authenticating to org: ${authEntity}`);
|
|
26
|
+
try {
|
|
27
|
+
let authArgs;
|
|
28
|
+
if (authUrl) {
|
|
29
|
+
const tempDir = await mkdtemp(join(tmpdir(), 'sfdx-auth-'));
|
|
30
|
+
const authUrlFile = join(tempDir, 'auth-url.txt');
|
|
31
|
+
await writeFile(authUrlFile, authUrl);
|
|
32
|
+
authArgs = ['org', 'login', 'sfdx-url', '--sfdx-url-file', authUrlFile, '--json'];
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
authArgs = [
|
|
36
|
+
'login',
|
|
37
|
+
'org',
|
|
38
|
+
'jwt',
|
|
39
|
+
'--username',
|
|
40
|
+
username ?? '',
|
|
41
|
+
'--jwt-key-file',
|
|
42
|
+
jwtKeyFile ?? '',
|
|
43
|
+
'--client-id',
|
|
44
|
+
clientId ?? '',
|
|
45
|
+
'--instance-url',
|
|
46
|
+
instanceUrl ?? '',
|
|
47
|
+
'--json',
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
if (alias) {
|
|
51
|
+
authArgs.push('--alias', alias);
|
|
52
|
+
}
|
|
53
|
+
if (setDefault) {
|
|
54
|
+
authArgs.push('--set-default');
|
|
55
|
+
}
|
|
56
|
+
if (setDefaultDevHub) {
|
|
57
|
+
authArgs.push('--set-default-dev-hub');
|
|
58
|
+
}
|
|
59
|
+
const { stdout } = await runSf(authArgs);
|
|
60
|
+
if (debug) {
|
|
61
|
+
logger.raw(stdout);
|
|
62
|
+
}
|
|
63
|
+
const authResult = JSON.parse(stdout);
|
|
64
|
+
if (authResult.status > 0) {
|
|
65
|
+
logger.error(`Authentication failed for ${authEntity}: ${authResult.message ?? 'unknown error'}`);
|
|
66
|
+
// In cleanup, we don't want to exit the whole process.
|
|
67
|
+
return { success: false, message: authResult.message, username };
|
|
68
|
+
}
|
|
69
|
+
logger.success(`Successfully authenticated to org: ${authEntity}`);
|
|
70
|
+
return { success: true, username, result: authResult.result };
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
logger.error(`Authentication failed for ${authEntity}`);
|
|
74
|
+
logger.error(String(error));
|
|
75
|
+
throw error; // Re-throw for build steps that should fail hard.
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Authenticates multiple Dev Hub organizations in parallel using the JWT flow. Only attempts
|
|
80
|
+
* authentication for Dev Hubs that have `username`, `clientId`, and `instanceUrl` provided.
|
|
81
|
+
* Returns the usernames of the Dev Hubs that authenticated successfully.
|
|
82
|
+
*/
|
|
83
|
+
export async function authenticateDevHubs(devHubs, jwtKeyFile, debug) {
|
|
84
|
+
const authPromises = devHubs.map((hub) => {
|
|
85
|
+
if (hub.username && hub.clientId && hub.instanceUrl) {
|
|
86
|
+
return authenticateOrg({
|
|
87
|
+
username: hub.username,
|
|
88
|
+
clientId: hub.clientId,
|
|
89
|
+
instanceUrl: hub.instanceUrl,
|
|
90
|
+
jwtKeyFile,
|
|
91
|
+
debug,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return Promise.resolve(undefined);
|
|
95
|
+
});
|
|
96
|
+
const results = await Promise.all(authPromises);
|
|
97
|
+
return results.filter((r) => Boolean(r?.success)).map((r) => r.username);
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=sfAuth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sfAuth.js","sourceRoot":"","sources":["../../src/common/sfAuth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuBrC,8FAA8F;AAC9F,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAA+B;IACnE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IACrH,MAAM,UAAU,GAAG,KAAK,IAAI,QAAQ,IAAI,aAAa,CAAC;IACtD,MAAM,CAAC,IAAI,CAAC,0BAA0B,UAAU,EAAE,CAAC,CAAC;IAEpD,IAAI,CAAC;QACH,IAAI,QAAkB,CAAC;QAEv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AE,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAkB,CAAC,CAAC;AACjH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retrieves Jira project keys from the `.sfdevrc.json` configuration file, or falls back to a
|
|
3
|
+
* provided default. Reads a single or multiple project keys from the configuration, deduplicates
|
|
4
|
+
* them, and filters out empty values.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getJiraProjectKeys(passedProjectKey?: string): string[];
|
|
@@ -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 fs from 'node:fs';
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves Jira project keys from the `.sfdevrc.json` configuration file, or falls back to a
|
|
19
|
+
* provided default. Reads a single or multiple project keys from the configuration, deduplicates
|
|
20
|
+
* them, and filters out empty values.
|
|
21
|
+
*/
|
|
22
|
+
export function getJiraProjectKeys(passedProjectKey) {
|
|
23
|
+
let projectKeys = [];
|
|
24
|
+
try {
|
|
25
|
+
if (fs.existsSync('.sfdevrc.json')) {
|
|
26
|
+
const content = fs.readFileSync('.sfdevrc.json', 'utf8');
|
|
27
|
+
const config = JSON.parse(content);
|
|
28
|
+
if (config.jiraProjectKey) {
|
|
29
|
+
projectKeys.push(config.jiraProjectKey);
|
|
30
|
+
}
|
|
31
|
+
if (Array.isArray(config.jiraProjectKeys)) {
|
|
32
|
+
projectKeys.push(...config.jiraProjectKeys);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// Ignore and fall back to the passed command-line project key.
|
|
38
|
+
}
|
|
39
|
+
projectKeys = [...new Set(projectKeys.filter(Boolean))];
|
|
40
|
+
if (projectKeys.length > 0) {
|
|
41
|
+
return projectKeys;
|
|
42
|
+
}
|
|
43
|
+
return passedProjectKey ? [passedProjectKey] : [];
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=sfConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sfConfig.js","sourceRoot":"","sources":["../../src/common/sfConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AAOzB;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,gBAAyB;IAC1D,IAAI,WAAW,GAAa,EAAE,CAAC;IAC/B,IAAI,CAAC;QACH,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;YACnC,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;YACzD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAkB,CAAC;YACpD,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;gBAC1B,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAC1C,CAAC;YACD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC;gBAC1C,WAAW,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,+DAA+D;IACjE,CAAC;IAED,WAAW,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAExD,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type InstallPackageDependenciesConfig = {
|
|
2
|
+
alias?: string;
|
|
3
|
+
wait?: string;
|
|
4
|
+
noPrompt?: boolean;
|
|
5
|
+
debug?: boolean;
|
|
6
|
+
installType?: 'All' | 'Delta' | 'Upgrade';
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Installs Salesforce package dependencies defined in `sfdx-project.json` using the
|
|
10
|
+
* `@simplysf/simply` plugin's `sf simply package dependencies install` command.
|
|
11
|
+
*/
|
|
12
|
+
export declare function installPackageDependencies(config?: InstallPackageDependenciesConfig): Promise<void>;
|
|
@@ -0,0 +1,53 @@
|
|
|
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 { runSf } from './exec/sfCli.js';
|
|
17
|
+
import { logger } from './logger.js';
|
|
18
|
+
/**
|
|
19
|
+
* Installs Salesforce package dependencies defined in `sfdx-project.json` using the
|
|
20
|
+
* `@simplysf/simply` plugin's `sf simply package dependencies install` command.
|
|
21
|
+
*/
|
|
22
|
+
export async function installPackageDependencies(config = {}) {
|
|
23
|
+
const { alias, wait = '120', noPrompt = true, installType = 'Upgrade' } = config;
|
|
24
|
+
logger.info('Installing packaged dependencies using the @simplysf/simply plugin...');
|
|
25
|
+
try {
|
|
26
|
+
const args = [
|
|
27
|
+
'simply',
|
|
28
|
+
'package',
|
|
29
|
+
'dependencies',
|
|
30
|
+
'install',
|
|
31
|
+
'--apex-compile',
|
|
32
|
+
'package',
|
|
33
|
+
'--wait',
|
|
34
|
+
wait,
|
|
35
|
+
'--install-type',
|
|
36
|
+
installType,
|
|
37
|
+
];
|
|
38
|
+
if (alias) {
|
|
39
|
+
args.push('--target-org', alias);
|
|
40
|
+
}
|
|
41
|
+
if (noPrompt) {
|
|
42
|
+
args.push('--no-prompt');
|
|
43
|
+
}
|
|
44
|
+
await runSf(args, { stdio: 'inherit' });
|
|
45
|
+
logger.success('Packaged dependencies installed successfully.');
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
logger.error('Failed to install packaged dependencies.');
|
|
49
|
+
logger.error(String(error));
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=sfPackages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sfPackages.js","sourceRoot":"","sources":["../../src/common/sfPackages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,SAA2C,EAAE;IAC5F,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,QAAQ,GAAG,IAAI,EAAE,WAAW,GAAG,SAAS,EAAE,GAAG,MAAM,CAAC;IAEjF,MAAM,CAAC,IAAI,CAAC,uEAAuE,CAAC,CAAC;IACrF,IAAI,CAAC;QACH,MAAM,IAAI,GAAG;YACX,QAAQ;YACR,SAAS;YACT,cAAc;YACd,SAAS;YACT,gBAAgB;YAChB,SAAS;YACT,QAAQ;YACR,IAAI;YACJ,gBAAgB;YAChB,WAAW;SACZ,CAAC;QACF,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QACnC,CAAC;QACD,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3B,CAAC;QAED,MAAM,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACxC,MAAM,CAAC,OAAO,CAAC,+CAA+C,CAAC,CAAC;IAClE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QACzD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5B,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Installs a Salesforce CLI plugin. */
|
|
2
|
+
export declare function installPlugin(plugin: string, debug?: boolean, cwd?: string): Promise<void>;
|
|
3
|
+
/** Installs all plugins listed in the `deploymentPlugins` array of the `.sfdevrc` file, plus this package's defaults. */
|
|
4
|
+
export declare function installDeploymentPlugins(debug?: boolean, cwd?: string): Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* Automatically configures the trusted unsigned plugin allowlist for both the modern `sf` and
|
|
7
|
+
* legacy `sfdx` CLI configurations, to prevent interactive installation prompts.
|
|
8
|
+
*/
|
|
9
|
+
export declare function configureTrustedPublishers(debug?: boolean): void;
|
|
10
|
+
/** Installs the `@syntax-syllogism/flow-delta` plugin globally via npm. */
|
|
11
|
+
export declare function installFlowDeltaPlugin(debug?: boolean): Promise<void>;
|
|
@@ -0,0 +1,134 @@
|
|
|
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 fs from 'node:fs';
|
|
17
|
+
import os from 'node:os';
|
|
18
|
+
import path from 'node:path';
|
|
19
|
+
import { execa } from 'execa';
|
|
20
|
+
import { DEFAULT_DEPLOYMENT_PLUGINS } from '../config/defaultDeploymentPlugins.js';
|
|
21
|
+
import { TRUSTED_PLUGINS } from '../config/trustedPlugins.js';
|
|
22
|
+
import { runSf } from './exec/sfCli.js';
|
|
23
|
+
import { logger } from './logger.js';
|
|
24
|
+
/** Installs a Salesforce CLI plugin. */
|
|
25
|
+
export async function installPlugin(plugin, debug = false, cwd = process.cwd()) {
|
|
26
|
+
logger.info(`Installing ${plugin} plugin...`);
|
|
27
|
+
try {
|
|
28
|
+
configureTrustedPublishers(debug);
|
|
29
|
+
await runSf(['plugins', 'install', plugin], { stdio: 'pipe', cwd });
|
|
30
|
+
logger.success(`Successfully installed ${plugin} plugin.`);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
logger.error(`Failed to install ${plugin} plugin.`);
|
|
34
|
+
logger.error(String(error));
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** Installs all plugins listed in the `deploymentPlugins` array of the `.sfdevrc` file, plus this package's defaults. */
|
|
39
|
+
export async function installDeploymentPlugins(debug = false, cwd = process.cwd()) {
|
|
40
|
+
const sfdevrcPath = path.join(cwd, '.sfdevrc');
|
|
41
|
+
let projectPlugins = [];
|
|
42
|
+
if (fs.existsSync(sfdevrcPath)) {
|
|
43
|
+
const sfdevrc = JSON.parse(fs.readFileSync(sfdevrcPath, 'utf8'));
|
|
44
|
+
if (Array.isArray(sfdevrc.deploymentPlugins)) {
|
|
45
|
+
projectPlugins = sfdevrc.deploymentPlugins;
|
|
46
|
+
}
|
|
47
|
+
else if (debug) {
|
|
48
|
+
logger.debug('No deploymentPlugins array found in .sfdevrc. Skipping project-specific plugins.');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else if (debug) {
|
|
52
|
+
logger.debug('No .sfdevrc file found. Skipping project-specific plugins.');
|
|
53
|
+
}
|
|
54
|
+
const allPlugins = [...new Set([...DEFAULT_DEPLOYMENT_PLUGINS, ...projectPlugins])];
|
|
55
|
+
if (allPlugins.length === 0) {
|
|
56
|
+
if (debug) {
|
|
57
|
+
logger.debug('No deployment plugins to install.');
|
|
58
|
+
}
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const { stdout } = await runSf(['plugins'], { cwd });
|
|
62
|
+
const installedPlugins = stdout.split('\n').map((line) => line.split(' ')[0]);
|
|
63
|
+
for (const plugin of allPlugins) {
|
|
64
|
+
if (!installedPlugins.includes(plugin)) {
|
|
65
|
+
// eslint-disable-next-line no-await-in-loop
|
|
66
|
+
await installPlugin(plugin, debug, cwd);
|
|
67
|
+
}
|
|
68
|
+
else if (debug) {
|
|
69
|
+
logger.debug(`${plugin} is already installed. Skipping.`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Automatically configures the trusted unsigned plugin allowlist for both the modern `sf` and
|
|
75
|
+
* legacy `sfdx` CLI configurations, to prevent interactive installation prompts.
|
|
76
|
+
*/
|
|
77
|
+
export function configureTrustedPublishers(debug = false) {
|
|
78
|
+
const homeDir = os.homedir();
|
|
79
|
+
if (!homeDir) {
|
|
80
|
+
logger.warn('Could not determine user home directory. Skipping trusted publisher configuration.');
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const configDirs = [path.join(homeDir, '.config', 'sf'), path.join(homeDir, '.config', 'sfdx')];
|
|
84
|
+
for (const configDir of configDirs) {
|
|
85
|
+
const allowListPath = path.join(configDir, 'unsignedPluginAllowList.json');
|
|
86
|
+
try {
|
|
87
|
+
if (!fs.existsSync(configDir)) {
|
|
88
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
89
|
+
}
|
|
90
|
+
let currentAllowList = [];
|
|
91
|
+
if (fs.existsSync(allowListPath)) {
|
|
92
|
+
try {
|
|
93
|
+
const content = fs.readFileSync(allowListPath, 'utf8');
|
|
94
|
+
const parsed = JSON.parse(content);
|
|
95
|
+
currentAllowList = Array.isArray(parsed) ? parsed : [];
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
logger.warn(`Failed to parse existing allowlist at ${allowListPath}. Overwriting.`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
let modified = false;
|
|
102
|
+
for (const plugin of TRUSTED_PLUGINS) {
|
|
103
|
+
if (!currentAllowList.includes(plugin)) {
|
|
104
|
+
currentAllowList.push(plugin);
|
|
105
|
+
modified = true;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (modified) {
|
|
109
|
+
fs.writeFileSync(allowListPath, JSON.stringify(currentAllowList, null, 2), 'utf8');
|
|
110
|
+
if (debug) {
|
|
111
|
+
logger.debug(`Configured trusted plugins in ${allowListPath}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
logger.warn(`Failed to configure trusted publisher allowlist at ${configDir}: ${error.message}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** Installs the `@syntax-syllogism/flow-delta` plugin globally via npm. */
|
|
121
|
+
export async function installFlowDeltaPlugin(debug = false) {
|
|
122
|
+
logger.info('Installing @syntax-syllogism/flow-delta via npm...');
|
|
123
|
+
try {
|
|
124
|
+
configureTrustedPublishers(debug);
|
|
125
|
+
await execa('npm', ['install', '@syntax-syllogism/flow-delta', '--global'], { stdio: 'pipe' });
|
|
126
|
+
logger.success('Successfully installed @syntax-syllogism/flow-delta plugin.');
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
logger.error('Failed to install @syntax-syllogism/flow-delta plugin.');
|
|
130
|
+
logger.error(String(error));
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=sfPlugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sfPlugins.js","sourceRoot":"","sources":["../../src/common/sfPlugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,w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|
|
7
|
+
/** Detects the indentation of a JSON string. Defaults to 2 spaces if none is detected. */
|
|
8
|
+
export declare function detectIndentation(jsonString: string): string | number;
|
|
9
|
+
/**
|
|
10
|
+
* Parses and updates a released package's dependency version(s) within `sfdx-project.json`
|
|
11
|
+
* content. Also swaps the package's `packageAliases` entry to point at the new subscriber
|
|
12
|
+
* package version ID, removing stale alias entries for the versions it replaced.
|
|
13
|
+
*/
|
|
14
|
+
export declare function updateSfdxProject(jsonString: string, releasedPackageName: string, releasedPackageVersion: string, subscriberPackageVersionId: string): UpdateSfdxProjectResult;
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
/** Detects the indentation of a JSON string. Defaults to 2 spaces if none is detected. */
|
|
18
|
+
export function detectIndentation(jsonString) {
|
|
19
|
+
let indent = 2;
|
|
20
|
+
const lines = jsonString.split('\n');
|
|
21
|
+
const firstIndentedLine = lines.find((line) => line.startsWith(' ') || line.startsWith('\t'));
|
|
22
|
+
if (firstIndentedLine) {
|
|
23
|
+
const match = /^([ \t]+)/.exec(firstIndentedLine);
|
|
24
|
+
if (match) {
|
|
25
|
+
indent = match[1];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return indent;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Parses and updates a released package's dependency version(s) within `sfdx-project.json`
|
|
32
|
+
* content. Also swaps the package's `packageAliases` entry to point at the new subscriber
|
|
33
|
+
* package version ID, removing stale alias entries for the versions it replaced.
|
|
34
|
+
*/
|
|
35
|
+
export function updateSfdxProject(jsonString, releasedPackageName, releasedPackageVersion, subscriberPackageVersionId) {
|
|
36
|
+
let sfdxProject;
|
|
37
|
+
try {
|
|
38
|
+
sfdxProject = JSON.parse(jsonString);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
throw new Error(`Malformed JSON in sfdx-project.json: ${error.message}`);
|
|
42
|
+
}
|
|
43
|
+
let changed = false;
|
|
44
|
+
let hasDependency = false;
|
|
45
|
+
const oldVersionsSet = new Set();
|
|
46
|
+
if (Array.isArray(sfdxProject.packageDirectories)) {
|
|
47
|
+
for (const dir of sfdxProject.packageDirectories) {
|
|
48
|
+
if (Array.isArray(dir.dependencies)) {
|
|
49
|
+
for (const dep of dir.dependencies) {
|
|
50
|
+
if (dep.package) {
|
|
51
|
+
const lastAtIndex = dep.package.lastIndexOf('@');
|
|
52
|
+
if (lastAtIndex !== -1) {
|
|
53
|
+
const name = dep.package.substring(0, lastAtIndex);
|
|
54
|
+
const version = dep.package.substring(lastAtIndex + 1);
|
|
55
|
+
if (name === releasedPackageName) {
|
|
56
|
+
hasDependency = true;
|
|
57
|
+
if (version !== releasedPackageVersion) {
|
|
58
|
+
oldVersionsSet.add(version);
|
|
59
|
+
dep.package = `${releasedPackageName}@${releasedPackageVersion}`;
|
|
60
|
+
changed = true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else if (dep.package === releasedPackageName) {
|
|
65
|
+
const hasAlias = sfdxProject.packageAliases?.[releasedPackageName] !== undefined;
|
|
66
|
+
if (hasAlias) {
|
|
67
|
+
logger.warn(`Dependency reference "${dep.package}" is in alias-only format and matches the released package, but cannot be auto-updated because it lacks a version suffix (@version).`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (changed) {
|
|
76
|
+
sfdxProject.packageAliases ??= {};
|
|
77
|
+
for (const oldVersion of oldVersionsSet) {
|
|
78
|
+
const oldAliasKey = `${releasedPackageName}@${oldVersion}`;
|
|
79
|
+
if (sfdxProject.packageAliases[oldAliasKey] !== undefined) {
|
|
80
|
+
delete sfdxProject.packageAliases[oldAliasKey];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
sfdxProject.packageAliases[`${releasedPackageName}@${releasedPackageVersion}`] = subscriberPackageVersionId;
|
|
84
|
+
}
|
|
85
|
+
const indent = detectIndentation(jsonString);
|
|
86
|
+
const newJsonContent = JSON.stringify(sfdxProject, null, indent) + '\n';
|
|
87
|
+
return {
|
|
88
|
+
changed,
|
|
89
|
+
newJsonContent,
|
|
90
|
+
oldVersions: [...oldVersionsSet],
|
|
91
|
+
hasDependency,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=updater.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updater.js","sourceRoot":"","sources":["../../../src/common/sfdxDependabot/updater.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAgBtC,0FAA0F;AAC1F,MAAM,UAAU,iBAAiB,CAAC,UAAkB;IAClD,IAAI,MAAM,GAAoB,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,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CAAC,UAAU,CAAC,CAAC;IAC7C,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAExE,OAAO;QACL,OAAO;QACP,cAAc;QACd,WAAW,EAAE,CAAC,GAAG,cAAc,CAAC;QAChC,aAAa;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { VcsBranch, VcsCommit, VcsMergeRequest, VcsProject, VcsProjectVariable, VcsProvider } from './types.js';
|
|
2
|
+
/** A `VcsProvider` implementation for GitLab, backed by the GitLab REST API v4. */
|
|
3
|
+
export declare class GitLabProvider implements VcsProvider {
|
|
4
|
+
private readonly apiUrl;
|
|
5
|
+
private readonly token;
|
|
6
|
+
constructor(apiUrl: string, token: string);
|
|
7
|
+
getGroupProjects(groupId: string | number): Promise<VcsProject[]>;
|
|
8
|
+
getFileContent(projectId: string | number, filePath: string, ref: string): Promise<string>;
|
|
9
|
+
branchExists(projectId: string | number, branchName: string): Promise<boolean>;
|
|
10
|
+
createBranch(projectId: string | number, branchName: string, ref: string): Promise<VcsBranch>;
|
|
11
|
+
commitFile(projectId: string | number, branchName: string, commitMessage: string, filePath: string, content: string): Promise<VcsCommit>;
|
|
12
|
+
findOpenMergeRequest(projectId: string | number, sourceBranch: string, targetBranch: string): Promise<VcsMergeRequest | undefined>;
|
|
13
|
+
createMergeRequest(projectId: string | number, sourceBranch: string, targetBranch: string, title: string, description: string, labels?: string): Promise<VcsMergeRequest>;
|
|
14
|
+
updateMergeRequest(projectId: string | number, mergeRequestId: number, title: string, description: string, labels?: string): Promise<VcsMergeRequest>;
|
|
15
|
+
getProjectVariables(projectId: string | number): Promise<VcsProjectVariable[]>;
|
|
16
|
+
buildAuthenticatedRemoteUrl(host: string, token: string, projectPath: string): string;
|
|
17
|
+
buildCiCloneUrl(host: string, ciJobToken: string, projectPath: string): string;
|
|
18
|
+
private request;
|
|
19
|
+
private getJson;
|
|
20
|
+
private getRawText;
|
|
21
|
+
}
|