@bridge-ds/core 0.11.0 → 0.13.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 +17 -1
- package/bridge.config.schema.json +5 -0
- package/dist/audit/index.js +3 -3
- package/dist/config.d.ts +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +212 -58
- package/dist/index.js.map +1 -1
- package/dist/node/index.js +3 -3
- package/dist/{prod-branch-BdMPKffE.js → prod-branch-6ftQWwdu.js} +41 -23
- package/dist/prod-branch-6ftQWwdu.js.map +1 -0
- package/dist/{report-DOnKUw8G.js → report-BeWNSjPk.js} +2 -2
- package/dist/{report-DOnKUw8G.js.map → report-BeWNSjPk.js.map} +1 -1
- package/dist/review-gate.d.ts +8 -1
- package/dist/rights.d.ts +20 -0
- package/dist/storybook.d.ts +94 -0
- package/dist/{suggestion-apply-DxXRGQrO.js → suggestion-apply-bH6-gZrE.js} +7 -6
- package/dist/suggestion-apply-bH6-gZrE.js.map +1 -0
- package/dist/suggestion-review.d.ts +4 -1
- package/package.json +1 -1
- package/dist/prod-branch-BdMPKffE.js.map +0 -1
- package/dist/suggestion-apply-DxXRGQrO.js.map +0 -1
package/dist/node/index.js
CHANGED
|
@@ -2,10 +2,10 @@ import { execFile } from "node:child_process";
|
|
|
2
2
|
import { mkdtemp, rm, mkdir, writeFile, lstat, readFile } from "node:fs/promises";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { join, resolve, relative, dirname, sep, posix } from "node:path";
|
|
5
|
-
import { aU as assertSafeBranch, c as collectHistory, p as packageDirCandidates, a as parseChangelog, m as mergeReleases, r as releasesFromTags, b as buildReport, cr as prNumberFromSubject, cO as specHash, da as validateComponentSpec, bN as hashSpec, bO as iconComponentName, C as variantKeyOf, d6 as tokenCssVar, aj as COMPONENT_SPECS_VERSION, ai as COLOR_FIELDS, cR as suggestionAppliedComment, X as gitBlobSha, cp as planSuggestionApply } from "../suggestion-apply-
|
|
6
|
-
import { K as selectTokenFiles, bl as globToRegExp, N as loadConfig, L as LayeredTokenSet, V as CONFIG_FILE, $ as layoutOptions, a0 as buildTokenSet, b3 as defaultContext, B as resolve$1, ae as slugify, bX as protectedBranchesOf, aM as baseBranchOf } from "../prod-branch-
|
|
5
|
+
import { aU as assertSafeBranch, c as collectHistory, p as packageDirCandidates, a as parseChangelog, m as mergeReleases, r as releasesFromTags, b as buildReport, cr as prNumberFromSubject, cO as specHash, da as validateComponentSpec, bN as hashSpec, bO as iconComponentName, C as variantKeyOf, d6 as tokenCssVar, aj as COMPONENT_SPECS_VERSION, ai as COLOR_FIELDS, cR as suggestionAppliedComment, X as gitBlobSha, cp as planSuggestionApply } from "../suggestion-apply-bH6-gZrE.js";
|
|
6
|
+
import { K as selectTokenFiles, bl as globToRegExp, N as loadConfig, L as LayeredTokenSet, V as CONFIG_FILE, $ as layoutOptions, a0 as buildTokenSet, b3 as defaultContext, B as resolve$1, ae as slugify, bX as protectedBranchesOf, aM as baseBranchOf } from "../prod-branch-6ftQWwdu.js";
|
|
7
7
|
import { statSync, readFileSync, existsSync, writeFileSync, readdirSync } from "node:fs";
|
|
8
|
-
import { i as isAuditable, Q as planCssFixes, O as parseAllowlist, d as DesignSystemIndex, l as buildAuditReport, o as compareWithBaseline, b as AUDIT_IGNORE_DIRS } from "../report-
|
|
8
|
+
import { i as isAuditable, Q as planCssFixes, O as parseAllowlist, d as DesignSystemIndex, l as buildAuditReport, o as compareWithBaseline, b as AUDIT_IGNORE_DIRS } from "../report-BeWNSjPk.js";
|
|
9
9
|
import ts from "typescript";
|
|
10
10
|
function git(root, args, opts = {}) {
|
|
11
11
|
return new Promise((resolve2, reject) => {
|
|
@@ -1039,6 +1039,19 @@ function approverEntries(owners, rights) {
|
|
|
1039
1039
|
if (!rights) return { design: [...owners.design], tech: [...owners.tech] };
|
|
1040
1040
|
return { design: holdersOf("approveDesign", owners, rights), tech: holdersOf("approveTech", owners, rights) };
|
|
1041
1041
|
}
|
|
1042
|
+
function soloApprover(owners) {
|
|
1043
|
+
const d = [...new Set(owners.design.map(norm))];
|
|
1044
|
+
const t = [...new Set(owners.tech.map(norm))];
|
|
1045
|
+
if (d.length !== 1 || t.length !== 1 || d[0] !== t[0] || !d[0] || d[0].includes("/")) return null;
|
|
1046
|
+
return d[0];
|
|
1047
|
+
}
|
|
1048
|
+
function soloOwnerOf(gov, teams) {
|
|
1049
|
+
if (!gov.soloOwnerCanApproveBoth) return null;
|
|
1050
|
+
return soloApprover(approverLists(gov.owners, gov.rights ?? null, teams));
|
|
1051
|
+
}
|
|
1052
|
+
function soloOwnerSentence(login, you = false) {
|
|
1053
|
+
return you ? "As the only owner, your approval covers design and code." : `As the only owner, @${norm(login)} approves design and code in one review.`;
|
|
1054
|
+
}
|
|
1042
1055
|
function shipPolicy(owners, rights, teams) {
|
|
1043
1056
|
if (!rights) return null;
|
|
1044
1057
|
const entries = holdersOf("ship", owners, rights);
|
|
@@ -1313,7 +1326,8 @@ function defineConfig(input) {
|
|
|
1313
1326
|
minReasonLength: g.override.minReasonLength ?? DEFAULT_OVERRIDE.minReasonLength
|
|
1314
1327
|
}
|
|
1315
1328
|
} : {},
|
|
1316
|
-
...g.rights ? { rights: normalizeRights(g.rights) } : {}
|
|
1329
|
+
...g.rights ? { rights: normalizeRights(g.rights) } : {},
|
|
1330
|
+
...g.soloOwnerCanApproveBoth === true ? { soloOwnerCanApproveBoth: true } : {}
|
|
1317
1331
|
},
|
|
1318
1332
|
products: input.products?.length ? input.products.map((p) => ({ ...p })) : DEFAULT_PRODUCTS.map((p) => ({ ...p })),
|
|
1319
1333
|
changes: input.changes === "direct" ? "direct" : DEFAULT_CHANGES_MODE,
|
|
@@ -1437,6 +1451,7 @@ function loadConfig(source) {
|
|
|
1437
1451
|
}
|
|
1438
1452
|
}
|
|
1439
1453
|
problems.push(...rightsProblems(gov.rights));
|
|
1454
|
+
if (gov.soloOwnerCanApproveBoth !== void 0 && typeof gov.soloOwnerCanApproveBoth !== "boolean") problems.push('"governance.soloOwnerCanApproveBoth" must be true or false');
|
|
1440
1455
|
}
|
|
1441
1456
|
}
|
|
1442
1457
|
problems.push(...visualImpactProblems(d.visualImpact));
|
|
@@ -3058,27 +3073,30 @@ export {
|
|
|
3058
3073
|
serializeJson as c1,
|
|
3059
3074
|
shipPolicy as c2,
|
|
3060
3075
|
snapshotUrl as c3,
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3076
|
+
soloApprover as c4,
|
|
3077
|
+
soloOwnerOf as c5,
|
|
3078
|
+
soloOwnerSentence as c6,
|
|
3079
|
+
storybookUrl as c7,
|
|
3080
|
+
suggestNearestComment as c8,
|
|
3081
|
+
summarizeTokenChange as c9,
|
|
3082
|
+
tarballAssetName as ca,
|
|
3083
|
+
tarballUrl as cb,
|
|
3084
|
+
teamKey as cc,
|
|
3085
|
+
teamKeyOf as cd,
|
|
3086
|
+
teamUnreadableMessage as ce,
|
|
3087
|
+
teamsIn as cf,
|
|
3088
|
+
toAlias as cg,
|
|
3089
|
+
toMap as ch,
|
|
3090
|
+
toPlain as ci,
|
|
3091
|
+
tokenBump as cj,
|
|
3092
|
+
tokenNode as ck,
|
|
3093
|
+
unreadableShipTeams as cl,
|
|
3094
|
+
unreadableTeams as cm,
|
|
3095
|
+
valueIn as cn,
|
|
3096
|
+
valueToCss as co,
|
|
3097
|
+
visualImpactProblems as cp,
|
|
3098
|
+
whoCanShipSentence as cq,
|
|
3099
|
+
whyItExists as cr,
|
|
3082
3100
|
collectRefs as d,
|
|
3083
3101
|
evaluatePairs as e,
|
|
3084
3102
|
findReferenceProblems as f,
|
|
@@ -3103,4 +3121,4 @@ export {
|
|
|
3103
3121
|
parseColor as y,
|
|
3104
3122
|
rgbaToHex as z
|
|
3105
3123
|
};
|
|
3106
|
-
//# sourceMappingURL=prod-branch-
|
|
3124
|
+
//# sourceMappingURL=prod-branch-6ftQWwdu.js.map
|