@bridge-ds/visual 0.3.19 → 0.3.20
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/dist/index.js +12 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -82,7 +82,7 @@ var DEFAULT_PRODUCTS = [
|
|
|
82
82
|
];
|
|
83
83
|
var KEY = /^[a-z0-9][a-z0-9-]*$/;
|
|
84
84
|
var REPO = /^[\w.-]+\/[\w.-]+$/;
|
|
85
|
-
var FIELDS = ["key", "name", "repo", "path", "preview", "production", "framework", "default"];
|
|
85
|
+
var FIELDS = ["key", "name", "repo", "design", "path", "preview", "production", "framework", "default"];
|
|
86
86
|
function productProblems(raw) {
|
|
87
87
|
if (raw === void 0) return [];
|
|
88
88
|
if (!Array.isArray(raw)) return ['"products" must be a list of { "key", "name" } objects'];
|
|
@@ -103,6 +103,17 @@ function productProblems(raw) {
|
|
|
103
103
|
else seen.add(o.key);
|
|
104
104
|
if (typeof o.name !== "string" || !o.name.trim()) problems.push(`${at}.name" must be the name people read, such as "Admin demo"`);
|
|
105
105
|
if (o.repo !== void 0 && (typeof o.repo !== "string" || !REPO.test(o.repo))) problems.push(`${at}.repo" must be "owner/name"`);
|
|
106
|
+
if (o.design !== void 0) {
|
|
107
|
+
const d = o.design;
|
|
108
|
+
if (!d || typeof d !== "object" || Array.isArray(d) || typeof d.repo !== "string" || !REPO.test(d.repo)) {
|
|
109
|
+
problems.push(`${at}.design" must be { "repo": "owner/name" }: the design team's copy of the product's repository`);
|
|
110
|
+
} else {
|
|
111
|
+
for (const k of Object.keys(d)) if (k !== "repo" && k !== "preview") problems.push(`${at}.design.${k}" is not a known field (repo, preview)`);
|
|
112
|
+
if (d.preview !== void 0 && (typeof d.preview !== "string" || !/^https?:\/\//.test(d.preview))) problems.push(`${at}.design.preview" must be an http(s) URL template, such as "https://shop-design-git-{branch}.vercel.app"`);
|
|
113
|
+
if (typeof o.repo !== "string") problems.push(`${at}.design" needs "repo" too: the copy is of the product's own repository`);
|
|
114
|
+
else if (d.repo.toLowerCase() === o.repo.toLowerCase()) problems.push(`${at}.design.repo" must be another repository than "repo": the design team's copy, not the developers' repository`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
106
117
|
if (o.path !== void 0) {
|
|
107
118
|
const bad = typeof o.path !== "string" || !o.path.trim() || o.path.startsWith("/") || o.path.split("/").includes("..");
|
|
108
119
|
if (bad) problems.push(`${at}.path" must be a folder relative to the repository root, without a leading "/" or "..", such as "apps/admin"`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bridge-ds/visual",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.20",
|
|
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.
|
|
50
|
+
"@bridge-ds/core": "^0.26.0",
|
|
51
51
|
"pixelmatch": "7.1.0",
|
|
52
52
|
"playwright-core": "1.63.0",
|
|
53
53
|
"pngjs": "7.0.0"
|