uilint 0.2.9 → 0.2.11
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/chunk-FRNXXIEM.js +197 -0
- package/dist/chunk-FRNXXIEM.js.map +1 -0
- package/dist/index.js +105 -151
- package/dist/index.js.map +1 -1
- package/dist/{install-ui-OEFHX4FG.js → install-ui-KI7YHOVZ.js} +939 -259
- package/dist/install-ui-KI7YHOVZ.js.map +1 -0
- package/package.json +3 -3
- package/dist/chunk-RHTG6DUD.js +0 -89
- package/dist/chunk-RHTG6DUD.js.map +0 -1
- package/dist/install-ui-OEFHX4FG.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uilint",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "CLI for UILint - AI-powered UI consistency checking",
|
|
5
5
|
"author": "Peter Suggate",
|
|
6
6
|
"repository": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"picocolors": "^1.1.1",
|
|
46
46
|
"react": "^19.2.3",
|
|
47
47
|
"ws": "^8.19.0",
|
|
48
|
-
"uilint-core": "0.2.
|
|
49
|
-
"uilint-eslint": "0.2.
|
|
48
|
+
"uilint-core": "0.2.11",
|
|
49
|
+
"uilint-eslint": "0.2.11"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
52
|
"@langfuse/client": "^4.5.1",
|
package/dist/chunk-RHTG6DUD.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/utils/next-detect.ts
|
|
4
|
-
import { existsSync, readdirSync } from "fs";
|
|
5
|
-
import { join } from "path";
|
|
6
|
-
function fileExists(projectPath, relPath) {
|
|
7
|
-
return existsSync(join(projectPath, relPath));
|
|
8
|
-
}
|
|
9
|
-
function detectNextAppRouter(projectPath) {
|
|
10
|
-
const roots = ["app", join("src", "app")];
|
|
11
|
-
const candidates = [];
|
|
12
|
-
let chosenRoot = null;
|
|
13
|
-
for (const root of roots) {
|
|
14
|
-
if (existsSync(join(projectPath, root))) {
|
|
15
|
-
chosenRoot = root;
|
|
16
|
-
break;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
if (!chosenRoot) return null;
|
|
20
|
-
const entryCandidates = [
|
|
21
|
-
join(chosenRoot, "layout.tsx"),
|
|
22
|
-
join(chosenRoot, "layout.jsx"),
|
|
23
|
-
join(chosenRoot, "layout.ts"),
|
|
24
|
-
join(chosenRoot, "layout.js"),
|
|
25
|
-
// Fallbacks (less ideal, but can work):
|
|
26
|
-
join(chosenRoot, "page.tsx"),
|
|
27
|
-
join(chosenRoot, "page.jsx")
|
|
28
|
-
];
|
|
29
|
-
for (const rel of entryCandidates) {
|
|
30
|
-
if (fileExists(projectPath, rel)) candidates.push(rel);
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
appRoot: chosenRoot,
|
|
34
|
-
appRootAbs: join(projectPath, chosenRoot),
|
|
35
|
-
candidates
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
var DEFAULT_IGNORE_DIRS = /* @__PURE__ */ new Set([
|
|
39
|
-
"node_modules",
|
|
40
|
-
".git",
|
|
41
|
-
".next",
|
|
42
|
-
"dist",
|
|
43
|
-
"build",
|
|
44
|
-
"out",
|
|
45
|
-
".turbo",
|
|
46
|
-
".vercel",
|
|
47
|
-
".cursor",
|
|
48
|
-
"coverage",
|
|
49
|
-
".uilint"
|
|
50
|
-
]);
|
|
51
|
-
function findNextAppRouterProjects(rootDir, options) {
|
|
52
|
-
const maxDepth = options?.maxDepth ?? 4;
|
|
53
|
-
const ignoreDirs = options?.ignoreDirs ?? DEFAULT_IGNORE_DIRS;
|
|
54
|
-
const results = [];
|
|
55
|
-
const visited = /* @__PURE__ */ new Set();
|
|
56
|
-
function walk(dir, depth) {
|
|
57
|
-
if (depth > maxDepth) return;
|
|
58
|
-
if (visited.has(dir)) return;
|
|
59
|
-
visited.add(dir);
|
|
60
|
-
const detection = detectNextAppRouter(dir);
|
|
61
|
-
if (detection) {
|
|
62
|
-
results.push({ projectPath: dir, detection });
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
let entries = [];
|
|
66
|
-
try {
|
|
67
|
-
entries = readdirSync(dir, { withFileTypes: true }).map((d) => ({
|
|
68
|
-
name: d.name,
|
|
69
|
-
isDirectory: d.isDirectory()
|
|
70
|
-
}));
|
|
71
|
-
} catch {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
for (const ent of entries) {
|
|
75
|
-
if (!ent.isDirectory) continue;
|
|
76
|
-
if (ignoreDirs.has(ent.name)) continue;
|
|
77
|
-
if (ent.name.startsWith(".") && ent.name !== ".") continue;
|
|
78
|
-
walk(join(dir, ent.name), depth + 1);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
walk(rootDir, 0);
|
|
82
|
-
return results;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export {
|
|
86
|
-
detectNextAppRouter,
|
|
87
|
-
findNextAppRouterProjects
|
|
88
|
-
};
|
|
89
|
-
//# sourceMappingURL=chunk-RHTG6DUD.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/next-detect.ts"],"sourcesContent":["import { existsSync, readdirSync } from \"fs\";\nimport { join } from \"path\";\n\nexport interface NextAppRouterDetection {\n /**\n * Relative path to the Next App Router root dir (either \"app\" or \"src/app\").\n */\n appRoot: string;\n /**\n * Absolute path to the App Router root dir.\n */\n appRootAbs: string;\n /**\n * Candidate entry files (relative paths) that are good injection targets.\n */\n candidates: string[];\n}\n\nfunction fileExists(projectPath: string, relPath: string): boolean {\n return existsSync(join(projectPath, relPath));\n}\n\nexport function detectNextAppRouter(\n projectPath: string\n): NextAppRouterDetection | null {\n const roots = [\"app\", join(\"src\", \"app\")];\n const candidates: string[] = [];\n\n let chosenRoot: string | null = null;\n for (const root of roots) {\n if (existsSync(join(projectPath, root))) {\n chosenRoot = root;\n break;\n }\n }\n\n if (!chosenRoot) return null;\n\n // Prioritize layout files (Next App Router canonical integration point).\n const entryCandidates = [\n join(chosenRoot, \"layout.tsx\"),\n join(chosenRoot, \"layout.jsx\"),\n join(chosenRoot, \"layout.ts\"),\n join(chosenRoot, \"layout.js\"),\n // Fallbacks (less ideal, but can work):\n join(chosenRoot, \"page.tsx\"),\n join(chosenRoot, \"page.jsx\"),\n ];\n\n for (const rel of entryCandidates) {\n if (fileExists(projectPath, rel)) candidates.push(rel);\n }\n\n // If nothing exists, still return detection so routes can be installed.\n return {\n appRoot: chosenRoot,\n appRootAbs: join(projectPath, chosenRoot),\n candidates,\n };\n}\n\nexport interface NextAppRouterProjectMatch {\n /**\n * Absolute path to the Next project root (dir containing app/ or src/app/).\n */\n projectPath: string;\n detection: NextAppRouterDetection;\n}\n\nconst DEFAULT_IGNORE_DIRS = new Set([\n \"node_modules\",\n \".git\",\n \".next\",\n \"dist\",\n \"build\",\n \"out\",\n \".turbo\",\n \".vercel\",\n \".cursor\",\n \"coverage\",\n \".uilint\",\n]);\n\n/**\n * Best-effort monorepo discovery for Next.js App Router apps.\n *\n * Walks down from `rootDir` looking for directories that contain `app/` or\n * `src/app/`. Skips common large/irrelevant dirs.\n */\nexport function findNextAppRouterProjects(\n rootDir: string,\n options?: { maxDepth?: number; ignoreDirs?: Set<string> }\n): NextAppRouterProjectMatch[] {\n const maxDepth = options?.maxDepth ?? 4;\n const ignoreDirs = options?.ignoreDirs ?? DEFAULT_IGNORE_DIRS;\n const results: NextAppRouterProjectMatch[] = [];\n const visited = new Set<string>();\n\n function walk(dir: string, depth: number) {\n if (depth > maxDepth) return;\n if (visited.has(dir)) return;\n visited.add(dir);\n\n const detection = detectNextAppRouter(dir);\n if (detection) {\n results.push({ projectPath: dir, detection });\n // Don't descend further once we found a project root (avoid nested hits).\n return;\n }\n\n let entries: Array<{ name: string; isDirectory: boolean }> = [];\n try {\n entries = readdirSync(dir, { withFileTypes: true }).map((d) => ({\n name: d.name,\n isDirectory: d.isDirectory(),\n }));\n } catch {\n return;\n }\n\n for (const ent of entries) {\n if (!ent.isDirectory) continue;\n if (ignoreDirs.has(ent.name)) continue;\n // Skip hidden dirs by default (except `src` which matters)\n if (ent.name.startsWith(\".\") && ent.name !== \".\") continue;\n walk(join(dir, ent.name), depth + 1);\n }\n }\n\n walk(rootDir, 0);\n return results;\n}\n"],"mappings":";;;AAAA,SAAS,YAAY,mBAAmB;AACxC,SAAS,YAAY;AAiBrB,SAAS,WAAW,aAAqB,SAA0B;AACjE,SAAO,WAAW,KAAK,aAAa,OAAO,CAAC;AAC9C;AAEO,SAAS,oBACd,aAC+B;AAC/B,QAAM,QAAQ,CAAC,OAAO,KAAK,OAAO,KAAK,CAAC;AACxC,QAAM,aAAuB,CAAC;AAE9B,MAAI,aAA4B;AAChC,aAAW,QAAQ,OAAO;AACxB,QAAI,WAAW,KAAK,aAAa,IAAI,CAAC,GAAG;AACvC,mBAAa;AACb;AAAA,IACF;AAAA,EACF;AAEA,MAAI,CAAC,WAAY,QAAO;AAGxB,QAAM,kBAAkB;AAAA,IACtB,KAAK,YAAY,YAAY;AAAA,IAC7B,KAAK,YAAY,YAAY;AAAA,IAC7B,KAAK,YAAY,WAAW;AAAA,IAC5B,KAAK,YAAY,WAAW;AAAA;AAAA,IAE5B,KAAK,YAAY,UAAU;AAAA,IAC3B,KAAK,YAAY,UAAU;AAAA,EAC7B;AAEA,aAAW,OAAO,iBAAiB;AACjC,QAAI,WAAW,aAAa,GAAG,EAAG,YAAW,KAAK,GAAG;AAAA,EACvD;AAGA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,YAAY,KAAK,aAAa,UAAU;AAAA,IACxC;AAAA,EACF;AACF;AAUA,IAAM,sBAAsB,oBAAI,IAAI;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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