@bridge-ds/stylelint-plugin 0.2.16 → 0.2.18
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/LICENSE +17 -0
- package/dist/index.js +20 -1
- package/package.json +2 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Florian Gouloubi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
6
|
+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
|
7
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
|
8
|
+
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
|
11
|
+
the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
|
14
|
+
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
|
16
|
+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
17
|
+
IN THE SOFTWARE.
|
package/dist/index.js
CHANGED
|
@@ -957,6 +957,12 @@ var CONFIG_FILE = "bridge.config.json";
|
|
|
957
957
|
var CHANGES_MODES = ["suggest", "direct"];
|
|
958
958
|
var DEFAULT_CHANGES_MODE = "suggest";
|
|
959
959
|
var DEFAULT_OVERRIDE = { allowed: [], requireReason: true, minReasonLength: 20 };
|
|
960
|
+
var TEAM_NAME_MAX = 60;
|
|
961
|
+
function teamName(value) {
|
|
962
|
+
if (typeof value !== "string") return void 0;
|
|
963
|
+
const v = value.trim().replace(/\s+/g, " ");
|
|
964
|
+
return v && v.length <= TEAM_NAME_MAX ? v : void 0;
|
|
965
|
+
}
|
|
960
966
|
var DEFAULT_TOKEN_PATHS = {
|
|
961
967
|
root: "tokens",
|
|
962
968
|
primitives: "primitives",
|
|
@@ -1062,6 +1068,7 @@ function defineConfig(input) {
|
|
|
1062
1068
|
const g = input.governance ?? {};
|
|
1063
1069
|
const contrastFile = contrastPath ?? [root === "." ? "" : root, paths.contrastChecks].filter(Boolean).join("/");
|
|
1064
1070
|
return {
|
|
1071
|
+
...teamName(input.name) ? { name: teamName(input.name) } : {},
|
|
1065
1072
|
repo: parseRepoInput(input.repo, input.branch),
|
|
1066
1073
|
tokens: { ...paths, include: input.tokens?.include ?? ["**/*.tokens.json"], exclude: input.tokens?.exclude ?? [], tiers, layers, ...t.usage ? { usage: trimSlashes(t.usage) } : {} },
|
|
1067
1074
|
axes,
|
|
@@ -1094,12 +1101,14 @@ function defineConfig(input) {
|
|
|
1094
1101
|
}
|
|
1095
1102
|
} : {},
|
|
1096
1103
|
...g.rights ? { rights: normalizeRights(g.rights) } : {},
|
|
1097
|
-
...g.soloOwnerCanApproveBoth === true ? { soloOwnerCanApproveBoth: true } : {}
|
|
1104
|
+
...g.soloOwnerCanApproveBoth === true ? { soloOwnerCanApproveBoth: true } : {},
|
|
1105
|
+
...g.leadsPublishTier1 === false ? { leadsPublishTier1: false } : {}
|
|
1098
1106
|
},
|
|
1099
1107
|
products: input.products?.length ? input.products.map((p) => ({ ...p })) : DEFAULT_PRODUCTS.map((p) => ({ ...p })),
|
|
1100
1108
|
changes: input.changes === "direct" ? "direct" : DEFAULT_CHANGES_MODE,
|
|
1101
1109
|
...input.storybook?.url ? { storybook: { url: input.storybook.url.trim().replace(/\/+$/, "") } } : {},
|
|
1102
1110
|
...input.library?.public === true ? { library: { public: true } } : {},
|
|
1111
|
+
...input.demo?.viewer?.trim() ? { demo: { viewer: input.demo.viewer.trim(), ...input.demo.role?.trim() ? { role: input.demo.role.trim() } : {} } } : {},
|
|
1103
1112
|
...input.audit ? { audit: { ...input.audit } } : {},
|
|
1104
1113
|
...input.visualImpact ? { visualImpact: { mode: input.visualImpact.mode === "on-demand" ? "on-demand" : "auto" } } : {},
|
|
1105
1114
|
...input.integrations ? { integrations: { ...input.integrations } } : {},
|
|
@@ -1221,9 +1230,11 @@ function loadConfig(source) {
|
|
|
1221
1230
|
}
|
|
1222
1231
|
problems.push(...rightsProblems(gov.rights));
|
|
1223
1232
|
if (gov.soloOwnerCanApproveBoth !== void 0 && typeof gov.soloOwnerCanApproveBoth !== "boolean") problems.push('"governance.soloOwnerCanApproveBoth" must be true or false');
|
|
1233
|
+
if (gov.leadsPublishTier1 !== void 0 && typeof gov.leadsPublishTier1 !== "boolean") problems.push('"governance.leadsPublishTier1" must be true or false');
|
|
1224
1234
|
}
|
|
1225
1235
|
}
|
|
1226
1236
|
problems.push(...visualImpactProblems(d.visualImpact));
|
|
1237
|
+
if (d.name !== void 0 && teamName(d.name) === void 0) problems.push(`"name" must be the team's name, 1 to ${TEAM_NAME_MAX} characters`);
|
|
1227
1238
|
if (d.changes !== void 0 && !CHANGES_MODES.includes(d.changes)) problems.push(`"changes" must be "suggest" or "direct" (got ${JSON.stringify(d.changes)})`);
|
|
1228
1239
|
const sb = d.storybook;
|
|
1229
1240
|
if (sb !== void 0) {
|
|
@@ -1239,6 +1250,14 @@ function loadConfig(source) {
|
|
|
1239
1250
|
for (const k of Object.keys(lib)) if (k !== "public") problems.push(`"library.${k}" is not a known key`);
|
|
1240
1251
|
}
|
|
1241
1252
|
}
|
|
1253
|
+
const demo = d.demo;
|
|
1254
|
+
if (demo !== void 0) {
|
|
1255
|
+
if (!isObj(demo) || !isStr(demo.viewer) || !demo.viewer.trim()) problems.push('"demo" must be { "viewer" }, for example { "viewer": "Dana", "role": "DS lead" }');
|
|
1256
|
+
else {
|
|
1257
|
+
if (demo.role !== void 0 && !isStr(demo.role)) problems.push('"demo.role" must be a string, for example "DS lead"');
|
|
1258
|
+
for (const k of Object.keys(demo)) if (k !== "viewer" && k !== "role") problems.push(`"demo.${k}" is not a known key`);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1242
1261
|
problems.push(...productProblems(d.products));
|
|
1243
1262
|
const audit = d.audit;
|
|
1244
1263
|
if (audit !== void 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bridge-ds/stylelint-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18",
|
|
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.
|
|
59
|
+
"@bridge-ds/core": "^0.20.0"
|
|
60
60
|
}
|
|
61
61
|
}
|