@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.
@@ -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-DxXRGQrO.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-BdMPKffE.js";
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-DOnKUw8G.js";
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
- storybookUrl as c4,
3062
- suggestNearestComment as c5,
3063
- summarizeTokenChange as c6,
3064
- tarballAssetName as c7,
3065
- tarballUrl as c8,
3066
- teamKey as c9,
3067
- teamKeyOf as ca,
3068
- teamUnreadableMessage as cb,
3069
- teamsIn as cc,
3070
- toAlias as cd,
3071
- toMap as ce,
3072
- toPlain as cf,
3073
- tokenBump as cg,
3074
- tokenNode as ch,
3075
- unreadableShipTeams as ci,
3076
- unreadableTeams as cj,
3077
- valueIn as ck,
3078
- valueToCss as cl,
3079
- visualImpactProblems as cm,
3080
- whoCanShipSentence as cn,
3081
- whyItExists as co,
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-BdMPKffE.js.map
3124
+ //# sourceMappingURL=prod-branch-6ftQWwdu.js.map