@cliperhq/cliper 1.0.1 → 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":"push.d.ts","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":"AASA,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CA4CjD"}
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":"AASA,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAuDjD"}
@@ -47,6 +47,15 @@ const API_URL = "https://cliperhq.vercel.app/api/push";
47
47
  async function pushCommand() {
48
48
  const projectRoot = process.cwd();
49
49
  const contextPath = path.join((0, config_1.getCliperDir)(projectRoot), "context.md");
50
+ const cliperDir = (0, config_1.getCliperDir)(projectRoot);
51
+ const promptClaudePath = path.join(cliperDir, "prompt-claude.md");
52
+ const promptGptPath = path.join(cliperDir, "prompt-gpt.md");
53
+ const promptClaude = fs.existsSync(promptClaudePath)
54
+ ? fs.readFileSync(promptClaudePath, "utf-8")
55
+ : null;
56
+ const promptGpt = fs.existsSync(promptGptPath)
57
+ ? fs.readFileSync(promptGptPath, "utf-8")
58
+ : null;
50
59
  if (!fs.existsSync(contextPath)) {
51
60
  console.error(chalk_1.default.red("\n No context doc found. Run cliper init first.\n"));
52
61
  process.exit(1);
@@ -67,7 +76,7 @@ async function pushCommand() {
67
76
  "Content-Type": "application/json",
68
77
  "Authorization": `Bearer ${token}`,
69
78
  },
70
- body: JSON.stringify({ projectName, content }),
79
+ body: JSON.stringify({ projectName, content, promptClaude, promptGpt }),
71
80
  });
72
81
  const data = await res.json();
73
82
  if (!res.ok) {
@@ -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;AAkGD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,aAAa,CA2CtE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAsC9D"}
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":"AAqIA,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAgD5E"}
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"}
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cliperhq/cliper",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Generate rich, AI-ready context documents from your codebase. Always fresh, always scoped — for Claude, ChatGPT, and beyond.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -10,6 +10,16 @@ const API_URL = "https://cliperhq.vercel.app/api/push";
10
10
  export async function pushCommand(): Promise<void> {
11
11
  const projectRoot = process.cwd();
12
12
  const contextPath = path.join(getCliperDir(projectRoot), "context.md");
13
+ const cliperDir = getCliperDir(projectRoot);
14
+ const promptClaudePath = path.join(cliperDir, "prompt-claude.md");
15
+ const promptGptPath = path.join(cliperDir, "prompt-gpt.md");
16
+
17
+ const promptClaude = fs.existsSync(promptClaudePath)
18
+ ? fs.readFileSync(promptClaudePath, "utf-8")
19
+ : null;
20
+ const promptGpt = fs.existsSync(promptGptPath)
21
+ ? fs.readFileSync(promptGptPath, "utf-8")
22
+ : null;
13
23
 
14
24
  if (!fs.existsSync(contextPath)) {
15
25
  console.error(chalk.red("\n No context doc found. Run cliper init first.\n"));
@@ -35,7 +45,8 @@ export async function pushCommand(): Promise<void> {
35
45
  "Content-Type": "application/json",
36
46
  "Authorization": `Bearer ${token}`,
37
47
  },
38
- body: JSON.stringify({ projectName, content }),
48
+ body: JSON.stringify({ projectName, content, promptClaude, promptGpt }),
49
+
39
50
  });
40
51
 
41
52
  const data = await res.json() as any;
@@ -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("/")
@@ -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
- fs.existsSync(path.join(projectRoot, "requirements.txt"))) return "python";
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": langScope = await getRustScope(projectRoot); break;
143
- case "node": langScope = await getNodeScope(projectRoot); break;
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": langScope = await getGoScope(projectRoot); break;
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
+ }