@empline/preflight 1.1.0 → 1.1.2
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/bin/sync-check.d.ts +13 -0
- package/dist/bin/sync-check.d.ts.map +1 -0
- package/dist/bin/sync-check.js +207 -0
- package/dist/bin/sync-check.js.map +1 -0
- package/dist/checks/runtime/zod-turbopack-compatibility.d.ts +27 -0
- package/dist/checks/runtime/zod-turbopack-compatibility.d.ts.map +1 -0
- package/dist/checks/runtime/zod-turbopack-compatibility.js +263 -0
- package/dist/checks/runtime/zod-turbopack-compatibility.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Preflight Sync Check CLI
|
|
4
|
+
*
|
|
5
|
+
* Detects duplicate preflight IDs between the core @empline/preflight package
|
|
6
|
+
* and app-specific preflights to prevent running the same check twice.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* npx preflight-sync-check # Check for duplicates
|
|
10
|
+
* npx preflight-sync-check --verbose # Show all check IDs
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=sync-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-check.d.ts","sourceRoot":"","sources":["../../src/bin/sync-check.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Preflight Sync Check CLI
|
|
5
|
+
*
|
|
6
|
+
* Detects duplicate preflight IDs between the core @empline/preflight package
|
|
7
|
+
* and app-specific preflights to prevent running the same check twice.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* npx preflight-sync-check # Check for duplicates
|
|
11
|
+
* npx preflight-sync-check --verbose # Show all check IDs
|
|
12
|
+
*/
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
const fs = __importStar(require("node:fs"));
|
|
48
|
+
const path = __importStar(require("node:path"));
|
|
49
|
+
const glob_1 = require("glob");
|
|
50
|
+
const args = process.argv.slice(2);
|
|
51
|
+
const verbose = args.includes("--verbose") || args.includes("-v");
|
|
52
|
+
// ANSI colors
|
|
53
|
+
const c = {
|
|
54
|
+
red: "\x1b[31m",
|
|
55
|
+
green: "\x1b[32m",
|
|
56
|
+
yellow: "\x1b[33m",
|
|
57
|
+
cyan: "\x1b[36m",
|
|
58
|
+
reset: "\x1b[0m",
|
|
59
|
+
bold: "\x1b[1m",
|
|
60
|
+
dim: "\x1b[2m",
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Extract check ID from a preflight file
|
|
64
|
+
*/
|
|
65
|
+
function extractCheckId(filePath) {
|
|
66
|
+
try {
|
|
67
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
68
|
+
// Look for export const id = "..."
|
|
69
|
+
const idMatch = content.match(/export\s+const\s+id\s*=\s*["']([^"']+)["']/);
|
|
70
|
+
if (!idMatch)
|
|
71
|
+
return null;
|
|
72
|
+
// Optional: extract name
|
|
73
|
+
const nameMatch = content.match(/export\s+const\s+name\s*=\s*["']([^"']+)["']/);
|
|
74
|
+
return {
|
|
75
|
+
id: idMatch[1],
|
|
76
|
+
file: filePath,
|
|
77
|
+
name: nameMatch?.[1],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Find all core package check IDs
|
|
86
|
+
*/
|
|
87
|
+
async function getCoreCheckIds() {
|
|
88
|
+
const checksMap = new Map();
|
|
89
|
+
// Find the core package checks directory
|
|
90
|
+
// When installed as a package, it's in node_modules/@empline/preflight/dist/checks
|
|
91
|
+
// When running from the package itself, it's in src/checks
|
|
92
|
+
const possiblePaths = [
|
|
93
|
+
path.join(__dirname, "..", "checks"), // dist/checks (when installed)
|
|
94
|
+
path.join(__dirname, "..", "..", "src", "checks"), // src/checks (when running locally)
|
|
95
|
+
];
|
|
96
|
+
let checksDir = "";
|
|
97
|
+
for (const p of possiblePaths) {
|
|
98
|
+
if (fs.existsSync(p)) {
|
|
99
|
+
checksDir = p;
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!checksDir) {
|
|
104
|
+
console.error(`${c.red}Error: Could not find core checks directory${c.reset}`);
|
|
105
|
+
return checksMap;
|
|
106
|
+
}
|
|
107
|
+
// Find all .ts or .js files in checks directory
|
|
108
|
+
const pattern = path.join(checksDir, "**/*.{ts,js}").replace(/\\/g, "/");
|
|
109
|
+
const files = await (0, glob_1.glob)(pattern, {
|
|
110
|
+
ignore: ["**/*.d.ts", "**/*.map", "**/index.ts", "**/index.js"],
|
|
111
|
+
});
|
|
112
|
+
for (const file of files) {
|
|
113
|
+
const info = extractCheckId(file);
|
|
114
|
+
if (info) {
|
|
115
|
+
checksMap.set(info.id, info);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return checksMap;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Find all app-specific check IDs
|
|
122
|
+
*/
|
|
123
|
+
async function getAppCheckIds() {
|
|
124
|
+
const checksMap = new Map();
|
|
125
|
+
// Look for common preflight directories
|
|
126
|
+
const possibleDirs = [
|
|
127
|
+
"scripts/preflights",
|
|
128
|
+
"preflights",
|
|
129
|
+
".preflights",
|
|
130
|
+
];
|
|
131
|
+
let preflightDir = "";
|
|
132
|
+
for (const dir of possibleDirs) {
|
|
133
|
+
if (fs.existsSync(dir)) {
|
|
134
|
+
preflightDir = dir;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (!preflightDir) {
|
|
139
|
+
return checksMap; // No app preflights, that's fine
|
|
140
|
+
}
|
|
141
|
+
const pattern = path.join(preflightDir, "**/*.ts").replace(/\\/g, "/");
|
|
142
|
+
const files = await (0, glob_1.glob)(pattern, {
|
|
143
|
+
ignore: ["**/node_modules/**"],
|
|
144
|
+
});
|
|
145
|
+
for (const file of files) {
|
|
146
|
+
const info = extractCheckId(file);
|
|
147
|
+
if (info) {
|
|
148
|
+
checksMap.set(info.id, info);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return checksMap;
|
|
152
|
+
}
|
|
153
|
+
async function main() {
|
|
154
|
+
console.log(`\n${c.cyan}${c.bold}🔄 Preflight Sync Check${c.reset}\n`);
|
|
155
|
+
console.log("Checking for duplicate check IDs between core package and app...\n");
|
|
156
|
+
const [coreChecks, appChecks] = await Promise.all([
|
|
157
|
+
getCoreCheckIds(),
|
|
158
|
+
getAppCheckIds(),
|
|
159
|
+
]);
|
|
160
|
+
console.log(`${c.dim}Core package checks: ${coreChecks.size}${c.reset}`);
|
|
161
|
+
console.log(`${c.dim}App-specific checks: ${appChecks.size}${c.reset}\n`);
|
|
162
|
+
// Find duplicates
|
|
163
|
+
const duplicates = [];
|
|
164
|
+
for (const [id, appInfo] of appChecks) {
|
|
165
|
+
const coreInfo = coreChecks.get(id);
|
|
166
|
+
if (coreInfo) {
|
|
167
|
+
duplicates.push({
|
|
168
|
+
id,
|
|
169
|
+
coreFile: coreInfo.file,
|
|
170
|
+
appFile: appInfo.file,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (duplicates.length > 0) {
|
|
175
|
+
console.log(`${c.red}${c.bold}⚠️ DUPLICATE CHECK IDs FOUND (${duplicates.length})${c.reset}\n`);
|
|
176
|
+
console.log("These checks exist in both the core package and your app:");
|
|
177
|
+
console.log("They will run TWICE during preflight execution.\n");
|
|
178
|
+
for (const dup of duplicates) {
|
|
179
|
+
console.log(` ${c.yellow}• ${dup.id}${c.reset}`);
|
|
180
|
+
console.log(` Core: ${c.dim}${path.relative(process.cwd(), dup.coreFile)}${c.reset}`);
|
|
181
|
+
console.log(` App: ${c.dim}${path.relative(process.cwd(), dup.appFile)}${c.reset}`);
|
|
182
|
+
console.log("");
|
|
183
|
+
}
|
|
184
|
+
console.log(`${c.bold}Resolution:${c.reset}`);
|
|
185
|
+
console.log(" 1. Remove app versions if they're identical to core");
|
|
186
|
+
console.log(" 2. Rename app versions with unique IDs if they have custom logic");
|
|
187
|
+
console.log(" 3. Run: npx preflight-drift --update after removing duplicates\n");
|
|
188
|
+
process.exit(1);
|
|
189
|
+
}
|
|
190
|
+
console.log(`${c.green}${c.bold}✅ No duplicate check IDs found${c.reset}\n`);
|
|
191
|
+
if (verbose) {
|
|
192
|
+
console.log(`${c.cyan}App-specific checks:${c.reset}`);
|
|
193
|
+
for (const [id, info] of appChecks) {
|
|
194
|
+
console.log(` • ${id}`);
|
|
195
|
+
if (info.name)
|
|
196
|
+
console.log(` ${c.dim}${info.name}${c.reset}`);
|
|
197
|
+
}
|
|
198
|
+
console.log("");
|
|
199
|
+
}
|
|
200
|
+
console.log(`${c.dim}Tip: Run with --verbose to see all app check IDs${c.reset}\n`);
|
|
201
|
+
process.exit(0);
|
|
202
|
+
}
|
|
203
|
+
main().catch((error) => {
|
|
204
|
+
console.error(`${c.red}Error: ${error.message}${c.reset}`);
|
|
205
|
+
process.exit(1);
|
|
206
|
+
});
|
|
207
|
+
//# sourceMappingURL=sync-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-check.js","sourceRoot":"","sources":["../../src/bin/sync-check.ts"],"names":[],"mappings":";;AACA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA8B;AAC9B,gDAAkC;AAClC,+BAA4B;AAE5B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAElE,cAAc;AACd,MAAM,CAAC,GAAG;IACR,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,UAAU;IAChB,KAAK,EA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ESM Compatibility Preflight (BLOCKING)
|
|
4
|
+
*
|
|
5
|
+
* Detects Zod patterns that cause runtime errors with Next.js Turbopack bundler.
|
|
6
|
+
* This is SEPARATE from other Zod checks which focus on API deprecations.
|
|
7
|
+
*
|
|
8
|
+
* The Issue:
|
|
9
|
+
* - Turbopack has ESM bundling issues with Zod 4's internal module structure
|
|
10
|
+
* - Patterns like z.string().email(), z.email(), etc. can cause "_check is not defined" errors
|
|
11
|
+
* - These only manifest at RUNTIME in client components (not type-check or build time)
|
|
12
|
+
*
|
|
13
|
+
* Solution:
|
|
14
|
+
* - In client components ("use client"), use custom validation utilities instead
|
|
15
|
+
* - Server-side code (API routes, server components) can continue using Zod safely
|
|
16
|
+
*
|
|
17
|
+
* @see https://github.com/colinhacks/zod/issues/3891
|
|
18
|
+
*/
|
|
19
|
+
import { PreflightCheckResult } from "../../core/types";
|
|
20
|
+
export declare const id = "runtime/zod-turbopack-compatibility";
|
|
21
|
+
export declare const name = "Zod Turbopack Compatibility";
|
|
22
|
+
export declare const description = "Detects Zod patterns that cause runtime errors with Turbopack bundler";
|
|
23
|
+
export declare const category = "runtime";
|
|
24
|
+
export declare const blocking = true;
|
|
25
|
+
export declare const tags: string[];
|
|
26
|
+
export declare function run(): Promise<PreflightCheckResult>;
|
|
27
|
+
//# sourceMappingURL=zod-turbopack-compatibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-turbopack-compatibility.d.ts","sourceRoot":"","sources":["../../../src/checks/runtime/zod-turbopack-compatibility.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AAOH,OAAO,EAAE,oBAAoB,EAAoB,MAAM,kBAAkB,CAAC;AAK1E,eAAO,MAAM,EAAE,wCAAwC,CAAC;AACxD,eAAO,MAAM,IAAI,gCAAgC,CAAC;AAClD,eAAO,MAAM,WAAW,0EAA0E,CAAC;AACnG,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,eAAO,MAAM,IAAI,UAA8D,CAAC;AAuHhF,wBAAsB,GAAG,IAAI,OAAO,CAAC,oBAAoB,CAAC,CA8GzD"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Zod Turbopack ESM Compatibility Preflight (BLOCKING)
|
|
5
|
+
*
|
|
6
|
+
* Detects Zod patterns that cause runtime errors with Next.js Turbopack bundler.
|
|
7
|
+
* This is SEPARATE from other Zod checks which focus on API deprecations.
|
|
8
|
+
*
|
|
9
|
+
* The Issue:
|
|
10
|
+
* - Turbopack has ESM bundling issues with Zod 4's internal module structure
|
|
11
|
+
* - Patterns like z.string().email(), z.email(), etc. can cause "_check is not defined" errors
|
|
12
|
+
* - These only manifest at RUNTIME in client components (not type-check or build time)
|
|
13
|
+
*
|
|
14
|
+
* Solution:
|
|
15
|
+
* - In client components ("use client"), use custom validation utilities instead
|
|
16
|
+
* - Server-side code (API routes, server components) can continue using Zod safely
|
|
17
|
+
*
|
|
18
|
+
* @see https://github.com/colinhacks/zod/issues/3891
|
|
19
|
+
*/
|
|
20
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(o, k2, desc);
|
|
27
|
+
}) : (function(o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
}));
|
|
31
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
32
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
33
|
+
}) : function(o, v) {
|
|
34
|
+
o["default"] = v;
|
|
35
|
+
});
|
|
36
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
37
|
+
var ownKeys = function(o) {
|
|
38
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
39
|
+
var ar = [];
|
|
40
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
41
|
+
return ar;
|
|
42
|
+
};
|
|
43
|
+
return ownKeys(o);
|
|
44
|
+
};
|
|
45
|
+
return function (mod) {
|
|
46
|
+
if (mod && mod.__esModule) return mod;
|
|
47
|
+
var result = {};
|
|
48
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
49
|
+
__setModuleDefault(result, mod);
|
|
50
|
+
return result;
|
|
51
|
+
};
|
|
52
|
+
})();
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.tags = exports.blocking = exports.category = exports.description = exports.name = exports.id = void 0;
|
|
55
|
+
exports.run = run;
|
|
56
|
+
const fs = __importStar(require("fs"));
|
|
57
|
+
const glob_1 = require("glob");
|
|
58
|
+
const path = __importStar(require("path"));
|
|
59
|
+
const console_chars_1 = require("../../utils/console-chars");
|
|
60
|
+
const exclusions_1 = require("../../shared/exclusions");
|
|
61
|
+
let appExclusions = [];
|
|
62
|
+
// METADATA
|
|
63
|
+
exports.id = "runtime/zod-turbopack-compatibility";
|
|
64
|
+
exports.name = "Zod Turbopack Compatibility";
|
|
65
|
+
exports.description = "Detects Zod patterns that cause runtime errors with Turbopack bundler";
|
|
66
|
+
exports.category = "runtime";
|
|
67
|
+
exports.blocking = true;
|
|
68
|
+
exports.tags = ["runtime", "zod", "turbopack", "nextjs", "esm", "bundler"];
|
|
69
|
+
// Configuration
|
|
70
|
+
const PROBLEMATIC_PATTERNS = [
|
|
71
|
+
{
|
|
72
|
+
pattern: /z\.string\(\)\.email\(/g,
|
|
73
|
+
method: "z.string().email()",
|
|
74
|
+
replacement: "custom email validation utility",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
pattern: /z\.string\(\)\.url\(/g,
|
|
78
|
+
method: "z.string().url()",
|
|
79
|
+
replacement: "custom URL validation utility",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
pattern: /z\.email\(/g,
|
|
83
|
+
method: "z.email()",
|
|
84
|
+
replacement: "custom email validation utility",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
pattern: /z\.url\(/g,
|
|
88
|
+
method: "z.url()",
|
|
89
|
+
replacement: "custom URL validation utility",
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
// These patterns trigger Zod imports but may be safe in server contexts
|
|
93
|
+
const ZOD_IMPORT_PATTERNS = [
|
|
94
|
+
/import\s+\*\s+as\s+z\s+from\s+["']zod["']/,
|
|
95
|
+
/import\s+{\s*z\s*}\s+from\s+["']zod["']/,
|
|
96
|
+
/import\s+z\s+from\s+["']zod["']/,
|
|
97
|
+
/from\s+["']zod["']/,
|
|
98
|
+
];
|
|
99
|
+
function isClientComponent(content) {
|
|
100
|
+
// Check for "use client" directive at the start of the file
|
|
101
|
+
const firstLines = content.split("\n").slice(0, 5).join("\n");
|
|
102
|
+
return firstLines.includes('"use client"') || firstLines.includes("'use client'");
|
|
103
|
+
}
|
|
104
|
+
function isServerFile(filePath) {
|
|
105
|
+
// API routes, server actions, and server components run in Node.js
|
|
106
|
+
return (filePath.includes("/api/") ||
|
|
107
|
+
filePath.includes("\\api\\") ||
|
|
108
|
+
filePath.endsWith(".server.ts") ||
|
|
109
|
+
filePath.endsWith(".server.tsx") ||
|
|
110
|
+
filePath.includes("/actions/") ||
|
|
111
|
+
filePath.includes("\\actions\\"));
|
|
112
|
+
}
|
|
113
|
+
function checkFile(filePath, content) {
|
|
114
|
+
const issues = [];
|
|
115
|
+
const lines = content.split("\n");
|
|
116
|
+
// Skip if not a client component (server code is safe)
|
|
117
|
+
if (!isClientComponent(content)) {
|
|
118
|
+
return issues;
|
|
119
|
+
}
|
|
120
|
+
// Skip if this is server-side code
|
|
121
|
+
if (isServerFile(filePath)) {
|
|
122
|
+
return issues;
|
|
123
|
+
}
|
|
124
|
+
// Check if file imports Zod
|
|
125
|
+
const hasZodImport = ZOD_IMPORT_PATTERNS.some((p) => p.test(content));
|
|
126
|
+
if (!hasZodImport) {
|
|
127
|
+
return issues;
|
|
128
|
+
}
|
|
129
|
+
// Check for problematic patterns
|
|
130
|
+
lines.forEach((line, idx) => {
|
|
131
|
+
for (const { pattern, method, replacement } of PROBLEMATIC_PATTERNS) {
|
|
132
|
+
// Reset pattern lastIndex for global patterns
|
|
133
|
+
pattern.lastIndex = 0;
|
|
134
|
+
if (pattern.test(line)) {
|
|
135
|
+
issues.push({
|
|
136
|
+
file: filePath,
|
|
137
|
+
line: idx + 1,
|
|
138
|
+
type: "turbopack-zod-incompatible",
|
|
139
|
+
severity: "error",
|
|
140
|
+
message: `${method} has Turbopack ESM bundling issues in client components`,
|
|
141
|
+
suggestion: `Use ${replacement} instead to avoid "_check is not defined" runtime errors`,
|
|
142
|
+
snippet: line.trim(),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
// Also note about any Zod usage in client components as informational (not blocking)
|
|
148
|
+
if (issues.length === 0 && hasZodImport) {
|
|
149
|
+
const zodUsageLines = lines.filter((line) => /z\.\w+\(/.test(line));
|
|
150
|
+
if (zodUsageLines.length > 0) {
|
|
151
|
+
issues.push({
|
|
152
|
+
file: filePath,
|
|
153
|
+
line: 1,
|
|
154
|
+
type: "turbopack-zod-client-usage",
|
|
155
|
+
severity: "info",
|
|
156
|
+
message: "Zod is used in a client component (monitor for Turbopack issues)",
|
|
157
|
+
suggestion: "Most Zod patterns work; only z.string().email()/url() cause issues",
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return issues;
|
|
162
|
+
}
|
|
163
|
+
async function run() {
|
|
164
|
+
const startTime = Date.now();
|
|
165
|
+
const verbose = process.argv.includes("--verbose") || process.argv.includes("-v");
|
|
166
|
+
const preflightFindings = [];
|
|
167
|
+
console.log((0, console_chars_1.createDivider)(60, "heavy"));
|
|
168
|
+
console.log(`${console_chars_1.emoji.search} Zod Turbopack Compatibility`);
|
|
169
|
+
console.log(`Checking for Zod patterns incompatible with Turbopack...\n`);
|
|
170
|
+
try {
|
|
171
|
+
appExclusions = await (0, exclusions_1.getExclusions)(exports.id);
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
appExclusions = [];
|
|
175
|
+
}
|
|
176
|
+
const allIssues = [];
|
|
177
|
+
// Find all TypeScript/TSX files (excluding node_modules, etc.)
|
|
178
|
+
const files = await (0, glob_1.glob)("**/*.{ts,tsx}", {
|
|
179
|
+
ignore: [
|
|
180
|
+
"**/node_modules/**",
|
|
181
|
+
"**/dist/**",
|
|
182
|
+
"**/.next/**",
|
|
183
|
+
"**/test-results/**",
|
|
184
|
+
"**/scripts/preflights/**",
|
|
185
|
+
"**/lib/client-validation.ts", // Exclude client validation fix files
|
|
186
|
+
],
|
|
187
|
+
cwd: process.cwd(),
|
|
188
|
+
absolute: true,
|
|
189
|
+
});
|
|
190
|
+
let filesScanned = 0;
|
|
191
|
+
let clientComponentsWithZod = 0;
|
|
192
|
+
for (const file of files) {
|
|
193
|
+
if ((0, exclusions_1.shouldExcludeFile)(file, appExclusions))
|
|
194
|
+
continue;
|
|
195
|
+
try {
|
|
196
|
+
const content = fs.readFileSync(file, "utf-8");
|
|
197
|
+
filesScanned++;
|
|
198
|
+
// Only check client components that use Zod
|
|
199
|
+
if (isClientComponent(content) && content.includes("zod")) {
|
|
200
|
+
clientComponentsWithZod++;
|
|
201
|
+
allIssues.push(...checkFile(file, content));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
// Skip files that can't be read
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const errors = allIssues.filter((i) => i.severity === "error");
|
|
209
|
+
const warnings = allIssues.filter((i) => i.severity === "warning");
|
|
210
|
+
const infos = allIssues.filter((i) => i.severity === "info");
|
|
211
|
+
// Report results
|
|
212
|
+
console.log(`Files scanned: ${filesScanned}`);
|
|
213
|
+
console.log(`Client components with Zod: ${clientComponentsWithZod}`);
|
|
214
|
+
if (errors.length > 0) {
|
|
215
|
+
console.log(`\n${console_chars_1.emoji.error} BLOCKING ISSUES (${errors.length}):`);
|
|
216
|
+
console.log((0, console_chars_1.createDivider)(60, "light"));
|
|
217
|
+
for (const issue of errors.slice(0, verbose ? 20 : 5)) {
|
|
218
|
+
const relativePath = path.relative(process.cwd(), issue.file);
|
|
219
|
+
console.log(`\n ${console_chars_1.chars.bullet} ${relativePath}:${issue.line}`);
|
|
220
|
+
console.log(` ${issue.message}`);
|
|
221
|
+
console.log(` ${console_chars_1.emoji.hint} ${issue.suggestion}`);
|
|
222
|
+
if (verbose && issue.snippet) {
|
|
223
|
+
console.log(` Code: ${issue.snippet.substring(0, 80)}`);
|
|
224
|
+
}
|
|
225
|
+
preflightFindings.push({
|
|
226
|
+
level: "error",
|
|
227
|
+
message: issue.message,
|
|
228
|
+
file: issue.file,
|
|
229
|
+
startLine: issue.line,
|
|
230
|
+
suggestion: issue.suggestion,
|
|
231
|
+
ruleId: `zod-turbopack/${issue.type}`,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
if (errors.length > (verbose ? 20 : 5)) {
|
|
235
|
+
console.log(`\n ...and ${errors.length - (verbose ? 20 : 5)} more errors`);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
if (verbose && infos.length > 0) {
|
|
239
|
+
console.log(`\n${console_chars_1.emoji.info} INFORMATIONAL (${infos.length}):`);
|
|
240
|
+
console.log((0, console_chars_1.createDivider)(60, "light"));
|
|
241
|
+
console.log(` ${infos.length} client components use Zod (monitoring for issues)`);
|
|
242
|
+
}
|
|
243
|
+
console.log((0, console_chars_1.createDivider)(60, "heavy"));
|
|
244
|
+
console.log(`Errors: ${errors.length}`);
|
|
245
|
+
console.log(`Warnings: ${warnings.length}`);
|
|
246
|
+
console.log(`Info: ${infos.length}`);
|
|
247
|
+
if (errors.length > 0) {
|
|
248
|
+
console.log(`\n${console_chars_1.emoji.error} Zod Turbopack compatibility issues found`);
|
|
249
|
+
console.log(`\n${console_chars_1.emoji.docs} Fix Guide:`);
|
|
250
|
+
console.log(` ${console_chars_1.chars.bullet} Replace Zod validation in client components with custom utilities`);
|
|
251
|
+
console.log(` ${console_chars_1.chars.bullet} Create a lib/client-validation.ts with validateEmail(), etc.`);
|
|
252
|
+
console.log(` ${console_chars_1.chars.bullet} Server-side code (API routes) can continue using Zod safely\n`);
|
|
253
|
+
return { passed: false, findings: preflightFindings, duration: Date.now() - startTime };
|
|
254
|
+
}
|
|
255
|
+
console.log(`\n${console_chars_1.emoji.success} No Zod Turbopack compatibility issues found`);
|
|
256
|
+
console.log(`${console_chars_1.emoji.hint} Reminder: Use custom validation for client-side form validation\n`);
|
|
257
|
+
return { passed: true, findings: preflightFindings, duration: Date.now() - startTime };
|
|
258
|
+
}
|
|
259
|
+
// CLI execution
|
|
260
|
+
if (require.main === module) {
|
|
261
|
+
run().then((result) => process.exit(result.passed ? 0 : 1)).catch(() => process.exit(1));
|
|
262
|
+
}
|
|
263
|
+
//# sourceMappingURL=zod-turbopack-compatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-turbopack-compatibility.js","sourceRoot":"","sources":["../../../src/checks/runtime/zod-turbopack-compatibility.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwIH,kBA8GC;AApPD,uCAAyB;AACzB,+BAA4B;AAC5B,2CAA6B;AAC7B,6DAAwE;AACxE,wDAA2E;AAG3E,IAAI,aAAa,GAAa,EAAE,CAAC;AAEjC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package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empline/preflight",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
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",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"preflight-watch": "dist/bin/watch.js",
|
|
15
15
|
"preflight-drift": "dist/checks/system/preflight-drift-detector.js",
|
|
16
16
|
"preflight-install-hooks": "dist/bin/install-hooks.js",
|
|
17
|
-
"preflight-review-drift": "dist/bin/review-drift.js"
|
|
17
|
+
"preflight-review-drift": "dist/bin/review-drift.js",
|
|
18
|
+
"preflight-sync-check": "dist/bin/sync-check.js"
|
|
18
19
|
},
|
|
19
20
|
"scripts": {
|
|
20
21
|
"build": "tsc",
|