@cliperhq/cliper 1.0.2 → 1.0.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../src/scanner/dependencies.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC;CAC9C;AAED,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,EAAE,CAAC;CACzB;
|
|
1
|
+
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../src/scanner/dependencies.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC;CAC9C;AAED,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,EAAE,CAAC;CACzB;AAqGD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,aAAa,CA2CtE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAsC9D"}
|
|
@@ -53,6 +53,10 @@ function extractJSImports(file) {
|
|
|
53
53
|
const resolved = path.normalize(path.join(dir, dep));
|
|
54
54
|
internal.push(resolved);
|
|
55
55
|
}
|
|
56
|
+
else if (dep.startsWith("@/")) {
|
|
57
|
+
// TS path alias (e.g. "@/*": ["./*"]) — internal, not an npm scoped package
|
|
58
|
+
internal.push(dep.slice(2));
|
|
59
|
+
}
|
|
56
60
|
else {
|
|
57
61
|
const pkgName = dep.startsWith("@")
|
|
58
62
|
? dep.split("/").slice(0, 2).join("/")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoScope.d.ts","sourceRoot":"","sources":["../../src/scope/autoScope.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"autoScope.d.ts","sourceRoot":"","sources":["../../src/scope/autoScope.ts"],"names":[],"mappings":"AA4IA,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAgD5E"}
|
package/dist/scope/autoScope.js
CHANGED
|
@@ -137,6 +137,13 @@ async function getNodeScope(projectRoot) {
|
|
|
137
137
|
if (fs.existsSync(fullPath))
|
|
138
138
|
scope.add(dir);
|
|
139
139
|
}
|
|
140
|
+
// Check for Next.js / React App Router conventions
|
|
141
|
+
// These live at project root (not nested under src/) in many Next.js 13+ projects
|
|
142
|
+
for (const dir of ["app", "pages", "components", "lib", "hooks", "utils", "styles", "store", "context", "config", "middleware.ts", "middleware.js"]) {
|
|
143
|
+
const fullPath = path.join(projectRoot, dir);
|
|
144
|
+
if (fs.existsSync(fullPath))
|
|
145
|
+
scope.add(dir);
|
|
146
|
+
}
|
|
140
147
|
return Array.from(scope);
|
|
141
148
|
}
|
|
142
149
|
async function getPythonScope(projectRoot) {
|
package/package.json
CHANGED
|
@@ -32,6 +32,9 @@ function extractJSImports(file: FileContent): { internal: string[]; external: st
|
|
|
32
32
|
const dir = path.dirname(file.relativePath);
|
|
33
33
|
const resolved = path.normalize(path.join(dir, dep));
|
|
34
34
|
internal.push(resolved);
|
|
35
|
+
} else if (dep.startsWith("@/")) {
|
|
36
|
+
// TS path alias (e.g. "@/*": ["./*"]) — internal, not an npm scoped package
|
|
37
|
+
internal.push(dep.slice(2));
|
|
35
38
|
} else {
|
|
36
39
|
const pkgName = dep.startsWith("@")
|
|
37
40
|
? dep.split("/").slice(0, 2).join("/")
|
package/src/scope/autoScope.ts
CHANGED
|
@@ -28,7 +28,7 @@ function detectProjectType(projectRoot: string): ProjectType {
|
|
|
28
28
|
if (fs.existsSync(path.join(projectRoot, "Cargo.toml"))) return "rust";
|
|
29
29
|
if (fs.existsSync(path.join(projectRoot, "package.json"))) return "node";
|
|
30
30
|
if (fs.existsSync(path.join(projectRoot, "pyproject.toml")) ||
|
|
31
|
-
|
|
31
|
+
fs.existsSync(path.join(projectRoot, "requirements.txt"))) return "python";
|
|
32
32
|
if (fs.existsSync(path.join(projectRoot, "go.mod"))) return "go";
|
|
33
33
|
return "unknown";
|
|
34
34
|
}
|
|
@@ -101,6 +101,13 @@ async function getNodeScope(projectRoot: string): Promise<string[]> {
|
|
|
101
101
|
if (fs.existsSync(fullPath)) scope.add(dir);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
// Check for Next.js / React App Router conventions
|
|
105
|
+
// These live at project root (not nested under src/) in many Next.js 13+ projects
|
|
106
|
+
for (const dir of ["app", "pages", "components", "lib", "hooks", "utils", "styles", "store", "context", "config", "middleware.ts", "middleware.js"]) {
|
|
107
|
+
const fullPath = path.join(projectRoot, dir);
|
|
108
|
+
if (fs.existsSync(fullPath)) scope.add(dir);
|
|
109
|
+
}
|
|
110
|
+
|
|
104
111
|
return Array.from(scope);
|
|
105
112
|
}
|
|
106
113
|
|
|
@@ -139,10 +146,10 @@ export async function autoDetectScope(projectRoot: string): Promise<string[]> {
|
|
|
139
146
|
// Step 1: Detect language-specific source dirs
|
|
140
147
|
let langScope: string[] = [];
|
|
141
148
|
switch (projectType) {
|
|
142
|
-
case "rust":
|
|
143
|
-
case "node":
|
|
149
|
+
case "rust": langScope = await getRustScope(projectRoot); break;
|
|
150
|
+
case "node": langScope = await getNodeScope(projectRoot); break;
|
|
144
151
|
case "python": langScope = await getPythonScope(projectRoot); break;
|
|
145
|
-
case "go":
|
|
152
|
+
case "go": langScope = await getGoScope(projectRoot); break;
|
|
146
153
|
default: {
|
|
147
154
|
const srcPath = path.join(projectRoot, "src");
|
|
148
155
|
if (fs.existsSync(srcPath)) langScope = ["src"];
|
|
@@ -179,4 +186,4 @@ export async function autoDetectScope(projectRoot: string): Promise<string[]> {
|
|
|
179
186
|
}
|
|
180
187
|
|
|
181
188
|
return Array.from(autoScope).filter((s) => s !== "." && s.length > 0);
|
|
182
|
-
}
|
|
189
|
+
}
|