@bridge-ds/stylelint-plugin 0.2.21 → 0.2.23

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
@@ -953,6 +953,20 @@ function productProblems(raw) {
953
953
  return problems;
954
954
  }
955
955
 
956
+ // ../core/src/tooling.ts
957
+ function toolingProblems(raw) {
958
+ if (raw === void 0) return [];
959
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return ['"tooling" must be an object such as { "paths": ["apps/docs-site/"] }'];
960
+ const o = raw;
961
+ const problems = [];
962
+ for (const k of Object.keys(o)) if (k !== "paths" && k !== "scopes") problems.push(`"tooling.${k}" is not a known key (paths, scopes)`);
963
+ const list2 = (k) => o[k] === void 0 || Array.isArray(o[k]) && o[k].every((x) => typeof x === "string" && x.trim().length > 0);
964
+ 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/"');
965
+ 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 ".."');
966
+ if (!list2("scopes")) problems.push('"tooling.scopes" must be a list of pull request title scopes, such as "studio"');
967
+ return problems;
968
+ }
969
+
956
970
  // ../core/src/config.ts
957
971
  var CONFIG_FILE = "bridge.config.json";
958
972
  var CHANGES_MODES = ["suggest", "direct"];
@@ -1106,6 +1120,7 @@ function defineConfig(input) {
1106
1120
  ...g.leadsPublishTier1 === false ? { leadsPublishTier1: false } : {}
1107
1121
  },
1108
1122
  products: input.products?.length ? input.products.map((p) => ({ ...p })) : DEFAULT_PRODUCTS.map((p) => ({ ...p })),
1123
+ ...input.tooling ? { tooling: { paths: [...input.tooling.paths], ...input.tooling.scopes?.length ? { scopes: [...input.tooling.scopes] } : {} } } : {},
1109
1124
  changes: input.changes === "direct" ? "direct" : DEFAULT_CHANGES_MODE,
1110
1125
  ...input.storybook?.url ? { storybook: { url: input.storybook.url.trim().replace(/\/+$/, "") } } : {},
1111
1126
  ...input.library?.public === true ? { library: { public: true } } : {},
@@ -1260,6 +1275,7 @@ function loadConfig(source) {
1260
1275
  }
1261
1276
  }
1262
1277
  problems.push(...productProblems(d.products));
1278
+ problems.push(...toolingProblems(d.tooling));
1263
1279
  const audit = d.audit;
1264
1280
  if (audit !== void 0) {
1265
1281
  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/stylelint-plugin",
3
- "version": "0.2.21",
3
+ "version": "0.2.23",
4
4
  "type": "module",
5
5
  "description": "Stylelint rule bridge/use-tokens: no raw colors, lengths, radii, shadows, durations or z-index in product CSS where a design token exists. Autofixes exact matches. Reads the tokens through @bridge-ds/core and bridge.config.json.",
6
6
  "license": "MIT",
@@ -56,6 +56,6 @@
56
56
  "stylelint": "16.26.1"
57
57
  },
58
58
  "dependencies": {
59
- "@bridge-ds/core": "^0.23.0"
59
+ "@bridge-ds/core": "^0.25.0"
60
60
  }
61
61
  }