@simplysf/simply-cicd-core 0.2.2 → 0.3.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 +31 -3
- package/lib/build/checkPermissionSets.d.ts +22 -0
- package/lib/build/checkPermissionSets.js +102 -0
- package/lib/build/checkPermissionSets.js.map +1 -0
- package/lib/build/cleanupScratchOrgs.d.ts +6 -0
- package/lib/build/cleanupScratchOrgs.js +91 -0
- package/lib/build/cleanupScratchOrgs.js.map +1 -0
- package/lib/build/createFallbackTag.d.ts +24 -0
- package/lib/build/createFallbackTag.js +147 -0
- package/lib/build/createFallbackTag.js.map +1 -0
- package/lib/build/createPackageVersion.d.ts +42 -0
- package/lib/build/createPackageVersion.js +198 -0
- package/lib/build/createPackageVersion.js.map +1 -0
- package/lib/build/createScratchOrg.d.ts +14 -0
- package/lib/build/createScratchOrg.js +192 -0
- package/lib/build/createScratchOrg.js.map +1 -0
- package/lib/build/deleteScratchOrg.d.ts +13 -0
- package/lib/build/deleteScratchOrg.js +62 -0
- package/lib/build/deleteScratchOrg.js.map +1 -0
- package/lib/build/deltaRunner.d.ts +73 -0
- package/lib/build/deltaRunner.js +109 -0
- package/lib/build/deltaRunner.js.map +1 -0
- package/lib/build/determinePackageChanges.d.ts +11 -0
- package/lib/build/determinePackageChanges.js +90 -0
- package/lib/build/determinePackageChanges.js.map +1 -0
- package/lib/build/devHubs.d.ts +12 -0
- package/lib/build/devHubs.js +42 -0
- package/lib/build/devHubs.js.map +1 -0
- package/lib/build/flexipageDelta.d.ts +18 -0
- package/lib/build/flexipageDelta.js +35 -0
- package/lib/build/flexipageDelta.js.map +1 -0
- package/lib/build/flowDelta.d.ts +17 -0
- package/lib/build/flowDelta.js +34 -0
- package/lib/build/flowDelta.js.map +1 -0
- package/lib/build/installDependencies.d.ts +10 -0
- package/lib/build/installDependencies.js +39 -0
- package/lib/build/installDependencies.js.map +1 -0
- package/lib/build/lwcJest.d.ts +25 -0
- package/lib/build/lwcJest.js +126 -0
- package/lib/build/lwcJest.js.map +1 -0
- package/lib/build/publishUtamPageObjects.d.ts +50 -0
- package/lib/build/publishUtamPageObjects.js +283 -0
- package/lib/build/publishUtamPageObjects.js.map +1 -0
- package/lib/build/pushScratch.d.ts +9 -0
- package/lib/build/pushScratch.js +60 -0
- package/lib/build/pushScratch.js.map +1 -0
- package/lib/build/scratchOrgAuth.d.ts +18 -0
- package/lib/build/scratchOrgAuth.js +52 -0
- package/lib/build/scratchOrgAuth.js.map +1 -0
- package/lib/build/scratchOrgInfo.d.ts +14 -0
- package/lib/build/scratchOrgInfo.js +21 -0
- package/lib/build/scratchOrgInfo.js.map +1 -0
- package/lib/build/skipGuard.d.ts +8 -0
- package/lib/build/skipGuard.js +42 -0
- package/lib/build/skipGuard.js.map +1 -0
- package/lib/build/testScratch.d.ts +15 -0
- package/lib/build/testScratch.js +42 -0
- package/lib/build/testScratch.js.map +1 -0
- package/lib/build/utamPageObjects.d.ts +143 -0
- package/lib/build/utamPageObjects.js +258 -0
- package/lib/build/utamPageObjects.js.map +1 -0
- package/lib/build/versionTagFormat.d.ts +57 -0
- package/lib/build/versionTagFormat.js +194 -0
- package/lib/build/versionTagFormat.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/deploy/deployCommon.d.ts +105 -0
- package/lib/deploy/deployCommon.js +358 -0
- package/lib/deploy/deployCommon.js.map +1 -0
- package/lib/deploy/deployHappySoup.d.ts +56 -0
- package/lib/deploy/deployHappySoup.js +160 -0
- package/lib/deploy/deployHappySoup.js.map +1 -0
- package/lib/deploy/deployProject.d.ts +27 -0
- package/lib/deploy/deployProject.js +114 -0
- package/lib/deploy/deployProject.js.map +1 -0
- package/lib/deploy/runDeployStage.d.ts +16 -0
- package/lib/deploy/runDeployStage.js +65 -0
- package/lib/deploy/runDeployStage.js.map +1 -0
- package/lib/deploy/stageOptions.d.ts +49 -0
- package/lib/deploy/stageOptions.js +70 -0
- package/lib/deploy/stageOptions.js.map +1 -0
- package/lib/deploy/validate.d.ts +11 -0
- package/lib/deploy/validate.js +54 -0
- package/lib/deploy/validate.js.map +1 -0
- package/lib/env.d.ts +9 -0
- package/lib/env.js +47 -0
- package/lib/env.js.map +1 -0
- package/lib/exec/sfCli.d.ts +27 -0
- package/lib/exec/sfCli.js +50 -0
- package/lib/exec/sfCli.js.map +1 -0
- package/lib/flags/env.d.ts +44 -0
- package/lib/flags/env.js +81 -0
- package/lib/flags/env.js.map +1 -0
- package/lib/git.d.ts +32 -0
- package/lib/git.js +106 -0
- package/lib/git.js.map +1 -0
- package/lib/happySoup/resolveOriginProject.d.ts +22 -0
- package/lib/happySoup/resolveOriginProject.js +61 -0
- package/lib/happySoup/resolveOriginProject.js.map +1 -0
- package/lib/index.d.ts +51 -0
- package/lib/index.js +63 -2
- package/lib/index.js.map +1 -1
- package/lib/logger.d.ts +10 -0
- package/lib/logger.js +33 -0
- package/lib/logger.js.map +1 -0
- package/lib/notify/buildNotification.d.ts +53 -0
- package/lib/notify/buildNotification.js +176 -0
- package/lib/notify/buildNotification.js.map +1 -0
- package/lib/notify/getCommitStories.d.ts +30 -0
- package/lib/notify/getCommitStories.js +70 -0
- package/lib/notify/getCommitStories.js.map +1 -0
- package/lib/notify/getRemoteCommitStories.d.ts +10 -0
- package/lib/notify/getRemoteCommitStories.js +45 -0
- package/lib/notify/getRemoteCommitStories.js.map +1 -0
- package/lib/notify/happySoupNotification.d.ts +26 -0
- package/lib/notify/happySoupNotification.js +140 -0
- package/lib/notify/happySoupNotification.js.map +1 -0
- package/lib/notify/projectNotification.d.ts +46 -0
- package/lib/notify/projectNotification.js +177 -0
- package/lib/notify/projectNotification.js.map +1 -0
- package/lib/notify/renderTemplate.d.ts +3 -0
- package/lib/notify/renderTemplate.js +24 -0
- package/lib/notify/renderTemplate.js.map +1 -0
- package/lib/notify/sendNotification.d.ts +2 -0
- package/lib/notify/sendNotification.js +50 -0
- package/lib/notify/sendNotification.js.map +1 -0
- package/lib/notify/templates.d.ts +13 -0
- package/lib/notify/templates.js +118 -0
- package/lib/notify/templates.js.map +1 -0
- package/lib/schemas/deployConfig.d.ts +25 -0
- package/lib/schemas/deployConfig.js +55 -0
- package/lib/schemas/deployConfig.js.map +1 -0
- package/lib/schemas/deployProgress.d.ts +33 -0
- package/lib/schemas/deployProgress.js +46 -0
- package/lib/schemas/deployProgress.js.map +1 -0
- package/lib/schemas/deployRules.d.ts +34 -0
- package/lib/schemas/deployRules.js +40 -0
- package/lib/schemas/deployRules.js.map +1 -0
- package/lib/sfApex.d.ts +22 -0
- package/lib/sfApex.js +169 -0
- package/lib/sfApex.js.map +1 -0
- package/lib/sfAuth.d.ts +19 -0
- package/lib/sfAuth.js +78 -0
- package/lib/sfAuth.js.map +1 -0
- package/lib/sfConfig.d.ts +23 -0
- package/lib/sfConfig.js +82 -0
- package/lib/sfConfig.js.map +1 -0
- package/lib/sfPackages.d.ts +31 -0
- package/lib/sfPackages.js +143 -0
- package/lib/sfPackages.js.map +1 -0
- package/lib/sfPlugins.d.ts +11 -0
- package/lib/sfPlugins.js +134 -0
- package/lib/sfPlugins.js.map +1 -0
- package/lib/sfdxDependabot/dependabotRun.d.ts +95 -0
- package/lib/sfdxDependabot/dependabotRun.js +287 -0
- package/lib/sfdxDependabot/dependabotRun.js.map +1 -0
- package/lib/sfdxDependabot/updater.d.ts +14 -0
- package/lib/sfdxDependabot/updater.js +94 -0
- package/lib/sfdxDependabot/updater.js.map +1 -0
- package/package.json +15 -4
package/lib/flags/env.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* Coerce a string or boolean to a boolean. `'true'`/`'false'` are recognised
|
|
18
|
+
* case- and whitespace-insensitively; anything else is `false`.
|
|
19
|
+
*
|
|
20
|
+
* Environment variables are always strings, unlike the boolean flags oclif parses natively, so
|
|
21
|
+
* any flag with an env-var fallback needs this on the env side.
|
|
22
|
+
*
|
|
23
|
+
* @param value - The raw flag or environment value.
|
|
24
|
+
* @returns The coerced boolean.
|
|
25
|
+
*/
|
|
26
|
+
export function parseBooleanString(value) {
|
|
27
|
+
if (typeof value === 'boolean') {
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
const normalized = value.trim().toLowerCase();
|
|
31
|
+
if (normalized === 'true') {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
if (normalized === 'false') {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Resolve a string setting with CLI flag > environment variable > fallback precedence.
|
|
41
|
+
*
|
|
42
|
+
* Several settings accept more than one environment variable — a `SIMPLY_CICD_`-prefixed name of
|
|
43
|
+
* our own plus whatever the CI provider already exports — so the env side takes a list, tried in
|
|
44
|
+
* order.
|
|
45
|
+
*
|
|
46
|
+
* @param flagValue - The parsed CLI flag, if the caller passed one.
|
|
47
|
+
* @param envVars - Candidate environment values, most specific first.
|
|
48
|
+
* @param fallback - Used when neither the flag nor any environment variable is set.
|
|
49
|
+
* @returns The resolved value.
|
|
50
|
+
*/
|
|
51
|
+
export function resolveString(flagValue, envVars, fallback = '') {
|
|
52
|
+
return flagValue ?? envVars.find((value) => value !== undefined) ?? fallback;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* {@link resolveString} for settings with no default, where "unset" is meaningful.
|
|
56
|
+
*
|
|
57
|
+
* @param flagValue - The parsed CLI flag, if the caller passed one.
|
|
58
|
+
* @param envVars - Candidate environment values, most specific first.
|
|
59
|
+
* @returns The resolved value, or `undefined` if nothing supplied one.
|
|
60
|
+
*/
|
|
61
|
+
export function resolveOptionalString(flagValue, envVars) {
|
|
62
|
+
return flagValue ?? envVars.find((value) => value !== undefined);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Resolve a boolean setting with CLI flag > environment variable > fallback precedence.
|
|
66
|
+
*
|
|
67
|
+
* The flag is checked for `undefined` rather than falsiness, so an explicit `--no-…` stays
|
|
68
|
+
* distinguishable from an unset flag and still beats the environment.
|
|
69
|
+
*
|
|
70
|
+
* @param flagValue - The parsed CLI flag, if the caller passed one.
|
|
71
|
+
* @param envVar - The environment value, coerced via {@link parseBooleanString}.
|
|
72
|
+
* @param fallback - Used when neither the flag nor the environment variable is set.
|
|
73
|
+
* @returns The resolved boolean.
|
|
74
|
+
*/
|
|
75
|
+
export function resolveBoolean(flagValue, envVar, fallback) {
|
|
76
|
+
if (flagValue !== undefined) {
|
|
77
|
+
return flagValue;
|
|
78
|
+
}
|
|
79
|
+
return envVar !== undefined ? parseBooleanString(envVar) : fallback;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/flags/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAuB;IACxD,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE9C,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAC3B,SAA6B,EAC7B,OAAkC,EAClC,QAAQ,GAAG,EAAE;IAEb,OAAO,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,IAAI,QAAQ,CAAC;AAC/E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,SAA6B,EAC7B,OAAkC;IAElC,OAAO,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAAC,SAA8B,EAAE,MAA0B,EAAE,QAAiB;IAC1G,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACtE,CAAC"}
|
package/lib/git.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { VcsProvider } from './vcs/index.js';
|
|
2
|
+
import { VersionTagFormat } from './build/versionTagFormat.js';
|
|
3
|
+
export type Deployment = {
|
|
4
|
+
name: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
ref?: string;
|
|
7
|
+
};
|
|
8
|
+
export type CloneRepoOptions = {
|
|
9
|
+
ciJobToken: string;
|
|
10
|
+
vcsProvider: VcsProvider;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The git tag a dependency pinned at `versionPart` was recorded under. `1.2.3-4` and `1.2.3.4` are
|
|
14
|
+
* rendered through the project's version tag format, on the assumption that dependencies share the
|
|
15
|
+
* project's tag convention (a deployment's explicit `ref` covers one that doesn't). Anything else,
|
|
16
|
+
* e.g. `1.2.3-LATEST`, keeps the original `v<pin>` reading.
|
|
17
|
+
*/
|
|
18
|
+
export declare function toDependencyRef(versionPart: string, versionTagFormat: VersionTagFormat): string;
|
|
19
|
+
/**
|
|
20
|
+
* Clones a repository based on deployment metadata and options. If a specific branch or tag
|
|
21
|
+
* (ref) is not specified, it attempts to deduce the ref from package dependencies in
|
|
22
|
+
* `sfdx-project.json` in the current working directory.
|
|
23
|
+
*/
|
|
24
|
+
export declare function cloneRepo(deployment: Deployment, options: CloneRepoOptions): Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Adds a temporary authenticated git remote for CI push/tag operations. Returns the remote's alias.
|
|
27
|
+
*
|
|
28
|
+
* The alias is keyed on the pipeline ID, so a retried job, or a later job in the same pipeline that
|
|
29
|
+
* lands on a runner reusing the working copy (`GIT_STRATEGY: fetch`), finds it already present. In
|
|
30
|
+
* that case the existing remote's URL is overwritten instead, which also refreshes the token.
|
|
31
|
+
*/
|
|
32
|
+
export declare function addGitRemote(ciPipelineId: string, accessToken: string, ciProjectPath: string, vcsProvider: VcsProvider): Promise<string>;
|
package/lib/git.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
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 path from 'node:path';
|
|
18
|
+
import { execa } from 'execa';
|
|
19
|
+
import { getDefaultPackageDirectory, readSfdxProject } from '@simplysf/simply-core';
|
|
20
|
+
import { logger } from './logger.js';
|
|
21
|
+
import { VersionTagFormat, VersionTagFormatError } from './build/versionTagFormat.js';
|
|
22
|
+
/**
|
|
23
|
+
* The git tag a dependency pinned at `versionPart` was recorded under. `1.2.3-4` and `1.2.3.4` are
|
|
24
|
+
* rendered through the project's version tag format, on the assumption that dependencies share the
|
|
25
|
+
* project's tag convention (a deployment's explicit `ref` covers one that doesn't). Anything else,
|
|
26
|
+
* e.g. `1.2.3-LATEST`, keeps the original `v<pin>` reading.
|
|
27
|
+
*/
|
|
28
|
+
export function toDependencyRef(versionPart, versionTagFormat) {
|
|
29
|
+
const match = /^(?<version>\d+\.\d+\.\d+)[-.](?<build>\d+)$/.exec(versionPart);
|
|
30
|
+
if (match?.groups) {
|
|
31
|
+
return versionTagFormat.render(`${match.groups.version}.${match.groups.build}`);
|
|
32
|
+
}
|
|
33
|
+
return `v${versionPart}`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Clones a repository based on deployment metadata and options. If a specific branch or tag
|
|
37
|
+
* (ref) is not specified, it attempts to deduce the ref from package dependencies in
|
|
38
|
+
* `sfdx-project.json` in the current working directory.
|
|
39
|
+
*/
|
|
40
|
+
export async function cloneRepo(deployment, options) {
|
|
41
|
+
const { name, slug } = deployment;
|
|
42
|
+
let { ref } = deployment;
|
|
43
|
+
if (!ref) {
|
|
44
|
+
try {
|
|
45
|
+
const project = await readSfdxProject();
|
|
46
|
+
const defaultPackageDir = getDefaultPackageDirectory(project);
|
|
47
|
+
if (defaultPackageDir?.dependencies) {
|
|
48
|
+
const dependency = defaultPackageDir.dependencies.find((dep) => dep.package?.startsWith(`${name}@`));
|
|
49
|
+
if (dependency?.package) {
|
|
50
|
+
const versionPart = dependency.package.split('@')[1];
|
|
51
|
+
if (versionPart) {
|
|
52
|
+
ref = toDependencyRef(versionPart, VersionTagFormat.fromProject(project));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
// A misconfigured format is the project's error to fix, not a reason to quietly clone the
|
|
59
|
+
// dependency's default branch instead.
|
|
60
|
+
if (e instanceof VersionTagFormatError) {
|
|
61
|
+
throw e;
|
|
62
|
+
}
|
|
63
|
+
const err = e;
|
|
64
|
+
if (err.code !== 'ENOENT') {
|
|
65
|
+
logger.warn(`Could not deduce ref from sfdx-project.json for ${name}: ${err.message}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const repoUrl = options.vcsProvider.buildCiCloneUrl(options.ciJobToken, slug);
|
|
70
|
+
const targetDir = path.join(process.cwd(), name);
|
|
71
|
+
await fs.rm(targetDir, { recursive: true, force: true });
|
|
72
|
+
const refMessage = ref ? `#${ref}` : ' (default branch)';
|
|
73
|
+
logger.info(`Cloning ${slug}${refMessage} into ${name}`);
|
|
74
|
+
try {
|
|
75
|
+
const cloneArgs = ['clone', '--depth', '1'];
|
|
76
|
+
if (ref) {
|
|
77
|
+
cloneArgs.push('-b', ref);
|
|
78
|
+
}
|
|
79
|
+
cloneArgs.push(repoUrl, name);
|
|
80
|
+
await execa('git', cloneArgs);
|
|
81
|
+
return targetDir;
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
logger.error(`Failed to clone ${slug}${refMessage}.`);
|
|
85
|
+
throw e;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Adds a temporary authenticated git remote for CI push/tag operations. Returns the remote's alias.
|
|
90
|
+
*
|
|
91
|
+
* The alias is keyed on the pipeline ID, so a retried job, or a later job in the same pipeline that
|
|
92
|
+
* lands on a runner reusing the working copy (`GIT_STRATEGY: fetch`), finds it already present. In
|
|
93
|
+
* that case the existing remote's URL is overwritten instead, which also refreshes the token.
|
|
94
|
+
*/
|
|
95
|
+
export async function addGitRemote(ciPipelineId, accessToken, ciProjectPath, vcsProvider) {
|
|
96
|
+
if (!accessToken) {
|
|
97
|
+
throw new Error('accessToken is required for Git remote operations.');
|
|
98
|
+
}
|
|
99
|
+
const remoteAlias = `GITREMOTE${ciPipelineId}`;
|
|
100
|
+
const remoteUrl = vcsProvider.buildAuthenticatedRemoteUrl(accessToken, ciProjectPath);
|
|
101
|
+
const { stdout: existingRemotes } = await execa('git', ['remote']);
|
|
102
|
+
const remoteExists = existingRemotes.split(/\r?\n/).includes(remoteAlias);
|
|
103
|
+
await execa('git', ['remote', remoteExists ? 'set-url' : 'add', remoteAlias, remoteUrl]);
|
|
104
|
+
return remoteAlias;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=git.js.map
|
package/lib/git.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEpF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,E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,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,CAAC,mBAAmB,IAAI,GAAG,UAAU,GAAG,CAAC,CAAC;QACtD,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,YAAoB,EACpB,WAAmB,EACnB,aAAqB,EACrB,WAAwB;IAExB,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,WAAW,GAAG,YAAY,YAAY,EAAE,CAAC;IAC/C,MAAM,SAAS,GAAG,WAAW,CAAC,2BAA2B,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACtF,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnE,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC1E,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;IACzF,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type VcsProviderKind } from '../vcs/index.js';
|
|
2
|
+
/** Where a packaged dependency's source lives, resolved for a happy-soup story lookup. */
|
|
3
|
+
export type ResolvedOriginProject = {
|
|
4
|
+
vcsProvider: VcsProviderKind;
|
|
5
|
+
host: string;
|
|
6
|
+
projectPath: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Parses a CI pipeline URL — as stored in `sf package version report`'s `Description` field by
|
|
10
|
+
* `createPackageVersion` at build time — into the VCS project that built it. Recognizes GitLab
|
|
11
|
+
* pipeline URLs and GitHub Actions run URLs. Returns `undefined` if the URL doesn't match either
|
|
12
|
+
* shape (or isn't a URL at all), e.g. for a package version created outside this pipeline.
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseOriginPipelineUrl(pipelineUrl: string): ResolvedOriginProject | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Resolves which VCS project a packaged dependency's source lives in, for a happy-soup story
|
|
17
|
+
* lookup. Checks `.sfdevrc.json`'s `packageOriginOverrides` first (for packages whose origin can't
|
|
18
|
+
* be parsed, e.g. externally-vendored ones), then falls back to parsing the target version's
|
|
19
|
+
* origin pipeline URL. Returns `undefined` (never throws) if neither resolves — callers must treat
|
|
20
|
+
* that package's stories as unavailable and continue, not fail the notification.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolvePackageOrigin(packageName: string, targetDescription: string | undefined): ResolvedOriginProject | undefined;
|
|
@@ -0,0 +1,61 @@
|
|
|
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 { GitHubProvider, GitLabProvider } from '../vcs/index.js';
|
|
17
|
+
import { getPackageOriginOverride } from '../sfConfig.js';
|
|
18
|
+
/** Matches a GitLab CI pipeline URL, e.g. `https://gitlab.com/group/subgroup/project/-/pipelines/12345`. */
|
|
19
|
+
const GITLAB_PIPELINE_PATH = /^\/(?<projectPath>.+)\/-\/pipelines\/\d+/;
|
|
20
|
+
/** Matches a GitHub Actions run URL, e.g. `https://github.com/owner/repo/actions/runs/12345`. */
|
|
21
|
+
const GITHUB_RUN_PATH = /^\/(?<projectPath>[^/]+\/[^/]+)\/actions\/runs\/\d+/;
|
|
22
|
+
/**
|
|
23
|
+
* Parses a CI pipeline URL — as stored in `sf package version report`'s `Description` field by
|
|
24
|
+
* `createPackageVersion` at build time — into the VCS project that built it. Recognizes GitLab
|
|
25
|
+
* pipeline URLs and GitHub Actions run URLs. Returns `undefined` if the URL doesn't match either
|
|
26
|
+
* shape (or isn't a URL at all), e.g. for a package version created outside this pipeline.
|
|
27
|
+
*/
|
|
28
|
+
export function parseOriginPipelineUrl(pipelineUrl) {
|
|
29
|
+
let url;
|
|
30
|
+
try {
|
|
31
|
+
url = new URL(pipelineUrl);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
const gitlabMatch = GITLAB_PIPELINE_PATH.exec(url.pathname);
|
|
37
|
+
if (gitlabMatch?.groups?.projectPath) {
|
|
38
|
+
return { vcsProvider: 'gitlab', host: url.host, projectPath: gitlabMatch.groups.projectPath };
|
|
39
|
+
}
|
|
40
|
+
const githubMatch = GITHUB_RUN_PATH.exec(url.pathname);
|
|
41
|
+
if (githubMatch?.groups?.projectPath) {
|
|
42
|
+
return { vcsProvider: 'github', host: url.host, projectPath: githubMatch.groups.projectPath };
|
|
43
|
+
}
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Resolves which VCS project a packaged dependency's source lives in, for a happy-soup story
|
|
48
|
+
* lookup. Checks `.sfdevrc.json`'s `packageOriginOverrides` first (for packages whose origin can't
|
|
49
|
+
* be parsed, e.g. externally-vendored ones), then falls back to parsing the target version's
|
|
50
|
+
* origin pipeline URL. Returns `undefined` (never throws) if neither resolves — callers must treat
|
|
51
|
+
* that package's stories as unavailable and continue, not fail the notification.
|
|
52
|
+
*/
|
|
53
|
+
export function resolvePackageOrigin(packageName, targetDescription) {
|
|
54
|
+
const override = getPackageOriginOverride(packageName);
|
|
55
|
+
if (override) {
|
|
56
|
+
const defaultHost = override.vcsProvider === 'gitlab' ? GitLabProvider.defaultHost : GitHubProvider.defaultHost;
|
|
57
|
+
return { vcsProvider: override.vcsProvider, host: override.host ?? defaultHost, projectPath: override.projectPath };
|
|
58
|
+
}
|
|
59
|
+
return targetDescription ? parseOriginPipelineUrl(targetDescription) : undefined;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=resolveOriginProject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveOriginProject.js","sourceRoot":"","sources":["../../src/happySoup/resolveOriginProject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAwB,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAS1D,4GAA4G;AAC5G,MAAM,oBAAoB,GAAG,0CAA0C,CAAC;AAExE,iGAAiG;AACjG,MAAM,eAAe,GAAG,qDAAqD,CAAC;AAE9E;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,WAAmB;IACxD,IAAI,GAAQ,CAAC;IACb,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,WAAW,GAAG,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC5D,IAAI,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;QACrC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;IAChG,CAAC;IAED,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACvD,IAAI,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;QACrC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;IAChG,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,WAAmB,EACnB,iBAAqC;IAErC,MAAM,QAAQ,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC;IACvD,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC;QAChH,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,WAAW,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC;IACtH,CAAC;IAED,OAAO,iBAAiB,CAAC,CAAC,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACnF,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,53 @@
|
|
|
1
1
|
export * from './alm/index.js';
|
|
2
2
|
export * from './vcs/index.js';
|
|
3
|
+
export * from './env.js';
|
|
4
|
+
export * from './git.js';
|
|
5
|
+
export * from './logger.js';
|
|
6
|
+
export * from './sfApex.js';
|
|
7
|
+
export * from './sfAuth.js';
|
|
8
|
+
export * from './sfConfig.js';
|
|
9
|
+
export * from './sfPackages.js';
|
|
10
|
+
export * from './sfPlugins.js';
|
|
11
|
+
export * from './build/checkPermissionSets.js';
|
|
12
|
+
export * from './build/cleanupScratchOrgs.js';
|
|
13
|
+
export * from './build/createFallbackTag.js';
|
|
14
|
+
export * from './build/createPackageVersion.js';
|
|
15
|
+
export * from './build/createScratchOrg.js';
|
|
16
|
+
export * from './build/deleteScratchOrg.js';
|
|
17
|
+
export * from './build/deltaRunner.js';
|
|
18
|
+
export * from './build/determinePackageChanges.js';
|
|
19
|
+
export * from './build/devHubs.js';
|
|
20
|
+
export * from './build/flexipageDelta.js';
|
|
21
|
+
export * from './build/flowDelta.js';
|
|
22
|
+
export * from './build/installDependencies.js';
|
|
23
|
+
export * from './build/lwcJest.js';
|
|
24
|
+
export * from './build/publishUtamPageObjects.js';
|
|
25
|
+
export * from './build/pushScratch.js';
|
|
26
|
+
export * from './build/scratchOrgAuth.js';
|
|
27
|
+
export * from './build/scratchOrgInfo.js';
|
|
28
|
+
export * from './build/skipGuard.js';
|
|
29
|
+
export * from './build/testScratch.js';
|
|
30
|
+
export * from './build/utamPageObjects.js';
|
|
31
|
+
export * from './build/versionTagFormat.js';
|
|
32
|
+
export * from './deploy/deployCommon.js';
|
|
33
|
+
export * from './deploy/deployHappySoup.js';
|
|
34
|
+
export * from './deploy/deployProject.js';
|
|
35
|
+
export * from './deploy/runDeployStage.js';
|
|
36
|
+
export * from './deploy/stageOptions.js';
|
|
37
|
+
export * from './deploy/validate.js';
|
|
38
|
+
export * from './exec/sfCli.js';
|
|
39
|
+
export * from './flags/env.js';
|
|
40
|
+
export * from './happySoup/resolveOriginProject.js';
|
|
41
|
+
export * from './notify/buildNotification.js';
|
|
42
|
+
export * from './notify/getCommitStories.js';
|
|
43
|
+
export * from './notify/getRemoteCommitStories.js';
|
|
44
|
+
export * from './notify/happySoupNotification.js';
|
|
45
|
+
export * from './notify/projectNotification.js';
|
|
46
|
+
export * from './notify/renderTemplate.js';
|
|
47
|
+
export * from './notify/sendNotification.js';
|
|
48
|
+
export * from './notify/templates.js';
|
|
49
|
+
export * from './schemas/deployConfig.js';
|
|
50
|
+
export * from './schemas/deployProgress.js';
|
|
51
|
+
export * from './schemas/deployRules.js';
|
|
52
|
+
export * from './sfdxDependabot/dependabotRun.js';
|
|
53
|
+
export * from './sfdxDependabot/updater.js';
|
package/lib/index.js
CHANGED
|
@@ -16,12 +16,73 @@
|
|
|
16
16
|
// Everything exported from this file is this package's public API and is semver-covered: adding an
|
|
17
17
|
// export is a minor/patch change, but removing or renaming one is breaking. `test/index.test.ts`
|
|
18
18
|
// pins the exported-key list down so an accidental removal fails a test instead of silently shipping
|
|
19
|
-
// in a patch release. See docs/design/0037-simply-cicd-core.md for
|
|
20
|
-
//
|
|
19
|
+
// in a patch release. See docs/design/0037-simply-cicd-core.md for the original `alm/`/`vcs/` split,
|
|
20
|
+
// and docs/design/0053-simply-cicd-core-common.md for the move of the rest of `@simplysf/simply-cicd`'s
|
|
21
|
+
// `common/` (everything except its oclif flag declarations).
|
|
21
22
|
//
|
|
22
23
|
// `alm/index.ts` and `vcs/index.ts` are themselves complete barrels (they register the built-in
|
|
23
24
|
// providers as an import side effect, same as they did inside `simply-cicd`) — re-exporting them
|
|
24
25
|
// here keeps that registration intact without duplicating either list.
|
|
25
26
|
export * from './alm/index.js';
|
|
26
27
|
export * from './vcs/index.js';
|
|
28
|
+
// shared kernel
|
|
29
|
+
export * from './env.js';
|
|
30
|
+
export * from './git.js';
|
|
31
|
+
export * from './logger.js';
|
|
32
|
+
export * from './sfApex.js';
|
|
33
|
+
export * from './sfAuth.js';
|
|
34
|
+
export * from './sfConfig.js';
|
|
35
|
+
export * from './sfPackages.js';
|
|
36
|
+
export * from './sfPlugins.js';
|
|
37
|
+
// build/
|
|
38
|
+
export * from './build/checkPermissionSets.js';
|
|
39
|
+
export * from './build/cleanupScratchOrgs.js';
|
|
40
|
+
export * from './build/createFallbackTag.js';
|
|
41
|
+
export * from './build/createPackageVersion.js';
|
|
42
|
+
export * from './build/createScratchOrg.js';
|
|
43
|
+
export * from './build/deleteScratchOrg.js';
|
|
44
|
+
export * from './build/deltaRunner.js';
|
|
45
|
+
export * from './build/determinePackageChanges.js';
|
|
46
|
+
export * from './build/devHubs.js';
|
|
47
|
+
export * from './build/flexipageDelta.js';
|
|
48
|
+
export * from './build/flowDelta.js';
|
|
49
|
+
export * from './build/installDependencies.js';
|
|
50
|
+
export * from './build/lwcJest.js';
|
|
51
|
+
export * from './build/publishUtamPageObjects.js';
|
|
52
|
+
export * from './build/pushScratch.js';
|
|
53
|
+
export * from './build/scratchOrgAuth.js';
|
|
54
|
+
export * from './build/scratchOrgInfo.js';
|
|
55
|
+
export * from './build/skipGuard.js';
|
|
56
|
+
export * from './build/testScratch.js';
|
|
57
|
+
export * from './build/utamPageObjects.js';
|
|
58
|
+
export * from './build/versionTagFormat.js';
|
|
59
|
+
// deploy/
|
|
60
|
+
export * from './deploy/deployCommon.js';
|
|
61
|
+
export * from './deploy/deployHappySoup.js';
|
|
62
|
+
export * from './deploy/deployProject.js';
|
|
63
|
+
export * from './deploy/runDeployStage.js';
|
|
64
|
+
export * from './deploy/stageOptions.js';
|
|
65
|
+
export * from './deploy/validate.js';
|
|
66
|
+
// exec/
|
|
67
|
+
export * from './exec/sfCli.js';
|
|
68
|
+
// flags/
|
|
69
|
+
export * from './flags/env.js';
|
|
70
|
+
// happySoup/
|
|
71
|
+
export * from './happySoup/resolveOriginProject.js';
|
|
72
|
+
// notify/
|
|
73
|
+
export * from './notify/buildNotification.js';
|
|
74
|
+
export * from './notify/getCommitStories.js';
|
|
75
|
+
export * from './notify/getRemoteCommitStories.js';
|
|
76
|
+
export * from './notify/happySoupNotification.js';
|
|
77
|
+
export * from './notify/projectNotification.js';
|
|
78
|
+
export * from './notify/renderTemplate.js';
|
|
79
|
+
export * from './notify/sendNotification.js';
|
|
80
|
+
export * from './notify/templates.js';
|
|
81
|
+
// schemas/
|
|
82
|
+
export * from './schemas/deployConfig.js';
|
|
83
|
+
export * from './schemas/deployProgress.js';
|
|
84
|
+
export * from './schemas/deployRules.js';
|
|
85
|
+
// sfdxDependabot/
|
|
86
|
+
export * from './sfdxDependabot/dependabotRun.js';
|
|
87
|
+
export * from './sfdxDependabot/updater.js';
|
|
27
88
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,mGAAmG;AACnG,iGAAiG;AACjG,qGAAqG;AACrG,qGAAqG;AACrG,wGAAwG;AACxG,6DAA6D;AAC7D,EAAE;AACF,gGAAgG;AAChG,iGAAiG;AACjG,uEAAuE;AAEvE,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAE/B,gBAAgB;AAChB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,SAAS;AACT,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC;AACnD,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAE5C,UAAU;AACV,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AAErC,QAAQ;AACR,cAAc,iBAAiB,CAAC;AAEhC,SAAS;AACT,cAAc,gBAAgB,CAAC;AAE/B,aAAa;AACb,cAAc,qCAAqC,CAAC;AAEpD,UAAU;AACV,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AAEtC,WAAW;AACX,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AAEzC,kBAAkB;AAClB,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC"}
|
package/lib/logger.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** A logger utility for consistent logging across the simply-cicd package's shared modules. */
|
|
2
|
+
export declare const logger: {
|
|
3
|
+
debug: (message: string, ...args: unknown[]) => void;
|
|
4
|
+
info: (message: string, ...args: unknown[]) => void;
|
|
5
|
+
success: (message: string, ...args: unknown[]) => void;
|
|
6
|
+
warn: (message: string, ...args: unknown[]) => void;
|
|
7
|
+
error: (message: string, ...args: unknown[]) => void;
|
|
8
|
+
log: (message: string, ...args: unknown[]) => void;
|
|
9
|
+
raw: (...args: unknown[]) => void;
|
|
10
|
+
};
|
package/lib/logger.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
/* eslint-disable no-console -- this module is the sole intended console output surface for simply-cicd's shared modules */
|
|
17
|
+
import chalk from 'chalk';
|
|
18
|
+
import logSymbols from 'log-symbols';
|
|
19
|
+
chalk.level = 1;
|
|
20
|
+
const debugPrefix = chalk.yellow('[DEBUG]');
|
|
21
|
+
const logPrefix = chalk.yellow('[SIMPLY-CICD]');
|
|
22
|
+
const format = (message) => `${logPrefix} ${message}`;
|
|
23
|
+
/** A logger utility for consistent logging across the simply-cicd package's shared modules. */
|
|
24
|
+
export const logger = {
|
|
25
|
+
debug: (message, ...args) => console.log(`${logPrefix} ${debugPrefix} ${message}`, ...args),
|
|
26
|
+
info: (message, ...args) => console.log(logSymbols.info, format(message), ...args),
|
|
27
|
+
success: (message, ...args) => console.log(logSymbols.success, format(message), ...args),
|
|
28
|
+
warn: (message, ...args) => console.warn(logSymbols.warning, format(message), ...args),
|
|
29
|
+
error: (message, ...args) => console.error(logSymbols.error, format(message), ...args),
|
|
30
|
+
log: (message, ...args) => console.log(format(message), ...args),
|
|
31
|
+
raw: (...args) => console.log(...args),
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","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,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IAC/G,GAAG,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IACzF,GAAG,EAAE,CAAC,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CACxD,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type AlmProviderKind } from '../alm/index.js';
|
|
2
|
+
import { type CommitStories } from './getCommitStories.js';
|
|
3
|
+
/** The file `build create-package-version` writes the new version's `04t` ID to. */
|
|
4
|
+
export declare const SUBSCRIBER_PACKAGE_VERSION_ID_FILE = "subscriberPackageVersionId.env";
|
|
5
|
+
export type NotifyBuildResult = {
|
|
6
|
+
sent: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type NotifyBuildOptions = {
|
|
9
|
+
ciCommitRefName?: string;
|
|
10
|
+
ciJobName?: string;
|
|
11
|
+
ciJobStage?: string;
|
|
12
|
+
ciJobStatus?: string;
|
|
13
|
+
ciPipelineId?: string;
|
|
14
|
+
ciPipelineUrl?: string;
|
|
15
|
+
ciProjectTitle?: string;
|
|
16
|
+
subscriberPackageVersionId?: string;
|
|
17
|
+
almBaseUrl?: string;
|
|
18
|
+
almProjectKey?: string;
|
|
19
|
+
almProvider?: AlmProviderKind;
|
|
20
|
+
teamsWebhookUrl?: string[];
|
|
21
|
+
debug: boolean;
|
|
22
|
+
};
|
|
23
|
+
/** The new package version's git tag and the issue references since the previous one. */
|
|
24
|
+
export type PackageVersionHistory = CommitStories & {
|
|
25
|
+
versionTag: string;
|
|
26
|
+
previousVersionTag: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The `04t` ID of a package version created in this job: the explicit value if given, otherwise the
|
|
30
|
+
* one `build create-package-version` wrote to {@link SUBSCRIBER_PACKAGE_VERSION_ID_FILE}. `undefined`
|
|
31
|
+
* when the job created none.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveBuiltSubscriberPackageVersionId(explicit?: string): Promise<string | undefined>;
|
|
34
|
+
/** Fetches the tags, and the full history when the CI clone is shallow, so tags can be described and diffed. */
|
|
35
|
+
export declare function fetchVersionHistory(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* The tag at `HEAD` that `build create-package-version` annotated with `subscriberPackageVersionId`.
|
|
38
|
+
* Matching on the annotation rather than the name works for any version tag format or suffix.
|
|
39
|
+
*/
|
|
40
|
+
export declare function findPackageVersionTag(subscriberPackageVersionId: string): Promise<string | undefined>;
|
|
41
|
+
/** The nearest version tag, in the project's format, before `versionTag`. `undefined` for a package's first version. */
|
|
42
|
+
export declare function findPreviousVersionTag(versionTag: string): Promise<string | undefined>;
|
|
43
|
+
/**
|
|
44
|
+
* Resolves the new version's tag, the previous version's tag, and the issue references in between.
|
|
45
|
+
* Never throws: anything it can't resolve comes back as `N/A`, because a notification shouldn't be
|
|
46
|
+
* what fails a build.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getPackageVersionHistory(subscriberPackageVersionId: string, options: Pick<NotifyBuildOptions, 'almBaseUrl' | 'almProjectKey' | 'almProvider' | 'debug'>): Promise<PackageVersionHistory>;
|
|
49
|
+
/**
|
|
50
|
+
* Posts a failure card for a failed build job, or a package version card for a successful job that
|
|
51
|
+
* created a package version. Any other job result sends nothing.
|
|
52
|
+
*/
|
|
53
|
+
export declare function sendBuildNotification(options: NotifyBuildOptions): Promise<NotifyBuildResult>;
|