@empline/preflight 1.1.5 → 1.1.7
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/auth/auth-error-handling.d.ts +18 -0
- package/dist/checks/auth/auth-error-handling.d.ts.map +1 -0
- package/dist/checks/auth/auth-error-handling.js +257 -0
- package/dist/checks/auth/auth-error-handling.js.map +1 -0
- package/dist/checks/turbopack/map-closure-safety.d.ts.map +1 -1
- package/dist/checks/turbopack/map-closure-safety.js +61 -19
- package/dist/checks/turbopack/map-closure-safety.js.map +1 -1
- package/dist/checks/turbopack/nested-property-jsx-access.d.ts +39 -0
- package/dist/checks/turbopack/nested-property-jsx-access.d.ts.map +1 -0
- package/dist/checks/turbopack/nested-property-jsx-access.js +427 -0
- package/dist/checks/turbopack/nested-property-jsx-access.js.map +1 -0
- package/package.json +5 -4
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Error Handling Preflight
|
|
3
|
+
*
|
|
4
|
+
* Detects client components that make authenticated API calls without proper
|
|
5
|
+
* auth error handling. This prevents confusing "Seller account required" or
|
|
6
|
+
* similar errors when the session has expired but the UI still shows as logged in.
|
|
7
|
+
*
|
|
8
|
+
* What it checks:
|
|
9
|
+
* 1. Client components using fetch() to /api/store/* endpoints
|
|
10
|
+
* 2. Whether they use authFetch or have explicit auth error handling
|
|
11
|
+
* 3. Flags components that may show confusing errors on stale sessions
|
|
12
|
+
*
|
|
13
|
+
* Fix:
|
|
14
|
+
* Replace `fetch("/api/store/...")` with `authFetch("/api/store/...")`
|
|
15
|
+
* from "@/lib/auth-fetch"
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=auth-error-handling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-error-handling.d.ts","sourceRoot":"","sources":["../../../src/checks/auth/auth-error-handling.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Auth Error Handling Preflight
|
|
4
|
+
*
|
|
5
|
+
* Detects client components that make authenticated API calls without proper
|
|
6
|
+
* auth error handling. This prevents confusing "Seller account required" or
|
|
7
|
+
* similar errors when the session has expired but the UI still shows as logged in.
|
|
8
|
+
*
|
|
9
|
+
* What it checks:
|
|
10
|
+
* 1. Client components using fetch() to /api/store/* endpoints
|
|
11
|
+
* 2. Whether they use authFetch or have explicit auth error handling
|
|
12
|
+
* 3. Flags components that may show confusing errors on stale sessions
|
|
13
|
+
*
|
|
14
|
+
* Fix:
|
|
15
|
+
* Replace `fetch("/api/store/...")` with `authFetch("/api/store/...")`
|
|
16
|
+
* from "@/lib/auth-fetch"
|
|
17
|
+
*/
|
|
18
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
21
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
22
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
23
|
+
}
|
|
24
|
+
Object.defineProperty(o, k2, desc);
|
|
25
|
+
}) : (function(o, m, k, k2) {
|
|
26
|
+
if (k2 === undefined) k2 = k;
|
|
27
|
+
o[k2] = m[k];
|
|
28
|
+
}));
|
|
29
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
30
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
31
|
+
}) : function(o, v) {
|
|
32
|
+
o["default"] = v;
|
|
33
|
+
});
|
|
34
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
35
|
+
var ownKeys = function(o) {
|
|
36
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
37
|
+
var ar = [];
|
|
38
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
39
|
+
return ar;
|
|
40
|
+
};
|
|
41
|
+
return ownKeys(o);
|
|
42
|
+
};
|
|
43
|
+
return function (mod) {
|
|
44
|
+
if (mod && mod.__esModule) return mod;
|
|
45
|
+
var result = {};
|
|
46
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
47
|
+
__setModuleDefault(result, mod);
|
|
48
|
+
return result;
|
|
49
|
+
};
|
|
50
|
+
})();
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
const fs = __importStar(require("fs"));
|
|
53
|
+
const path = __importStar(require("path"));
|
|
54
|
+
// Direct execution - parse args manually
|
|
55
|
+
const args = process.argv.slice(2);
|
|
56
|
+
const jsonOutput = args.includes("--json");
|
|
57
|
+
const showAll = args.includes("--all");
|
|
58
|
+
/** Protected API prefixes that require authentication */
|
|
59
|
+
const PROTECTED_API_PREFIXES = [
|
|
60
|
+
"/api/store/",
|
|
61
|
+
"/api/admin/",
|
|
62
|
+
"/api/seller/",
|
|
63
|
+
"/api/account/",
|
|
64
|
+
"/api/listings/bulk",
|
|
65
|
+
"/api/listings/save",
|
|
66
|
+
"/api/listings/submit",
|
|
67
|
+
"/api/listings/create",
|
|
68
|
+
"/api/listings/delete",
|
|
69
|
+
"/api/listings/load",
|
|
70
|
+
];
|
|
71
|
+
/** Files/patterns to skip */
|
|
72
|
+
const SKIP_PATTERNS = [
|
|
73
|
+
"node_modules",
|
|
74
|
+
".next",
|
|
75
|
+
"dist",
|
|
76
|
+
".test.",
|
|
77
|
+
".spec.",
|
|
78
|
+
"__tests__",
|
|
79
|
+
"__mocks__",
|
|
80
|
+
];
|
|
81
|
+
function shouldSkipFile(filePath) {
|
|
82
|
+
return SKIP_PATTERNS.some((pattern) => filePath.includes(pattern));
|
|
83
|
+
}
|
|
84
|
+
function isClientComponent(content) {
|
|
85
|
+
return content.trimStart().startsWith('"use client"') ||
|
|
86
|
+
content.trimStart().startsWith("'use client'");
|
|
87
|
+
}
|
|
88
|
+
function isProtectedEndpoint(endpoint) {
|
|
89
|
+
return PROTECTED_API_PREFIXES.some((prefix) => endpoint.includes(prefix));
|
|
90
|
+
}
|
|
91
|
+
function hasAuthFetchImport(content) {
|
|
92
|
+
return content.includes("from \"@/lib/auth-fetch\"") ||
|
|
93
|
+
content.includes("from '@/lib/auth-fetch'") ||
|
|
94
|
+
content.includes("authFetch");
|
|
95
|
+
}
|
|
96
|
+
function hasExplicitAuthHandling(content, lineIndex) {
|
|
97
|
+
// Check if there's auth error handling within ~30 lines after the fetch
|
|
98
|
+
const lines = content.split("\n");
|
|
99
|
+
const contextLines = lines.slice(lineIndex, lineIndex + 30).join("\n").toLowerCase();
|
|
100
|
+
// Patterns that indicate auth error handling
|
|
101
|
+
const authHandlingPatterns = [
|
|
102
|
+
"401",
|
|
103
|
+
"403",
|
|
104
|
+
"unauthorized",
|
|
105
|
+
"forbidden",
|
|
106
|
+
"session",
|
|
107
|
+
"signin",
|
|
108
|
+
"signout",
|
|
109
|
+
"login",
|
|
110
|
+
"logout",
|
|
111
|
+
"redirect",
|
|
112
|
+
"onunauthorized",
|
|
113
|
+
"onforbidden",
|
|
114
|
+
"handleapierror",
|
|
115
|
+
];
|
|
116
|
+
return authHandlingPatterns.some((pattern) => contextLines.includes(pattern));
|
|
117
|
+
}
|
|
118
|
+
function extractEndpoint(line) {
|
|
119
|
+
// Match fetch("/api/...") or fetch('/api/...')
|
|
120
|
+
const match = line.match(/fetch\s*\(\s*["'`](\/api[^"'`]+)["'`]/);
|
|
121
|
+
if (match) {
|
|
122
|
+
return match[1] || null;
|
|
123
|
+
}
|
|
124
|
+
// Match fetch(url) where url contains /api/
|
|
125
|
+
if (line.includes("fetch") && line.includes("/api/")) {
|
|
126
|
+
const apiMatch = line.match(/["'`](\/api[^"'`]+)["'`]/);
|
|
127
|
+
return apiMatch?.[1] || "/api/... (dynamic)";
|
|
128
|
+
}
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
function scanFile(filePath) {
|
|
132
|
+
const issues = [];
|
|
133
|
+
try {
|
|
134
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
135
|
+
// Only check client components
|
|
136
|
+
if (!isClientComponent(content)) {
|
|
137
|
+
return issues;
|
|
138
|
+
}
|
|
139
|
+
// If the file already uses authFetch, it's good
|
|
140
|
+
if (hasAuthFetchImport(content)) {
|
|
141
|
+
return issues;
|
|
142
|
+
}
|
|
143
|
+
const lines = content.split("\n");
|
|
144
|
+
for (let i = 0; i < lines.length; i++) {
|
|
145
|
+
const line = lines[i] || "";
|
|
146
|
+
// Skip comments
|
|
147
|
+
if (line.trim().startsWith("//") || line.trim().startsWith("*")) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
// Check for fetch calls
|
|
151
|
+
if (line.includes("fetch(") || line.includes("fetch (")) {
|
|
152
|
+
const endpoint = extractEndpoint(line);
|
|
153
|
+
if (endpoint && isProtectedEndpoint(endpoint)) {
|
|
154
|
+
// Check if there's explicit auth handling nearby
|
|
155
|
+
if (!hasExplicitAuthHandling(content, i)) {
|
|
156
|
+
issues.push({
|
|
157
|
+
file: filePath,
|
|
158
|
+
line: i + 1,
|
|
159
|
+
endpoint,
|
|
160
|
+
severity: "warning",
|
|
161
|
+
message: `Unprotected fetch to authenticated endpoint. Use authFetch from "@/lib/auth-fetch" to handle stale session errors.`,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
// Skip files that can't be read
|
|
170
|
+
}
|
|
171
|
+
return issues;
|
|
172
|
+
}
|
|
173
|
+
function findClientComponents(dir) {
|
|
174
|
+
const files = [];
|
|
175
|
+
function walk(directory) {
|
|
176
|
+
try {
|
|
177
|
+
const entries = fs.readdirSync(directory, { withFileTypes: true });
|
|
178
|
+
for (const entry of entries) {
|
|
179
|
+
const fullPath = path.join(directory, entry.name);
|
|
180
|
+
if (shouldSkipFile(fullPath)) {
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (entry.isDirectory()) {
|
|
184
|
+
walk(fullPath);
|
|
185
|
+
}
|
|
186
|
+
else if (entry.isFile() && /\.(tsx?|jsx?)$/.test(entry.name)) {
|
|
187
|
+
files.push(fullPath);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
// Skip directories that can't be read
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
walk(dir);
|
|
196
|
+
return files;
|
|
197
|
+
}
|
|
198
|
+
function main() {
|
|
199
|
+
const projectRoot = process.cwd();
|
|
200
|
+
const scanDirs = ["app", "components", "lib"].map((d) => path.join(projectRoot, d));
|
|
201
|
+
let allFiles = [];
|
|
202
|
+
for (const dir of scanDirs) {
|
|
203
|
+
if (fs.existsSync(dir)) {
|
|
204
|
+
allFiles = allFiles.concat(findClientComponents(dir));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const allIssues = [];
|
|
208
|
+
for (const file of allFiles) {
|
|
209
|
+
const issues = scanFile(file);
|
|
210
|
+
allIssues.push(...issues);
|
|
211
|
+
}
|
|
212
|
+
// Output results
|
|
213
|
+
if (jsonOutput) {
|
|
214
|
+
console.log(JSON.stringify(allIssues, null, 2));
|
|
215
|
+
process.exit(allIssues.length > 0 ? 1 : 0);
|
|
216
|
+
}
|
|
217
|
+
// Human-readable output
|
|
218
|
+
console.log("");
|
|
219
|
+
console.log("🔐 Auth Error Handling Preflight");
|
|
220
|
+
console.log("━".repeat(50));
|
|
221
|
+
if (allIssues.length === 0) {
|
|
222
|
+
console.log("✅ No issues found. All authenticated endpoints are properly protected.");
|
|
223
|
+
process.exit(0);
|
|
224
|
+
}
|
|
225
|
+
console.log(`⚠️ Found ${allIssues.length} unprotected authenticated API calls\n`);
|
|
226
|
+
// Group by file
|
|
227
|
+
const byFile = new Map();
|
|
228
|
+
for (const issue of allIssues) {
|
|
229
|
+
const relativePath = path.relative(projectRoot, issue.file);
|
|
230
|
+
if (!byFile.has(relativePath)) {
|
|
231
|
+
byFile.set(relativePath, []);
|
|
232
|
+
}
|
|
233
|
+
byFile.get(relativePath).push(issue);
|
|
234
|
+
}
|
|
235
|
+
// Display (limit to 10 files unless --all)
|
|
236
|
+
const entries = [...byFile.entries()];
|
|
237
|
+
const displayEntries = showAll ? entries : entries.slice(0, 10);
|
|
238
|
+
for (const [file, issues] of displayEntries) {
|
|
239
|
+
console.log(`📁 ${file}`);
|
|
240
|
+
for (const issue of issues) {
|
|
241
|
+
console.log(` Line ${issue.line}: ${issue.endpoint}`);
|
|
242
|
+
}
|
|
243
|
+
console.log("");
|
|
244
|
+
}
|
|
245
|
+
if (!showAll && entries.length > 10) {
|
|
246
|
+
console.log(` ... and ${entries.length - 10} more files`);
|
|
247
|
+
console.log(` Use --all to see all issues`);
|
|
248
|
+
console.log("");
|
|
249
|
+
}
|
|
250
|
+
console.log("━".repeat(50));
|
|
251
|
+
console.log(`\n🔧 Fix: Replace fetch("/api/store/...") with authFetch("/api/store/...")`);
|
|
252
|
+
console.log(` Import: import { authFetch } from "@/lib/auth-fetch";`);
|
|
253
|
+
console.log("");
|
|
254
|
+
process.exit(1);
|
|
255
|
+
}
|
|
256
|
+
main();
|
|
257
|
+
//# sourceMappingURL=auth-error-handling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-error-handling.js","sourceRoot":"","sources":["../../../src/checks/auth/auth-error-handling.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAE7B,yCAAyC;AACzC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAA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,CAAC,0DAA0D,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-closure-safety.d.ts","sourceRoot":"","sources":["../../../src/checks/turbopack/map-closure-safety.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AASH,eAAO,MAAM,EAAE,iCAAiC,CAAC;AACjD,eAAO,MAAM,IAAI,iCAAiC,CAAC;AACnD,eAAO,MAAM,QAAQ,cAAc,CAAC;AACpC,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAC9B,eAAO,MAAM,WAAW,gEAAgE,CAAC;AACzF,eAAO,MAAM,IAAI,UAA6C,CAAC;AAC/D,eAAO,MAAM,QAAQ,OAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"map-closure-safety.d.ts","sourceRoot":"","sources":["../../../src/checks/turbopack/map-closure-safety.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AASH,eAAO,MAAM,EAAE,iCAAiC,CAAC;AACjD,eAAO,MAAM,IAAI,iCAAiC,CAAC;AACnD,eAAO,MAAM,QAAQ,cAAc,CAAC;AACpC,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAC9B,eAAO,MAAM,WAAW,gEAAgE,CAAC;AACzF,eAAO,MAAM,IAAI,UAA6C,CAAC;AAC/D,eAAO,MAAM,QAAQ,OAAK,CAAC;AA4J3B,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAiHzC"}
|
|
@@ -85,20 +85,28 @@ const EXCLUDED = (0, glob_patterns_1.extendExcludes)(glob_patterns_1.STANDARD_EX
|
|
|
85
85
|
/**
|
|
86
86
|
* Detects risky patterns in .map() callbacks where:
|
|
87
87
|
* 1. The callback uses parentheses (implicit return) instead of braces
|
|
88
|
-
* 2.
|
|
88
|
+
* 2. Any property accesses on the mapped item in JSX
|
|
89
89
|
*
|
|
90
90
|
* These patterns are prone to Turbopack closure issues.
|
|
91
|
+
*
|
|
92
|
+
* NOTE: Only client components are affected. Server components and
|
|
93
|
+
* object literal returns (data transformations) are safe.
|
|
91
94
|
*/
|
|
92
95
|
function checkFile(filePath, content) {
|
|
93
96
|
const issues = [];
|
|
94
97
|
const lines = content.split("\n");
|
|
98
|
+
// Skip server components - only client components are affected by Turbopack closure issues
|
|
99
|
+
if (!content.includes('"use client"') && !content.includes("'use client'")) {
|
|
100
|
+
return issues;
|
|
101
|
+
}
|
|
95
102
|
// Pattern: .map((paramName) => (
|
|
96
|
-
// This is the risky implicit return pattern
|
|
103
|
+
// This is the risky implicit return pattern - catches ALL implicit return maps
|
|
97
104
|
const mapImplicitReturnPattern = /\.map\s*\(\s*\((\w+)\)\s*=>\s*\(/g;
|
|
98
105
|
let match;
|
|
99
106
|
while ((match = mapImplicitReturnPattern.exec(content)) !== null) {
|
|
100
107
|
const paramName = match[1];
|
|
101
108
|
const mapStartIndex = match.index;
|
|
109
|
+
const matchEnd = match.index + match[0].length;
|
|
102
110
|
// Find the line number
|
|
103
111
|
let lineNumber = 1;
|
|
104
112
|
let charCount = 0;
|
|
@@ -109,21 +117,45 @@ function checkFile(filePath, content) {
|
|
|
109
117
|
break;
|
|
110
118
|
}
|
|
111
119
|
}
|
|
120
|
+
// Look ahead to check if this is an object literal return (data transformation)
|
|
121
|
+
// Object literal maps start with ({ not (<
|
|
122
|
+
const afterParen = content.substring(matchEnd, matchEnd + 50).trim();
|
|
123
|
+
if (afterParen.startsWith("{")) {
|
|
124
|
+
// This is returning an object literal like .map((item) => ({ ... }))
|
|
125
|
+
// These are safe - they're data transformations, not JSX
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
// Also skip ternary state-update patterns like:
|
|
129
|
+
// .map((item) => (item.id === id ? { ...item, updated } : item))
|
|
130
|
+
// These are object transforms, not JSX rendering
|
|
131
|
+
const ternaryStatePattern = new RegExp(`^${paramName}\\.\\w+\\s*===.*\\?.*\\{.*\\.\\.\\.${paramName}`);
|
|
132
|
+
if (ternaryStatePattern.test(afterParen)) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
112
135
|
// Look ahead to find property accesses on the param in JSX
|
|
113
|
-
// We'll check
|
|
136
|
+
// We'll check to find the matching closing paren
|
|
114
137
|
const searchEndIndex = Math.min(content.length, mapStartIndex + 5000);
|
|
115
138
|
const mapBlock = content.substring(mapStartIndex, searchEndIndex);
|
|
116
|
-
// Count property accesses
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
139
|
+
// Count property accesses with underscores (high-risk DB fields that Turbopack mangles)
|
|
140
|
+
const underscoreAccessPattern = new RegExp(`\\b${paramName}\\.(\\w+_\\w+|stock_quantity|linked\\w+|created\\w+|updated\\w+)`, "g");
|
|
141
|
+
const underscoreMatches = mapBlock.match(underscoreAccessPattern) || [];
|
|
142
|
+
// Count all property accesses
|
|
143
|
+
const allPropertyPattern = new RegExp(`\\b${paramName}\\.\\w+`, "g");
|
|
144
|
+
const allMatches = mapBlock.match(allPropertyPattern) || [];
|
|
145
|
+
// Flag as warning if:
|
|
146
|
+
// 1. Any underscore properties are accessed (high risk), OR
|
|
147
|
+
// 2. 4+ total property accesses (complex pattern that may hit issues)
|
|
148
|
+
const isHighRisk = underscoreMatches.length >= 1 || allMatches.length >= 4;
|
|
149
|
+
if (isHighRisk) {
|
|
150
|
+
const uniqueProps = [...new Set(allMatches.map(m => m.replace(`${paramName}.`, '')))];
|
|
151
|
+
const hasUnderscores = underscoreMatches.length > 0;
|
|
122
152
|
issues.push({
|
|
123
153
|
file: filePath,
|
|
124
154
|
line: lineNumber,
|
|
125
155
|
severity: "warning",
|
|
126
|
-
message:
|
|
156
|
+
message: hasUnderscores
|
|
157
|
+
? `Map callback accesses underscore properties on '${paramName}': ${uniqueProps.slice(0, 3).join(', ')}${uniqueProps.length > 3 ? '...' : ''}`
|
|
158
|
+
: `Map callback with ${allMatches.length} property accesses on '${paramName}'`,
|
|
127
159
|
suggestion: `Convert to block syntax { } and extract properties: const ${paramName}Prop = ${paramName}.prop;`,
|
|
128
160
|
snippet: lines[lineNumber - 1]?.trim().substring(0, 80),
|
|
129
161
|
paramName,
|
|
@@ -148,9 +180,9 @@ function checkFile(filePath, content) {
|
|
|
148
180
|
issues.push({
|
|
149
181
|
file: filePath,
|
|
150
182
|
line: lineNumber,
|
|
151
|
-
severity: "
|
|
152
|
-
message: `
|
|
153
|
-
suggestion: `
|
|
183
|
+
severity: "warning",
|
|
184
|
+
message: `Map with nullish coalescing/logical operators on '${paramName}' - highly likely to cause Turbopack issues`,
|
|
185
|
+
suggestion: `Convert to block syntax and extract: const value = ${paramName}.prop ?? default; before JSX`,
|
|
154
186
|
snippet: lines[lineNumber - 1]?.trim().substring(0, 80),
|
|
155
187
|
paramName,
|
|
156
188
|
});
|
|
@@ -170,8 +202,11 @@ async function run() {
|
|
|
170
202
|
const args = process.argv.slice(2);
|
|
171
203
|
const verbose = args.includes("--verbose") || args.includes("-v");
|
|
172
204
|
const strict = args.includes("--strict") || args.includes("-s");
|
|
173
|
-
|
|
174
|
-
|
|
205
|
+
const jsonOutput = args.includes("--json");
|
|
206
|
+
if (!jsonOutput) {
|
|
207
|
+
console.log(`\n${console_chars_1.emoji.palette} Turbopack Map Closure Safety Preflight`);
|
|
208
|
+
console.log((0, console_chars_1.createDivider)(80, "heavy"));
|
|
209
|
+
}
|
|
175
210
|
const startTime = Date.now();
|
|
176
211
|
const allIssues = [];
|
|
177
212
|
// Find all component files
|
|
@@ -193,11 +228,16 @@ async function run() {
|
|
|
193
228
|
}
|
|
194
229
|
}
|
|
195
230
|
const duration = Date.now() - startTime;
|
|
231
|
+
const warnings = allIssues.filter((i) => i.severity === "warning");
|
|
232
|
+
// JSON output mode - output raw JSON and exit
|
|
233
|
+
if (jsonOutput) {
|
|
234
|
+
console.log(JSON.stringify(warnings, null, 2));
|
|
235
|
+
process.exit(strict && warnings.length > 0 ? 1 : 0);
|
|
236
|
+
}
|
|
196
237
|
// Report results
|
|
197
238
|
console.log(`\n${console_chars_1.emoji.chart} Scan Summary:`);
|
|
198
239
|
console.log(` Files scanned: ${filesScanned}`);
|
|
199
240
|
console.log(` Duration: ${duration}ms`);
|
|
200
|
-
const warnings = allIssues.filter((i) => i.severity === "warning");
|
|
201
241
|
const infos = allIssues.filter((i) => i.severity === "info");
|
|
202
242
|
if (allIssues.length === 0) {
|
|
203
243
|
console.log(`\n${console_chars_1.emoji.success} No risky map closure patterns detected`);
|
|
@@ -210,7 +250,9 @@ async function run() {
|
|
|
210
250
|
if (warnings.length > 0) {
|
|
211
251
|
console.log(`\n${console_chars_1.emoji.warning} WARNINGS (may cause Turbopack runtime errors):`);
|
|
212
252
|
console.log((0, console_chars_1.createDivider)(60, "light"));
|
|
213
|
-
|
|
253
|
+
const showAll = args.includes("--all");
|
|
254
|
+
const limit = showAll ? warnings.length : (verbose ? 20 : 5);
|
|
255
|
+
for (const issue of warnings.slice(0, limit)) {
|
|
214
256
|
console.log(` ${issue.file}:${issue.line}`);
|
|
215
257
|
console.log(` ${issue.message}`);
|
|
216
258
|
console.log(` ${console_chars_1.emoji.hint} ${issue.suggestion}`);
|
|
@@ -219,8 +261,8 @@ async function run() {
|
|
|
219
261
|
}
|
|
220
262
|
console.log("");
|
|
221
263
|
}
|
|
222
|
-
if (warnings.length >
|
|
223
|
-
console.log(` ... and ${warnings.length -
|
|
264
|
+
if (warnings.length > limit) {
|
|
265
|
+
console.log(` ... and ${warnings.length - limit} more`);
|
|
224
266
|
}
|
|
225
267
|
}
|
|
226
268
|
if (verbose && infos.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-closure-safety.js","sourceRoot":"","sources":["../../../src/checks/turbopack/map-closure-safety.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;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Detects patterns that cause Turbopack closure bugs where deeply nested
|
|
6
|
+
* property access in JSX props gets mangled (e.g., `filters.filters.status`
|
|
7
|
+
* becomes `_filters_filters_status` and fails at runtime).
|
|
8
|
+
*
|
|
9
|
+
* Problem Pattern:
|
|
10
|
+
* <Component
|
|
11
|
+
* prop={obj.nested.value ?? "default"} // Turbopack mangles this
|
|
12
|
+
* />
|
|
13
|
+
*
|
|
14
|
+
* Safe Pattern:
|
|
15
|
+
* const nestedValue = obj.nested.value;
|
|
16
|
+
* return (
|
|
17
|
+
* <Component
|
|
18
|
+
* prop={nestedValue ?? "default"} // Use extracted variable
|
|
19
|
+
* />
|
|
20
|
+
* );
|
|
21
|
+
*
|
|
22
|
+
* Why this matters:
|
|
23
|
+
* - Turbopack's closure capture can break with nested property access
|
|
24
|
+
* - Results in runtime ReferenceError: _obj_nested_value is not defined
|
|
25
|
+
* - Affects development builds with Turbopack, may work in production webpack
|
|
26
|
+
*
|
|
27
|
+
* Usage:
|
|
28
|
+
* pnpm preflight turbopack/nested-property-jsx-access
|
|
29
|
+
* pnpm preflight turbopack/nested-property-jsx-access --verbose
|
|
30
|
+
*/
|
|
31
|
+
export declare const id = "turbopack/nested-property-jsx-access";
|
|
32
|
+
export declare const name = "Turbopack Nested Property JSX Access";
|
|
33
|
+
export declare const category = "turbopack";
|
|
34
|
+
export declare const blocking = false;
|
|
35
|
+
export declare const description = "Detects deeply nested property access in JSX props that may cause Turbopack closure bugs";
|
|
36
|
+
export declare const tags: string[];
|
|
37
|
+
export declare const requires: any[];
|
|
38
|
+
export declare function run(): Promise<void>;
|
|
39
|
+
//# sourceMappingURL=nested-property-jsx-access.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nested-property-jsx-access.d.ts","sourceRoot":"","sources":["../../../src/checks/turbopack/nested-property-jsx-access.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AASH,eAAO,MAAM,EAAE,yCAAyC,CAAC;AACzD,eAAO,MAAM,IAAI,yCAAyC,CAAC;AAC3D,eAAO,MAAM,QAAQ,cAAc,CAAC;AACpC,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAC9B,eAAO,MAAM,WAAW,6FAA6F,CAAC;AACtH,eAAO,MAAM,IAAI,UAAsD,CAAC;AACxE,eAAO,MAAM,QAAQ,OAAK,CAAC;AAyQ3B,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAwHzC"}
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Turbopack Nested Property JSX Access Preflight (BLOCKING)
|
|
5
|
+
*
|
|
6
|
+
* Detects patterns that cause Turbopack closure bugs where deeply nested
|
|
7
|
+
* property access in JSX props gets mangled (e.g., `filters.filters.status`
|
|
8
|
+
* becomes `_filters_filters_status` and fails at runtime).
|
|
9
|
+
*
|
|
10
|
+
* Problem Pattern:
|
|
11
|
+
* <Component
|
|
12
|
+
* prop={obj.nested.value ?? "default"} // Turbopack mangles this
|
|
13
|
+
* />
|
|
14
|
+
*
|
|
15
|
+
* Safe Pattern:
|
|
16
|
+
* const nestedValue = obj.nested.value;
|
|
17
|
+
* return (
|
|
18
|
+
* <Component
|
|
19
|
+
* prop={nestedValue ?? "default"} // Use extracted variable
|
|
20
|
+
* />
|
|
21
|
+
* );
|
|
22
|
+
*
|
|
23
|
+
* Why this matters:
|
|
24
|
+
* - Turbopack's closure capture can break with nested property access
|
|
25
|
+
* - Results in runtime ReferenceError: _obj_nested_value is not defined
|
|
26
|
+
* - Affects development builds with Turbopack, may work in production webpack
|
|
27
|
+
*
|
|
28
|
+
* Usage:
|
|
29
|
+
* pnpm preflight turbopack/nested-property-jsx-access
|
|
30
|
+
* pnpm preflight turbopack/nested-property-jsx-access --verbose
|
|
31
|
+
*/
|
|
32
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
33
|
+
if (k2 === undefined) k2 = k;
|
|
34
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
35
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
36
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
37
|
+
}
|
|
38
|
+
Object.defineProperty(o, k2, desc);
|
|
39
|
+
}) : (function(o, m, k, k2) {
|
|
40
|
+
if (k2 === undefined) k2 = k;
|
|
41
|
+
o[k2] = m[k];
|
|
42
|
+
}));
|
|
43
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
44
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
45
|
+
}) : function(o, v) {
|
|
46
|
+
o["default"] = v;
|
|
47
|
+
});
|
|
48
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
49
|
+
var ownKeys = function(o) {
|
|
50
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
51
|
+
var ar = [];
|
|
52
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
53
|
+
return ar;
|
|
54
|
+
};
|
|
55
|
+
return ownKeys(o);
|
|
56
|
+
};
|
|
57
|
+
return function (mod) {
|
|
58
|
+
if (mod && mod.__esModule) return mod;
|
|
59
|
+
var result = {};
|
|
60
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
61
|
+
__setModuleDefault(result, mod);
|
|
62
|
+
return result;
|
|
63
|
+
};
|
|
64
|
+
})();
|
|
65
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
+
exports.requires = exports.tags = exports.description = exports.blocking = exports.category = exports.name = exports.id = void 0;
|
|
67
|
+
exports.run = run;
|
|
68
|
+
const fs = __importStar(require("fs"));
|
|
69
|
+
const file_cache_1 = require("../../shared/file-cache");
|
|
70
|
+
const glob_patterns_1 = require("../../shared/glob-patterns");
|
|
71
|
+
const console_chars_1 = require("../../utils/console-chars");
|
|
72
|
+
const universal_progress_reporter_1 = require("../system/universal-progress-reporter");
|
|
73
|
+
// Check metadata
|
|
74
|
+
exports.id = "turbopack/nested-property-jsx-access";
|
|
75
|
+
exports.name = "Turbopack Nested Property JSX Access";
|
|
76
|
+
exports.category = "turbopack";
|
|
77
|
+
exports.blocking = false; // Advisory for now - many false positives for common patterns
|
|
78
|
+
exports.description = "Detects deeply nested property access in JSX props that may cause Turbopack closure bugs";
|
|
79
|
+
exports.tags = ["turbopack", "runtime", "closure", "jsx", "props"];
|
|
80
|
+
exports.requires = [];
|
|
81
|
+
// Common safe patterns that don't cause Turbopack issues
|
|
82
|
+
const SAFE_IDENTIFIER_PREFIXES = [
|
|
83
|
+
"process", "window", "document", "console", "Math", "Object", "Array",
|
|
84
|
+
"Date", "JSON", "String", "Number", "Boolean", "Error", "Promise",
|
|
85
|
+
"require", "import", "module", "exports",
|
|
86
|
+
];
|
|
87
|
+
// Common safe second-level properties (e.g., session.user, listing.card)
|
|
88
|
+
const SAFE_PROPERTY_CHAINS = [
|
|
89
|
+
// Auth/session patterns
|
|
90
|
+
"session.user",
|
|
91
|
+
"auth.user",
|
|
92
|
+
"user.profile",
|
|
93
|
+
// Common data patterns
|
|
94
|
+
"listing.card",
|
|
95
|
+
"card.catalog",
|
|
96
|
+
"item.catalog",
|
|
97
|
+
"result.graded",
|
|
98
|
+
"product.details",
|
|
99
|
+
// Event handlers
|
|
100
|
+
"e.target",
|
|
101
|
+
"event.target",
|
|
102
|
+
"e.currentTarget",
|
|
103
|
+
// React patterns
|
|
104
|
+
"ref.current",
|
|
105
|
+
"props.children",
|
|
106
|
+
// Store/context patterns
|
|
107
|
+
"store.state",
|
|
108
|
+
"context.value",
|
|
109
|
+
// Config patterns
|
|
110
|
+
"config.settings",
|
|
111
|
+
"settings.options",
|
|
112
|
+
];
|
|
113
|
+
const EXCLUDED = (0, glob_patterns_1.extendExcludes)(glob_patterns_1.STANDARD_EXCLUDES, [
|
|
114
|
+
"**/test-results/**",
|
|
115
|
+
"**/*.test.tsx",
|
|
116
|
+
"**/*.spec.tsx",
|
|
117
|
+
"**/*.stories.tsx",
|
|
118
|
+
]);
|
|
119
|
+
/**
|
|
120
|
+
* Detects deeply nested property access in JSX props that can cause
|
|
121
|
+
* Turbopack closure issues:
|
|
122
|
+
*
|
|
123
|
+
* 1. obj.nested.property (3+ levels deep) directly in JSX prop values
|
|
124
|
+
* 2. Same pattern with nullish coalescing/logical operators
|
|
125
|
+
*
|
|
126
|
+
* Only affects client components ("use client" directive).
|
|
127
|
+
*/
|
|
128
|
+
function checkFile(filePath, content) {
|
|
129
|
+
const issues = [];
|
|
130
|
+
const lines = content.split("\n");
|
|
131
|
+
// Skip server components - only client components are affected
|
|
132
|
+
if (!content.includes('"use client"') && !content.includes("'use client'")) {
|
|
133
|
+
return issues;
|
|
134
|
+
}
|
|
135
|
+
// Find all JSX prop assignments with deeply nested property access
|
|
136
|
+
// Pattern: propName={identifier.property.nestedProperty} with optional operators
|
|
137
|
+
// This catches:
|
|
138
|
+
// prop={obj.a.b}
|
|
139
|
+
// prop={obj.a.b ?? "default"}
|
|
140
|
+
// prop={obj.a.b || fallback}
|
|
141
|
+
// prop={obj.a.b && <Component />}
|
|
142
|
+
//
|
|
143
|
+
// The key issue is 3+ level deep access: obj.level1.level2 or deeper
|
|
144
|
+
// Find return statements to focus on JSX areas
|
|
145
|
+
const returnPattern = /\breturn\s*\(/g;
|
|
146
|
+
let returnMatch;
|
|
147
|
+
const jsxRegions = [];
|
|
148
|
+
while ((returnMatch = returnPattern.exec(content)) !== null) {
|
|
149
|
+
const start = returnMatch.index;
|
|
150
|
+
// Find matching closing paren (simplified - count parens)
|
|
151
|
+
let parenDepth = 1;
|
|
152
|
+
let i = start + returnMatch[0].length;
|
|
153
|
+
while (i < content.length && parenDepth > 0) {
|
|
154
|
+
if (content[i] === "(")
|
|
155
|
+
parenDepth++;
|
|
156
|
+
if (content[i] === ")")
|
|
157
|
+
parenDepth--;
|
|
158
|
+
i++;
|
|
159
|
+
}
|
|
160
|
+
jsxRegions.push({ start, end: i });
|
|
161
|
+
}
|
|
162
|
+
// Also check for direct JSX returns without parentheses
|
|
163
|
+
const directReturnPattern = /\breturn\s+<[\w.]+/g;
|
|
164
|
+
while ((returnMatch = directReturnPattern.exec(content)) !== null) {
|
|
165
|
+
const start = returnMatch.index;
|
|
166
|
+
// Find the end of the JSX block (look for next function end or component end)
|
|
167
|
+
let i = start;
|
|
168
|
+
let depth = 0;
|
|
169
|
+
while (i < content.length) {
|
|
170
|
+
if (content[i] === "{")
|
|
171
|
+
depth++;
|
|
172
|
+
if (content[i] === "}") {
|
|
173
|
+
if (depth === 0)
|
|
174
|
+
break;
|
|
175
|
+
depth--;
|
|
176
|
+
}
|
|
177
|
+
if (content[i] === ";" && depth === 0)
|
|
178
|
+
break;
|
|
179
|
+
i++;
|
|
180
|
+
}
|
|
181
|
+
jsxRegions.push({ start, end: i });
|
|
182
|
+
}
|
|
183
|
+
// Pattern for nested property access (3+ levels) in JSX props
|
|
184
|
+
// Matches: identifier.prop1.prop2 or identifier.prop1.prop2.prop3 etc
|
|
185
|
+
// With optional operators: ?? || && ?
|
|
186
|
+
const nestedPropPattern = /\b(\w+)\.(\w+)\.(\w+)(?:\.(\w+))?\s*(?:\?\?|&&|\|\||\?)/g;
|
|
187
|
+
for (const region of jsxRegions) {
|
|
188
|
+
const jsxContent = content.substring(region.start, region.end);
|
|
189
|
+
let match;
|
|
190
|
+
const patternCopy = new RegExp(nestedPropPattern.source, nestedPropPattern.flags);
|
|
191
|
+
while ((match = patternCopy.exec(jsxContent)) !== null) {
|
|
192
|
+
const fullMatch = match[0];
|
|
193
|
+
const identifier = match[1];
|
|
194
|
+
const prop1 = match[2];
|
|
195
|
+
const prop2 = match[3];
|
|
196
|
+
const prop3 = match[4];
|
|
197
|
+
// Skip safe identifier prefixes (built-ins, globals)
|
|
198
|
+
if (SAFE_IDENTIFIER_PREFIXES.includes(identifier))
|
|
199
|
+
continue;
|
|
200
|
+
// Skip safe property chains (common patterns that work fine)
|
|
201
|
+
const propChain = `${identifier}.${prop1}`;
|
|
202
|
+
if (SAFE_PROPERTY_CHAINS.includes(propChain))
|
|
203
|
+
continue;
|
|
204
|
+
// Skip type assertions and type-only patterns
|
|
205
|
+
if (fullMatch.includes(" as "))
|
|
206
|
+
continue;
|
|
207
|
+
// Skip patterns inside arrow function callbacks (e.g., (item) => item.a.b)
|
|
208
|
+
// These are typically in .map/.filter/.find and handled by the other preflight
|
|
209
|
+
const beforeMatch = jsxContent.substring(Math.max(0, match.index - 30), match.index);
|
|
210
|
+
if (/\(\s*\w+\s*\)\s*=>\s*$/.test(beforeMatch) || /=>\s*$/.test(beforeMatch))
|
|
211
|
+
continue;
|
|
212
|
+
// Skip patterns that are inside object literals (data transformations)
|
|
213
|
+
if (/^\s*\w+:\s*$/.test(beforeMatch))
|
|
214
|
+
continue;
|
|
215
|
+
// HIGH PRIORITY: Flag patterns where the identifier is repeated (like filters.filters)
|
|
216
|
+
// These are particularly prone to Turbopack mangling issues
|
|
217
|
+
const isRepeatedIdentifier = identifier === prop1;
|
|
218
|
+
// Calculate absolute position and line number
|
|
219
|
+
const absolutePos = region.start + match.index;
|
|
220
|
+
let lineNumber = 1;
|
|
221
|
+
let charCount = 0;
|
|
222
|
+
for (let i = 0; i < lines.length; i++) {
|
|
223
|
+
charCount += lines[i].length + 1;
|
|
224
|
+
if (charCount > absolutePos) {
|
|
225
|
+
lineNumber = i + 1;
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// Build the full property path for the message
|
|
230
|
+
const propertyPath = prop3
|
|
231
|
+
? `${identifier}.${prop1}.${prop2}.${prop3}`
|
|
232
|
+
: `${identifier}.${prop1}.${prop2}`;
|
|
233
|
+
// Only flag as error if it's a repeated identifier pattern (high risk)
|
|
234
|
+
// Otherwise just warn
|
|
235
|
+
const severity = isRepeatedIdentifier ? "error" : "warning";
|
|
236
|
+
issues.push({
|
|
237
|
+
file: filePath,
|
|
238
|
+
line: lineNumber,
|
|
239
|
+
severity,
|
|
240
|
+
message: isRepeatedIdentifier
|
|
241
|
+
? `HIGH RISK: Repeated identifier '${identifier}.${prop1}' - known Turbopack closure bug`
|
|
242
|
+
: `Deeply nested property access '${propertyPath}' in JSX may cause Turbopack closure issues`,
|
|
243
|
+
suggestion: `Extract to local variable before JSX: const ${prop2} = ${propertyPath};`,
|
|
244
|
+
snippet: lines[lineNumber - 1]?.trim().substring(0, 100),
|
|
245
|
+
pattern: propertyPath,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
// Also check for direct JSX prop assignments with nested access
|
|
250
|
+
// Pattern: propName={obj.nested.value} - even without operators
|
|
251
|
+
// Only flag repeated identifier patterns (like filters.filters.x) as these are high risk
|
|
252
|
+
const directNestedPattern = /\b(\w+)=\{(\w+)\.(\w+)\.(\w+)(?:\.(\w+))?\s*\}/g;
|
|
253
|
+
let directMatch;
|
|
254
|
+
while ((directMatch = directNestedPattern.exec(content)) !== null) {
|
|
255
|
+
const propName = directMatch[1];
|
|
256
|
+
const identifier = directMatch[2];
|
|
257
|
+
const prop1 = directMatch[3];
|
|
258
|
+
const prop2 = directMatch[4];
|
|
259
|
+
const prop3 = directMatch[5];
|
|
260
|
+
// Skip safe identifier prefixes
|
|
261
|
+
if (SAFE_IDENTIFIER_PREFIXES.includes(identifier))
|
|
262
|
+
continue;
|
|
263
|
+
// Skip safe property chains
|
|
264
|
+
const propChain = `${identifier}.${prop1}`;
|
|
265
|
+
if (SAFE_PROPERTY_CHAINS.includes(propChain))
|
|
266
|
+
continue;
|
|
267
|
+
// Skip styles/theme patterns
|
|
268
|
+
if (identifier === "styles" || identifier === "theme")
|
|
269
|
+
continue;
|
|
270
|
+
// Only flag repeated identifier patterns (high risk)
|
|
271
|
+
const isRepeatedIdentifier = identifier === prop1;
|
|
272
|
+
if (!isRepeatedIdentifier)
|
|
273
|
+
continue;
|
|
274
|
+
// Find line number
|
|
275
|
+
let lineNumber = 1;
|
|
276
|
+
let charCount = 0;
|
|
277
|
+
for (let i = 0; i < lines.length; i++) {
|
|
278
|
+
charCount += lines[i].length + 1;
|
|
279
|
+
if (charCount > directMatch.index) {
|
|
280
|
+
lineNumber = i + 1;
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
// Build the full property path
|
|
285
|
+
const propertyPath = prop3
|
|
286
|
+
? `${identifier}.${prop1}.${prop2}.${prop3}`
|
|
287
|
+
: `${identifier}.${prop1}.${prop2}`;
|
|
288
|
+
issues.push({
|
|
289
|
+
file: filePath,
|
|
290
|
+
line: lineNumber,
|
|
291
|
+
severity: "error",
|
|
292
|
+
message: `HIGH RISK: Prop '${propName}' uses repeated identifier pattern '${propertyPath}'`,
|
|
293
|
+
suggestion: `Extract before render: const ${prop2} = ${propertyPath};`,
|
|
294
|
+
snippet: lines[lineNumber - 1]?.trim().substring(0, 100),
|
|
295
|
+
pattern: propertyPath,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
// Dedupe issues by file+line
|
|
299
|
+
const seen = new Set();
|
|
300
|
+
return issues.filter((issue) => {
|
|
301
|
+
const key = `${issue.file}:${issue.line}:${issue.pattern}`;
|
|
302
|
+
if (seen.has(key))
|
|
303
|
+
return false;
|
|
304
|
+
seen.add(key);
|
|
305
|
+
return true;
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
// CACHED FILE LISTS
|
|
309
|
+
let _cachedComponentFiles = null;
|
|
310
|
+
async function getComponentFiles() {
|
|
311
|
+
if (!_cachedComponentFiles) {
|
|
312
|
+
_cachedComponentFiles = await file_cache_1.fileCache.getComponentFiles();
|
|
313
|
+
}
|
|
314
|
+
return _cachedComponentFiles;
|
|
315
|
+
}
|
|
316
|
+
async function run() {
|
|
317
|
+
const reporter = (0, universal_progress_reporter_1.createUniversalProgressReporter)(exports.name);
|
|
318
|
+
const args = process.argv.slice(2);
|
|
319
|
+
const verbose = args.includes("--verbose") || args.includes("-v");
|
|
320
|
+
const strict = args.includes("--strict") || args.includes("-s");
|
|
321
|
+
const jsonOutput = args.includes("--json");
|
|
322
|
+
if (!jsonOutput) {
|
|
323
|
+
console.log(`\n${console_chars_1.emoji.palette} Turbopack Nested Property JSX Access Preflight`);
|
|
324
|
+
console.log((0, console_chars_1.createDivider)(80, "heavy"));
|
|
325
|
+
}
|
|
326
|
+
const startTime = Date.now();
|
|
327
|
+
const allIssues = [];
|
|
328
|
+
// Find all component files
|
|
329
|
+
const files = await getComponentFiles();
|
|
330
|
+
let filesScanned = 0;
|
|
331
|
+
for (const file of files) {
|
|
332
|
+
// Only check TSX files (JSX components)
|
|
333
|
+
if (!file.endsWith(".tsx"))
|
|
334
|
+
continue;
|
|
335
|
+
try {
|
|
336
|
+
const content = fs.readFileSync(file, "utf-8");
|
|
337
|
+
filesScanned++;
|
|
338
|
+
allIssues.push(...checkFile(file, content));
|
|
339
|
+
}
|
|
340
|
+
catch (error) {
|
|
341
|
+
if (verbose) {
|
|
342
|
+
console.error(`${console_chars_1.emoji.warning} Error reading ${file}: ${error.message}`);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
const duration = Date.now() - startTime;
|
|
347
|
+
const errors = allIssues.filter((i) => i.severity === "error");
|
|
348
|
+
const warnings = allIssues.filter((i) => i.severity === "warning");
|
|
349
|
+
// JSON output mode
|
|
350
|
+
if (jsonOutput) {
|
|
351
|
+
console.log(JSON.stringify(allIssues, null, 2));
|
|
352
|
+
process.exit(errors.length > 0 ? 1 : 0);
|
|
353
|
+
}
|
|
354
|
+
// Report results
|
|
355
|
+
console.log(`\n${console_chars_1.emoji.chart} Scan Summary:`);
|
|
356
|
+
console.log(` Files scanned: ${filesScanned}`);
|
|
357
|
+
console.log(` Duration: ${duration}ms`);
|
|
358
|
+
if (allIssues.length === 0) {
|
|
359
|
+
console.log(`\n${console_chars_1.emoji.success} No deeply nested property access patterns detected in JSX`);
|
|
360
|
+
console.log(` All JSX prop values use safe access patterns.`);
|
|
361
|
+
process.exit(0);
|
|
362
|
+
}
|
|
363
|
+
console.log(`\n${console_chars_1.emoji.clipboard} Issues Found:`);
|
|
364
|
+
console.log(` ${console_chars_1.emoji.error} Errors: ${errors.length}`);
|
|
365
|
+
console.log(` ${console_chars_1.emoji.warning} Warnings: ${warnings.length}`);
|
|
366
|
+
if (errors.length > 0) {
|
|
367
|
+
console.log(`\n${console_chars_1.emoji.error} ERRORS (will cause Turbopack runtime errors):`);
|
|
368
|
+
console.log((0, console_chars_1.createDivider)(60, "light"));
|
|
369
|
+
const showAll = args.includes("--all");
|
|
370
|
+
const limit = showAll ? errors.length : (verbose ? 20 : 10);
|
|
371
|
+
for (const issue of errors.slice(0, limit)) {
|
|
372
|
+
console.log(` ${issue.file}:${issue.line}`);
|
|
373
|
+
console.log(` ${issue.message}`);
|
|
374
|
+
console.log(` ${console_chars_1.emoji.hint} ${issue.suggestion}`);
|
|
375
|
+
if (issue.snippet) {
|
|
376
|
+
console.log(` ${console_chars_1.emoji.memo} ${issue.snippet}`);
|
|
377
|
+
}
|
|
378
|
+
console.log("");
|
|
379
|
+
}
|
|
380
|
+
if (errors.length > limit) {
|
|
381
|
+
console.log(` ... and ${errors.length - limit} more`);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (verbose && warnings.length > 0) {
|
|
385
|
+
console.log(`\n${console_chars_1.emoji.warning} WARNINGS:`);
|
|
386
|
+
console.log((0, console_chars_1.createDivider)(60, "light"));
|
|
387
|
+
for (const issue of warnings.slice(0, 10)) {
|
|
388
|
+
console.log(` ${issue.file}:${issue.line}`);
|
|
389
|
+
console.log(` ${issue.message}`);
|
|
390
|
+
console.log(` ${console_chars_1.emoji.hint} ${issue.suggestion}`);
|
|
391
|
+
console.log("");
|
|
392
|
+
}
|
|
393
|
+
if (warnings.length > 10) {
|
|
394
|
+
console.log(` ... and ${warnings.length - 10} more`);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
// Print fix guidance
|
|
398
|
+
console.log(`\n${console_chars_1.emoji.docs} How to fix:`);
|
|
399
|
+
console.log(` Extract deeply nested properties before the JSX return:`);
|
|
400
|
+
console.log("");
|
|
401
|
+
console.log(` // BEFORE (risky):`);
|
|
402
|
+
console.log(` return (`);
|
|
403
|
+
console.log(` <Component`);
|
|
404
|
+
console.log(` status={filters.filters.status ?? "PENDING"}`);
|
|
405
|
+
console.log(` />`);
|
|
406
|
+
console.log(` );`);
|
|
407
|
+
console.log("");
|
|
408
|
+
console.log(` // AFTER (safe):`);
|
|
409
|
+
console.log(` const selectedStatus = filters.filters.status ?? "PENDING";`);
|
|
410
|
+
console.log(` return (`);
|
|
411
|
+
console.log(` <Component`);
|
|
412
|
+
console.log(` status={selectedStatus}`);
|
|
413
|
+
console.log(` />`);
|
|
414
|
+
console.log(` );`);
|
|
415
|
+
// Exit code
|
|
416
|
+
if (errors.length > 0) {
|
|
417
|
+
console.log(`\n${console_chars_1.emoji.error} ${errors.length} error(s) found - blocking.`);
|
|
418
|
+
process.exit(1);
|
|
419
|
+
}
|
|
420
|
+
console.log(`\n${console_chars_1.emoji.success} Preflight complete`);
|
|
421
|
+
process.exit(0);
|
|
422
|
+
}
|
|
423
|
+
// Allow direct execution
|
|
424
|
+
if (require.main === module) {
|
|
425
|
+
run().catch(console.error);
|
|
426
|
+
}
|
|
427
|
+
//# sourceMappingURL=nested-property-jsx-access.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nested-property-jsx-access.js","sourceRoot":"","sources":["../../../src/checks/turbopack/nested-property-jsx-access.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwRH,kBAwHC;AA9YD,uCAAyB;AACzB,wDAAoD;AACpD,8DAA+E;AAC/E,6DAAiE;AACjE,uF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AChB,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;IAC9E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC3B,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC/B,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACvB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAErB,YAAY;IACZ,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,KAAK,qBAAK,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,6BAA6B,CAAC,CAAC;QAC5E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,KAAK,qBAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;IACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,yBAAyB;AACzB,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empline/preflight",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "Distributable preflight validation system with app-specific plugin support",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -61,8 +61,9 @@
|
|
|
61
61
|
"access": "restricted"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"
|
|
64
|
+
"@empline/ai-manager": "file:../ai-manager/empline-ai-manager-0.0.9.tgz",
|
|
65
65
|
"dotenv": "^16.0.0",
|
|
66
|
+
"glob": "^10.0.0",
|
|
66
67
|
"minimatch": "^9.0.0"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
@@ -72,8 +73,8 @@
|
|
|
72
73
|
"vitest": "^1.0.0"
|
|
73
74
|
},
|
|
74
75
|
"optionalDependencies": {
|
|
75
|
-
"
|
|
76
|
-
"
|
|
76
|
+
"pg": "^8.0.0",
|
|
77
|
+
"playwright": "^1.40.0"
|
|
77
78
|
},
|
|
78
79
|
"peerDependencies": {
|
|
79
80
|
"typescript": ">=5.0.0"
|