@empline/preflight 1.1.30 → 1.1.31
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/checks/api/integration-schema-consistency.d.ts.map +1 -1
- package/dist/checks/api/integration-schema-consistency.js +79 -4
- package/dist/checks/api/integration-schema-consistency.js.map +1 -1
- package/dist/checks/ui/consistent-section-spacing.d.ts +13 -0
- package/dist/checks/ui/consistent-section-spacing.d.ts.map +1 -0
- package/dist/checks/ui/consistent-section-spacing.js +246 -0
- package/dist/checks/ui/consistent-section-spacing.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-schema-consistency.d.ts","sourceRoot":"","sources":["../../../src/checks/api/integration-schema-consistency.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"integration-schema-consistency.d.ts","sourceRoot":"","sources":["../../../src/checks/api/integration-schema-consistency.ts"],"names":[],"mappings":";AAoBA,eAAO,MAAM,EAAE,uCAAuC,CAAC;AACvD,eAAO,MAAM,IAAI,mCAAmC,CAAC;AACrD,eAAO,MAAM,WAAW,wDAAwD,CAAC;AACjF,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAC9B,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,eAAO,MAAM,IAAI,UAA4C,CAAC;AAC9D,eAAO,MAAM,QAAQ,UAA0B,CAAC;AA6FhD,wBAAsB,GAAG,IAAI,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CA4I3F"}
|
|
@@ -14,6 +14,8 @@ exports.run = run;
|
|
|
14
14
|
* - Field name mismatches (e.g., UI uses `wooField` but API expects `sourceField`)
|
|
15
15
|
* - Feature flag mismatches (e.g., UI uses `linkProducts` but API expects `exportListings`)
|
|
16
16
|
* - Missing fields in API schemas that UI depends on
|
|
17
|
+
* - Zod transform() calls that drop fields needed by import APIs or UI
|
|
18
|
+
* - Inconsistency between save endpoint schema and import endpoint schema
|
|
17
19
|
*
|
|
18
20
|
* This helps prevent silent data loss where UI sends fields that get stripped by validation.
|
|
19
21
|
*/
|
|
@@ -36,15 +38,19 @@ const INTEGRATION_CHECKS = [
|
|
|
36
38
|
name: "WooCommerce",
|
|
37
39
|
uiTypePath: "components/woocommerce/types.ts",
|
|
38
40
|
apiRoutePath: "app/api/store/integrations/woocommerce/route.ts",
|
|
41
|
+
importRoutePath: "app/api/store/integrations/woocommerce/import/route.ts",
|
|
39
42
|
fieldMappings: [
|
|
40
|
-
{ uiField: "wooField", apiField: "
|
|
41
|
-
{ uiField: "supercatchField", apiField: "
|
|
43
|
+
{ uiField: "wooField", apiField: "wooField" },
|
|
44
|
+
{ uiField: "supercatchField", apiField: "supercatchField" },
|
|
45
|
+
{ uiField: "required", apiField: "required" },
|
|
42
46
|
{ uiField: "linkProducts", apiField: "linkProducts" },
|
|
43
47
|
{ uiField: "importProducts", apiField: "importProducts" },
|
|
44
48
|
{ uiField: "syncInventory", apiField: "syncInventory" },
|
|
45
49
|
{ uiField: "syncPrices", apiField: "syncPrices" },
|
|
46
50
|
{ uiField: "syncOrders", apiField: "syncOrders" },
|
|
47
51
|
],
|
|
52
|
+
// These fields must be preserved in any Zod transform, not dropped
|
|
53
|
+
requiredPreservedFields: ["wooField", "supercatchField", "required", "id", "transform"],
|
|
48
54
|
},
|
|
49
55
|
{
|
|
50
56
|
name: "Shopify",
|
|
@@ -57,6 +63,39 @@ const INTEGRATION_CHECKS = [
|
|
|
57
63
|
],
|
|
58
64
|
},
|
|
59
65
|
];
|
|
66
|
+
/**
|
|
67
|
+
* Check if a Zod schema transform preserves a field
|
|
68
|
+
* Looks for patterns like `.transform((data) => ({ fieldName: ... }))`
|
|
69
|
+
*/
|
|
70
|
+
function checkTransformPreservesField(content, fieldName) {
|
|
71
|
+
// Look for transform output that includes the field
|
|
72
|
+
// Pattern: transform((data) => ({ ... fieldName: ... }))
|
|
73
|
+
const transformPattern = /\.transform\s*\(\s*\([^)]*\)\s*=>\s*\(\{([\s\S]*?)\}\)\s*\)/g;
|
|
74
|
+
let match;
|
|
75
|
+
while ((match = transformPattern.exec(content)) !== null) {
|
|
76
|
+
const transformBody = match[1];
|
|
77
|
+
// Check if field is in the transform output
|
|
78
|
+
const fieldPattern = new RegExp(`\\b${fieldName}\\s*:`);
|
|
79
|
+
if (fieldPattern.test(transformBody || "")) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// If no transform found, assume field is preserved (passthrough)
|
|
84
|
+
if (!content.includes(".transform(")) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
// Check if the field is at least accepted in the schema input
|
|
88
|
+
const acceptsField = new RegExp(`\\b${fieldName}\\s*:`).test(content);
|
|
89
|
+
return acceptsField;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Check if import route expects a field
|
|
93
|
+
*/
|
|
94
|
+
function importRouteExpectsField(importContent, fieldName) {
|
|
95
|
+
// Look for fieldName in Zod schema definitions
|
|
96
|
+
const schemaPattern = new RegExp(`\\b${fieldName}\\s*:\\s*z\\.`);
|
|
97
|
+
return schemaPattern.test(importContent);
|
|
98
|
+
}
|
|
60
99
|
async function run() {
|
|
61
100
|
console.log(`\n${console_chars_1.emoji.check} INTEGRATION SCHEMA CONSISTENCY`);
|
|
62
101
|
console.log((0, console_chars_1.createDivider)(65, "heavy"));
|
|
@@ -64,6 +103,7 @@ async function run() {
|
|
|
64
103
|
for (const check of INTEGRATION_CHECKS) {
|
|
65
104
|
const uiPath = path_1.default.join(process.cwd(), check.uiTypePath);
|
|
66
105
|
const apiPath = path_1.default.join(process.cwd(), check.apiRoutePath);
|
|
106
|
+
const importPath = check.importRoutePath ? path_1.default.join(process.cwd(), check.importRoutePath) : null;
|
|
67
107
|
// Check if files exist
|
|
68
108
|
if (!fs_1.default.existsSync(uiPath)) {
|
|
69
109
|
console.log(` Skipping ${check.name}: UI types file not found`);
|
|
@@ -75,6 +115,9 @@ async function run() {
|
|
|
75
115
|
}
|
|
76
116
|
const uiContent = fs_1.default.readFileSync(uiPath, "utf-8");
|
|
77
117
|
const apiContent = fs_1.default.readFileSync(apiPath, "utf-8");
|
|
118
|
+
const importContent = importPath && fs_1.default.existsSync(importPath)
|
|
119
|
+
? fs_1.default.readFileSync(importPath, "utf-8")
|
|
120
|
+
: null;
|
|
78
121
|
console.log(`\n Checking ${check.name}...`);
|
|
79
122
|
// Check field mappings
|
|
80
123
|
for (const mapping of check.fieldMappings) {
|
|
@@ -117,6 +160,37 @@ async function run() {
|
|
|
117
160
|
description: `UI uses 'linkProducts' but API schema uses 'exportListings' - data will be silently dropped`,
|
|
118
161
|
});
|
|
119
162
|
}
|
|
163
|
+
// Check if required fields are preserved in Zod transforms
|
|
164
|
+
if (check.requiredPreservedFields) {
|
|
165
|
+
for (const field of check.requiredPreservedFields) {
|
|
166
|
+
const uiDefinesField = new RegExp(`\\b${field}\\s*[:\\?]`).test(uiContent);
|
|
167
|
+
if (uiDefinesField && !checkTransformPreservesField(apiContent, field)) {
|
|
168
|
+
issues.push({
|
|
169
|
+
integration: check.name,
|
|
170
|
+
type: "field_dropped_by_transform",
|
|
171
|
+
uiField: field,
|
|
172
|
+
apiField: field,
|
|
173
|
+
description: `Field '${field}' is defined in UI types but may be dropped by Zod transform() in API schema`,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// Check consistency between save endpoint and import endpoint
|
|
179
|
+
if (importContent && check.requiredPreservedFields) {
|
|
180
|
+
for (const field of check.requiredPreservedFields) {
|
|
181
|
+
const importExpects = importRouteExpectsField(importContent, field);
|
|
182
|
+
const apiPreserves = checkTransformPreservesField(apiContent, field);
|
|
183
|
+
if (importExpects && !apiPreserves) {
|
|
184
|
+
issues.push({
|
|
185
|
+
integration: check.name,
|
|
186
|
+
type: "import_api_mismatch",
|
|
187
|
+
uiField: field,
|
|
188
|
+
apiField: field,
|
|
189
|
+
description: `Import API expects '${field}' but save endpoint may drop it - data saved won't work when imported`,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
120
194
|
}
|
|
121
195
|
// Summary
|
|
122
196
|
console.log(`\n${console_chars_1.emoji.chart} Summary:`);
|
|
@@ -136,8 +210,9 @@ async function run() {
|
|
|
136
210
|
}
|
|
137
211
|
console.log(`\n${console_chars_1.emoji.info} To fix schema mismatches:`);
|
|
138
212
|
console.log(` 1. Ensure API schema accepts the field names UI sends`);
|
|
139
|
-
console.log(` 2.
|
|
140
|
-
console.log(` 3.
|
|
213
|
+
console.log(` 2. When using Zod transform(), preserve ALL fields needed by UI and import APIs`);
|
|
214
|
+
console.log(` 3. Check that save endpoint schema output matches import endpoint schema input`);
|
|
215
|
+
console.log(` 4. Update UI types to match API expectations`);
|
|
141
216
|
console.log(`\n${console_chars_1.emoji.error} INTEGRATION SCHEMA CONSISTENCY FAILED`);
|
|
142
217
|
return { success: false, errors: issues.length, warnings: 0 };
|
|
143
218
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-schema-consistency.js","sourceRoot":"","sources":["../../../src/checks/api/integration-schema-consistency.ts"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"integration-schema-consistency.js","sourceRoot":"","sources":["../../../src/checks/api/integration-schema-consistency.ts"],"names":[],"mappings":";;;;;;;AAuHA,kBA4IC;AAlQD;;;;;;;;;;;;GAYG;AACH,4CAAoB;AACpB,gDAAwB;AAExB,6DAAiE;AAEjE,kDAAkD;AACrC,QAAA,EAAE,GAAG,oCAAoC,CAAC;AAC1C,QAAA,IAAI,GAAG,gCAAgC,CAAC;AACxC,QAAA,WAAW,GAAG,qDAAqD,CAAC;AACpE,QAAA,QAAQ,GAAG,KAAK,CAAC;AACjB,QAAA,QAAQ,GAAG,IAAI,CAAC,CAAC,oDA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AAC,mBAAmB,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,KAAK,qBAAK,CAAC,IAAI,4BAA4B,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,oFAAoF,CAAC,CAAC;IAClG,OAAO,CAAC,GAAG,CAAC,mFAAmF,CAAC,CAAC;IACjG,OAAO,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;IAE/D,OAAO,CAAC,GAAG,CAAC,KAAK,qBAAK,CAAC,KAAK,wCAAwC,CAAC,CAAC;IACtE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;AAChE,CAAC;AAED,yBAAyB;AACzB,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,GAAG,EAAE;SACF,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;QACpB,OAAO,CAAC,KAAK,CAAC,GAAG,qBAAK,CAAC,KAAK,oBAAoB,EAAE,GAAG,CAAC,CAAC;QACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export declare const id = "ui/consistent-section-spacing";
|
|
3
|
+
export declare const name = "Consistent Section Spacing";
|
|
4
|
+
export declare const description = "Detects excessive margin/spacing values between UI sections";
|
|
5
|
+
export declare const category = "ui";
|
|
6
|
+
export declare const blocking = false;
|
|
7
|
+
export declare const tags: string[];
|
|
8
|
+
export declare function run(): Promise<{
|
|
9
|
+
success: boolean;
|
|
10
|
+
errors: number;
|
|
11
|
+
warnings: number;
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=consistent-section-spacing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consistent-section-spacing.d.ts","sourceRoot":"","sources":["../../../src/checks/ui/consistent-section-spacing.ts"],"names":[],"mappings":";AAmCA,eAAO,MAAM,EAAE,kCAAkC,CAAC;AAClD,eAAO,MAAM,IAAI,+BAA+B,CAAC;AACjD,eAAO,MAAM,WAAW,gEAAgE,CAAC;AACzF,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAC9B,eAAO,MAAM,IAAI,UAAqD,CAAC;AAqHvE,wBAAsB,GAAG,IAAI,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAmH3F"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.tags = exports.blocking = exports.category = exports.description = exports.name = exports.id = void 0;
|
|
8
|
+
exports.run = run;
|
|
9
|
+
/**
|
|
10
|
+
* Consistent Section Spacing Preflight
|
|
11
|
+
*
|
|
12
|
+
* Detects excessive margin/spacing values between UI sections that can cause
|
|
13
|
+
* visual gaps. This enforces consistent spacing standards across the codebase.
|
|
14
|
+
*
|
|
15
|
+
* Common problematic patterns:
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Card className="mb-6"> // Too large - should be mb-3 or mb-4
|
|
18
|
+
* <Tabs>...</Tabs>
|
|
19
|
+
* </Card>
|
|
20
|
+
* <CardSection>...</CardSection>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Correct pattern:
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <Card className="mb-3"> // Consistent with design system
|
|
26
|
+
* <Tabs>...</Tabs>
|
|
27
|
+
* </Card>
|
|
28
|
+
* <CardSection>...</CardSection>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Rules:
|
|
32
|
+
* - Tab navigation containers should use mb-3 or mb-4 max
|
|
33
|
+
* - Cards followed by CardSection should use mb-3 or smaller
|
|
34
|
+
* - space-y-* containers should use space-y-3 or space-y-4 max
|
|
35
|
+
*/
|
|
36
|
+
const fs_1 = __importDefault(require("fs"));
|
|
37
|
+
const path_1 = __importDefault(require("path"));
|
|
38
|
+
const glob_1 = require("glob");
|
|
39
|
+
const console_chars_1 = require("../../utils/console-chars");
|
|
40
|
+
// METADATA - Required for plugin loader discovery
|
|
41
|
+
exports.id = "ui/consistent-section-spacing";
|
|
42
|
+
exports.name = "Consistent Section Spacing";
|
|
43
|
+
exports.description = "Detects excessive margin/spacing values between UI sections";
|
|
44
|
+
exports.category = "ui";
|
|
45
|
+
exports.blocking = false; // Warning level - requires review
|
|
46
|
+
exports.tags = ["ui", "spacing", "tailwind", "layout", "margins"];
|
|
47
|
+
/**
|
|
48
|
+
* File patterns to check
|
|
49
|
+
*/
|
|
50
|
+
const FILE_PATTERNS = [
|
|
51
|
+
"app/**/*.tsx",
|
|
52
|
+
"components/**/*.tsx",
|
|
53
|
+
];
|
|
54
|
+
/**
|
|
55
|
+
* Files/directories to exclude
|
|
56
|
+
*/
|
|
57
|
+
const EXCLUDE_PATTERNS = [
|
|
58
|
+
"node_modules/**",
|
|
59
|
+
"**/*.test.tsx",
|
|
60
|
+
"**/*.spec.tsx",
|
|
61
|
+
"**/*.stories.tsx",
|
|
62
|
+
".storybook/**",
|
|
63
|
+
];
|
|
64
|
+
/**
|
|
65
|
+
* Patterns that indicate excessive spacing
|
|
66
|
+
* [pattern, description, suggestion, context-check]
|
|
67
|
+
*/
|
|
68
|
+
const EXCESSIVE_SPACING_PATTERNS = [
|
|
69
|
+
{
|
|
70
|
+
// Card with mb-6 or larger followed by content
|
|
71
|
+
pattern: /<Card\s+className="[^"]*\bmb-[6-9]\b[^"]*"/g,
|
|
72
|
+
description: "Card with mb-6 or larger margin - may cause excessive gap",
|
|
73
|
+
suggestion: "Consider using mb-3 or mb-4 for tighter section spacing",
|
|
74
|
+
contextCheck: (content, position) => {
|
|
75
|
+
// Check if this Card contains Tabs (common pattern)
|
|
76
|
+
const after = content.substring(position, Math.min(content.length, position + 300));
|
|
77
|
+
return /<Tabs\b/.test(after);
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
// Box/div with mb-6 or larger
|
|
82
|
+
pattern: /<(?:Box|div)\s+className="[^"]*\bmb-[6-9]\b[^"]*">/g,
|
|
83
|
+
description: "Container with mb-6 or larger margin",
|
|
84
|
+
suggestion: "Consider using mb-3 or mb-4 for consistent section spacing",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
// space-y-6 or larger on admin pages
|
|
88
|
+
pattern: /className="[^"]*\bspace-y-[6-9]\b[^"]*"/g,
|
|
89
|
+
description: "Container with space-y-6 or larger - may cause gaps between children",
|
|
90
|
+
suggestion: "Consider using space-y-3 or space-y-4 for tighter layout",
|
|
91
|
+
contextCheck: (content, _position) => {
|
|
92
|
+
// Only flag if it's in an admin page or component
|
|
93
|
+
return /\/admin\//.test(content) || /Admin/.test(content);
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
// mb-10 or larger (almost always too much)
|
|
98
|
+
pattern: /<[A-Z][a-zA-Z]*\s+className="[^"]*\bmb-(?:10|11|12|14|16|20)\b[^"]*"/g,
|
|
99
|
+
description: "Component with very large bottom margin (mb-10+)",
|
|
100
|
+
suggestion: "Large margins are usually a sign of layout issues - consider restructuring",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
// gap-6 or larger in flex/grid containers
|
|
104
|
+
pattern: /className="[^"]*\b(?:flex|grid)[^"]*\bgap-[6-9]\b[^"]*"/g,
|
|
105
|
+
description: "Flex/grid container with gap-6 or larger",
|
|
106
|
+
suggestion: "Consider using gap-3 or gap-4 for tighter element spacing",
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
/**
|
|
110
|
+
* Patterns that indicate this is NOT a spacing issue
|
|
111
|
+
*/
|
|
112
|
+
const FALSE_POSITIVE_PATTERNS = [
|
|
113
|
+
// Page-level wrappers (spacing might be intentional)
|
|
114
|
+
/PageLayout|Layout>/,
|
|
115
|
+
// Main content areas with intentional large spacing
|
|
116
|
+
/main\s+className/,
|
|
117
|
+
// Full page containers
|
|
118
|
+
/className="[^"]*min-h-screen[^"]*"/,
|
|
119
|
+
// Modal/dialog content (often needs more spacing)
|
|
120
|
+
/Modal|Dialog|Sheet/,
|
|
121
|
+
// Hero sections (intentional large spacing)
|
|
122
|
+
/Hero|hero/,
|
|
123
|
+
// Footer areas
|
|
124
|
+
/footer|Footer/,
|
|
125
|
+
];
|
|
126
|
+
/**
|
|
127
|
+
* Extract line number from content and position
|
|
128
|
+
*/
|
|
129
|
+
function getLineNumber(content, position) {
|
|
130
|
+
return content.substring(0, position).split("\n").length;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get surrounding code context
|
|
134
|
+
*/
|
|
135
|
+
function getCodeContext(content, position, lines = 2) {
|
|
136
|
+
const allLines = content.split("\n");
|
|
137
|
+
const lineNum = getLineNumber(content, position);
|
|
138
|
+
const start = Math.max(0, lineNum - 1);
|
|
139
|
+
const end = Math.min(allLines.length, lineNum + lines);
|
|
140
|
+
return allLines.slice(start, end).join("\n").trim();
|
|
141
|
+
}
|
|
142
|
+
async function run() {
|
|
143
|
+
console.log(`\n${console_chars_1.emoji.ruler} CONSISTENT SECTION SPACING CHECK`);
|
|
144
|
+
console.log((0, console_chars_1.createDivider)(65, "heavy"));
|
|
145
|
+
const issues = [];
|
|
146
|
+
// Find all TSX files
|
|
147
|
+
const allFiles = [];
|
|
148
|
+
for (const pattern of FILE_PATTERNS) {
|
|
149
|
+
const matches = await (0, glob_1.glob)(pattern, {
|
|
150
|
+
cwd: process.cwd(),
|
|
151
|
+
ignore: EXCLUDE_PATTERNS,
|
|
152
|
+
});
|
|
153
|
+
allFiles.push(...matches);
|
|
154
|
+
}
|
|
155
|
+
const uniqueFiles = [...new Set(allFiles)];
|
|
156
|
+
console.log(`\n${console_chars_1.emoji.search} Scanning ${uniqueFiles.length} TSX files...`);
|
|
157
|
+
for (const relativePath of uniqueFiles) {
|
|
158
|
+
const filePath = path_1.default.join(process.cwd(), relativePath);
|
|
159
|
+
if (!fs_1.default.existsSync(filePath))
|
|
160
|
+
continue;
|
|
161
|
+
const content = fs_1.default.readFileSync(filePath, "utf-8");
|
|
162
|
+
// Check each excessive spacing pattern
|
|
163
|
+
for (const { pattern, description, suggestion, contextCheck } of EXCESSIVE_SPACING_PATTERNS) {
|
|
164
|
+
let match;
|
|
165
|
+
// Reset regex lastIndex
|
|
166
|
+
pattern.lastIndex = 0;
|
|
167
|
+
while ((match = pattern.exec(content)) !== null) {
|
|
168
|
+
const position = match.index;
|
|
169
|
+
const lineNum = getLineNumber(content, position);
|
|
170
|
+
// Check for preflight-ignore comment
|
|
171
|
+
const nearbyContent = content.substring(Math.max(0, position - 150), position + 50);
|
|
172
|
+
if (/preflight-ignore/.test(nearbyContent)) {
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
// Check for false positive patterns
|
|
176
|
+
const contextArea = content.substring(Math.max(0, position - 200), Math.min(content.length, position + 200));
|
|
177
|
+
const isFalsePositive = FALSE_POSITIVE_PATTERNS.some((fp) => fp.test(contextArea));
|
|
178
|
+
if (isFalsePositive) {
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
// Check context-specific conditions
|
|
182
|
+
if (contextCheck && !contextCheck(content, position)) {
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
issues.push({
|
|
186
|
+
file: relativePath,
|
|
187
|
+
line: lineNum,
|
|
188
|
+
description,
|
|
189
|
+
code: getCodeContext(content, position),
|
|
190
|
+
suggestion,
|
|
191
|
+
severity: "warning",
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// Summary
|
|
197
|
+
console.log(`\n${console_chars_1.emoji.chart} Summary:`);
|
|
198
|
+
console.log(` Files scanned: ${uniqueFiles.length}`);
|
|
199
|
+
console.log(` Spacing issues found: ${issues.length}`);
|
|
200
|
+
if (issues.length === 0) {
|
|
201
|
+
console.log(`\n${console_chars_1.emoji.success} CONSISTENT SECTION SPACING CHECK PASSED`);
|
|
202
|
+
console.log(`\nNo excessive spacing issues detected.`);
|
|
203
|
+
return { success: true, errors: 0, warnings: 0 };
|
|
204
|
+
}
|
|
205
|
+
// Group issues by file
|
|
206
|
+
const issuesByFile = new Map();
|
|
207
|
+
for (const issue of issues) {
|
|
208
|
+
const fileIssues = issuesByFile.get(issue.file) || [];
|
|
209
|
+
fileIssues.push(issue);
|
|
210
|
+
issuesByFile.set(issue.file, fileIssues);
|
|
211
|
+
}
|
|
212
|
+
console.log(`\n${console_chars_1.emoji.warning} Spacing issues found:`);
|
|
213
|
+
for (const [file, fileIssues] of issuesByFile) {
|
|
214
|
+
console.log(`\n ${file}:`);
|
|
215
|
+
for (const issue of fileIssues) {
|
|
216
|
+
console.log(` Line ${issue.line}: ${issue.description}`);
|
|
217
|
+
console.log(` Suggestion: ${issue.suggestion}`);
|
|
218
|
+
console.log(` ${"-".repeat(50)}`);
|
|
219
|
+
const indentedCode = issue.code
|
|
220
|
+
.split("\n")
|
|
221
|
+
.map((line) => ` ${line}`)
|
|
222
|
+
.join("\n");
|
|
223
|
+
console.log(indentedCode);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
console.log(`\n${console_chars_1.emoji.info} Spacing guidelines:`);
|
|
227
|
+
console.log(` - Tab navigation containers: use mb-3 or mb-4`);
|
|
228
|
+
console.log(` - Between Card and CardSection: use mb-3`);
|
|
229
|
+
console.log(` - Parent containers: use space-y-3 or space-y-4`);
|
|
230
|
+
console.log(` - Flex/grid gaps: use gap-3 or gap-4`);
|
|
231
|
+
console.log(` - Add /* preflight-ignore */ comment if large spacing is intentional`);
|
|
232
|
+
console.log(`\n${console_chars_1.emoji.warning} CONSISTENT SECTION SPACING CHECK COMPLETED WITH WARNINGS`);
|
|
233
|
+
return { success: true, errors: 0, warnings: issues.length }; // Non-blocking - requires review
|
|
234
|
+
}
|
|
235
|
+
// Allow direct execution
|
|
236
|
+
if (require.main === module) {
|
|
237
|
+
run()
|
|
238
|
+
.then((result) => {
|
|
239
|
+
process.exit(result.success ? 0 : 1);
|
|
240
|
+
})
|
|
241
|
+
.catch((err) => {
|
|
242
|
+
console.error(`${console_chars_1.emoji.error} Preflight failed:`, err);
|
|
243
|
+
process.exit(1);
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=consistent-section-spacing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consistent-section-spacing.js","sourceRoot":"","sources":["../../../src/checks/ui/consistent-section-spacing.ts"],"names":[],"mappings":";;;;;;;AA6JA,kBAmHC;AA/QD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,4CAAoB;AACpB,gDAAwB;AACxB,+BAA4B;AAE5B,6DAAiE;AAEjE,kDAAkD;AACrC,QAAA,EAAE,GAAG,+BAA+B,CAAC;AACrC,QAAA,IAAI,GAAG,4BAA4B,CAAC;AACpC,QAAA,WAAW,GAAG,6DAA6D,CAAC;AAC5E,QAAA,QAAQ,GAAG,IAAI,CAAC;AAChB,Q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