@bridge-ds/visual 0.3.17 → 0.3.19

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -117,6 +117,20 @@ function productProblems(raw) {
117
117
  return problems;
118
118
  }
119
119
 
120
+ // ../core/src/tooling.ts
121
+ function toolingProblems(raw) {
122
+ if (raw === void 0) return [];
123
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return ['"tooling" must be an object such as { "paths": ["apps/docs-site/"] }'];
124
+ const o = raw;
125
+ const problems = [];
126
+ for (const k of Object.keys(o)) if (k !== "paths" && k !== "scopes") problems.push(`"tooling.${k}" is not a known key (paths, scopes)`);
127
+ const list2 = (k) => o[k] === void 0 || Array.isArray(o[k]) && o[k].every((x) => typeof x === "string" && x.trim().length > 0);
128
+ if (!Array.isArray(o.paths) || !list2("paths")) problems.push('"tooling.paths" must be a list of repository folders or files, such as "apps/docs-site/"');
129
+ else if (o.paths.some((p) => p.replace(/^!/, "").trim().startsWith("/") || p.split("/").includes(".."))) problems.push('"tooling.paths" entries are relative to the repository root, without a leading "/" or ".."');
130
+ if (!list2("scopes")) problems.push('"tooling.scopes" must be a list of pull request title scopes, such as "studio"');
131
+ return problems;
132
+ }
133
+
120
134
  // ../core/src/config.ts
121
135
  var CONFIG_FILE = "bridge.config.json";
122
136
  var CHANGES_MODES = ["suggest", "direct"];
@@ -270,6 +284,7 @@ function defineConfig(input) {
270
284
  ...g.leadsPublishTier1 === false ? { leadsPublishTier1: false } : {}
271
285
  },
272
286
  products: input.products?.length ? input.products.map((p) => ({ ...p })) : DEFAULT_PRODUCTS.map((p) => ({ ...p })),
287
+ ...input.tooling ? { tooling: { paths: [...input.tooling.paths], ...input.tooling.scopes?.length ? { scopes: [...input.tooling.scopes] } : {} } } : {},
273
288
  changes: input.changes === "direct" ? "direct" : DEFAULT_CHANGES_MODE,
274
289
  ...input.storybook?.url ? { storybook: { url: input.storybook.url.trim().replace(/\/+$/, "") } } : {},
275
290
  ...input.library?.public === true ? { library: { public: true } } : {},
@@ -424,6 +439,7 @@ function loadConfig(source) {
424
439
  }
425
440
  }
426
441
  problems.push(...productProblems(d.products));
442
+ problems.push(...toolingProblems(d.tooling));
427
443
  const audit = d.audit;
428
444
  if (audit !== void 0) {
429
445
  if (!isObj(audit)) problems.push('"audit" must be an object');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bridge-ds/visual",
3
- "version": "0.3.17",
3
+ "version": "0.3.19",
4
4
  "type": "module",
5
5
  "description": "Bridge visual impact analysis: screenshots the stories and app screens a design system change touches, at the base and head refs, and pixel-diffs them into before/after/diff images and a JSON manifest.",
6
6
  "license": "FSL-1.1-MIT",
@@ -47,7 +47,7 @@
47
47
  "build:package": "node ../../scripts/build-packages.mjs visual"
48
48
  },
49
49
  "dependencies": {
50
- "@bridge-ds/core": "^0.23.0",
50
+ "@bridge-ds/core": "^0.25.0",
51
51
  "pixelmatch": "7.1.0",
52
52
  "playwright-core": "1.63.0",
53
53
  "pngjs": "7.0.0"