@parseme/cli 0.0.2 → 0.0.4
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/README.md +163 -156
- package/dist/{cli.js → cli/cli.js} +59 -49
- package/dist/{prompt.d.ts → cli/prompt.d.ts} +0 -1
- package/dist/{prompt.js → cli/prompt.js} +0 -9
- package/dist/{analyzers → core/analyzers}/ast-analyzer.js +7 -6
- package/dist/{analyzers → core/analyzers}/framework-detector.d.ts +0 -3
- package/dist/{analyzers → core/analyzers}/framework-detector.js +0 -4
- package/dist/core/analyzers/git-analyzer.d.ts +10 -0
- package/dist/{analyzers → core/analyzers}/git-analyzer.js +12 -16
- package/dist/{analyzers → core/analyzers}/pattern-detector.d.ts +0 -3
- package/dist/{analyzers → core/analyzers}/pattern-detector.js +52 -47
- package/dist/{analyzers → core/analyzers}/project-analyzer.d.ts +2 -0
- package/dist/{analyzers → core/analyzers}/project-analyzer.js +19 -5
- package/dist/core/config.d.ts +20 -0
- package/dist/{config.js → core/config.js} +80 -67
- package/dist/{builders → core}/context-builder.d.ts +5 -9
- package/dist/{builders → core}/context-builder.js +103 -126
- package/dist/{generator.d.ts → core/generator.d.ts} +0 -3
- package/dist/{generator.js → core/generator.js} +12 -15
- package/dist/core/types/analyzer-types.d.ts +39 -0
- package/dist/core/types/analyzer-types.js +2 -0
- package/dist/{config.d.ts → core/types/config-types.d.ts} +8 -15
- package/dist/core/types/config-types.js +2 -0
- package/dist/core/types/generator-types.d.ts +8 -0
- package/dist/core/types/generator-types.js +2 -0
- package/dist/core/types/index.d.ts +4 -0
- package/dist/core/types/index.js +5 -0
- package/dist/core/types/project-types.d.ts +30 -0
- package/dist/core/types/project-types.js +2 -0
- package/dist/core/types.d.ts +1 -0
- package/dist/core/types.js +2 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.js +2 -2
- package/package.json +3 -4
- package/dist/analyzers/git-analyzer.d.ts +0 -13
- package/dist/types.d.ts +0 -82
- package/dist/types.js +0 -2
- /package/dist/{cli.d.ts → cli/cli.d.ts} +0 -0
- /package/dist/{analyzers → core/analyzers}/ast-analyzer.d.ts +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ServiceInfo, ModelInfo, ConfigInfo, MiddlewareInfo, UtilityInfo } from '../analyzers/pattern-detector.js';
|
|
2
|
+
export type { ServiceInfo, ModelInfo, ConfigInfo, MiddlewareInfo, UtilityInfo };
|
|
3
|
+
export interface FileAnalysis {
|
|
4
|
+
path: string;
|
|
5
|
+
type: 'route' | 'middleware' | 'model' | 'service' | 'utility' | 'config' | 'test' | 'component';
|
|
6
|
+
framework?: string;
|
|
7
|
+
exports: string[];
|
|
8
|
+
imports: string[];
|
|
9
|
+
functions: string[];
|
|
10
|
+
classes: string[];
|
|
11
|
+
routes?: RouteInfo[];
|
|
12
|
+
components?: ComponentInfo[];
|
|
13
|
+
services?: ServiceInfo[];
|
|
14
|
+
models?: ModelInfo[];
|
|
15
|
+
configs?: ConfigInfo[];
|
|
16
|
+
middleware?: MiddlewareInfo[];
|
|
17
|
+
utilities?: UtilityInfo[];
|
|
18
|
+
}
|
|
19
|
+
export interface RouteInfo {
|
|
20
|
+
method: string;
|
|
21
|
+
path: string;
|
|
22
|
+
handler: string;
|
|
23
|
+
middleware?: string[];
|
|
24
|
+
file: string;
|
|
25
|
+
line: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ComponentInfo {
|
|
28
|
+
name: string;
|
|
29
|
+
file: string;
|
|
30
|
+
line: number;
|
|
31
|
+
}
|
|
32
|
+
export interface GitInfo {
|
|
33
|
+
branch: string;
|
|
34
|
+
lastCommit: string;
|
|
35
|
+
changedFiles: string[];
|
|
36
|
+
status: 'clean' | 'dirty';
|
|
37
|
+
origin?: string;
|
|
38
|
+
diffStat?: string;
|
|
39
|
+
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
export interface GeneratorOptions {
|
|
2
|
+
rootDir?: string;
|
|
3
|
+
includeGitInfo?: boolean;
|
|
4
|
+
maxDepth?: number;
|
|
5
|
+
excludePatterns?: string[];
|
|
6
|
+
analyzeFileTypes?: string[];
|
|
7
|
+
}
|
|
2
8
|
export interface ParsemeConfigFile extends GeneratorOptions {
|
|
3
9
|
outputPath?: string;
|
|
4
10
|
contextDir?: string;
|
|
5
11
|
rootDir?: string;
|
|
6
|
-
|
|
12
|
+
analyzeFileTypes?: string[];
|
|
7
13
|
excludePatterns?: string[];
|
|
8
14
|
maxDepth?: number;
|
|
9
15
|
includeGitInfo?: boolean;
|
|
@@ -29,16 +35,3 @@ export interface ParsemeConfigFile extends GeneratorOptions {
|
|
|
29
35
|
truncateStrategy?: 'truncate' | 'split' | 'summarize';
|
|
30
36
|
};
|
|
31
37
|
}
|
|
32
|
-
export declare class ParsemeConfig {
|
|
33
|
-
private readonly config;
|
|
34
|
-
constructor(config?: Partial<ParsemeConfigFile>);
|
|
35
|
-
static fromFileWithOptions(configPath?: string, cliOptions?: Partial<ParsemeConfigFile>): Promise<ParsemeConfig>;
|
|
36
|
-
static fromFile(configPath?: string): Promise<ParsemeConfig>;
|
|
37
|
-
private mergeWithDefaults;
|
|
38
|
-
get(): ParsemeConfigFile;
|
|
39
|
-
save(path?: string): Promise<void>;
|
|
40
|
-
private generateJSConfig;
|
|
41
|
-
private generateTSConfig;
|
|
42
|
-
private mergeExcludePatterns;
|
|
43
|
-
private readGitignorePatterns;
|
|
44
|
-
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { RouteInfo, ComponentInfo } from './analyzer-types.js';
|
|
2
|
+
export interface ProjectInfo {
|
|
3
|
+
name: string;
|
|
4
|
+
version?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
type: 'typescript' | 'javascript' | 'mixed';
|
|
7
|
+
category: ProjectCategory;
|
|
8
|
+
packageManager: 'unknown' | 'npm' | 'yarn' | 'pnpm' | 'bun';
|
|
9
|
+
framework?: FrameworkInfo;
|
|
10
|
+
buildTool?: BuildToolInfo;
|
|
11
|
+
dependencies: Record<string, string>;
|
|
12
|
+
devDependencies: Record<string, string>;
|
|
13
|
+
scripts?: Record<string, string>;
|
|
14
|
+
entryPoints?: string[];
|
|
15
|
+
outputTargets?: string[];
|
|
16
|
+
}
|
|
17
|
+
export type ProjectCategory = 'backend-api' | 'frontend-web' | 'frontend-mobile' | 'npm-package' | 'monorepo' | 'cli-tool' | 'desktop-app' | 'fullstack' | 'unknown';
|
|
18
|
+
export interface FrameworkInfo {
|
|
19
|
+
name: string;
|
|
20
|
+
version?: string;
|
|
21
|
+
features: string[];
|
|
22
|
+
routes?: RouteInfo[];
|
|
23
|
+
components?: ComponentInfo[];
|
|
24
|
+
}
|
|
25
|
+
export interface BuildToolInfo {
|
|
26
|
+
name: string;
|
|
27
|
+
version?: string;
|
|
28
|
+
configFiles: string[];
|
|
29
|
+
features: string[];
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types/index.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { ParsemeGenerator } from './generator.js';
|
|
2
|
-
export { ParsemeConfig } from './config.js';
|
|
3
|
-
export type { GeneratorOptions, ContextOutput, ProjectInfo, FrameworkInfo, RouteInfo, FileAnalysis, GitInfo, } from './types.js';
|
|
4
|
-
export type { ParsemeConfigFile } from './config.js';
|
|
1
|
+
export { ParsemeGenerator } from './core/generator.js';
|
|
2
|
+
export { ParsemeConfig } from './core/config.js';
|
|
3
|
+
export type { GeneratorOptions, ContextOutput, ProjectInfo, FrameworkInfo, RouteInfo, FileAnalysis, GitInfo, ParsemeConfigFile, } from './core/types.js';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Main exports for the parseme package
|
|
2
|
-
export { ParsemeGenerator } from './generator.js';
|
|
3
|
-
export { ParsemeConfig } from './config.js';
|
|
2
|
+
export { ParsemeGenerator } from './core/generator.js';
|
|
3
|
+
export { ParsemeConfig } from './core/config.js';
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parseme/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Adds a PARSEME.md file—a README.md for AI agents—to your project, providing context and structure for automated tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"parseme": "dist/cli.js"
|
|
9
|
+
"parseme": "dist/cli/cli.js"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
@@ -24,12 +24,11 @@
|
|
|
24
24
|
"format:check": "prettier . --ignore-unknown --check",
|
|
25
25
|
"lint": "eslint --config ./eslint.config.js --fix",
|
|
26
26
|
"lint:check": "eslint --config ./eslint.config.js --no-fix --max-warnings 0",
|
|
27
|
-
"test": "node --test --experimental-test-coverage tests/**/*.test.ts",
|
|
27
|
+
"test": "node --test --experimental-test-coverage 'tests/**/*.test.ts'",
|
|
28
28
|
"test:unit": "node --test tests/unit/**/*.test.ts",
|
|
29
29
|
"test:integration": "node --test tests/integration/**/*.test.ts",
|
|
30
30
|
"test:watch": "node --test --watch tests/**/*.test.ts",
|
|
31
31
|
"test:coverage": "node --test --experimental-test-coverage tests/**/*.test.ts",
|
|
32
|
-
"prepare": "npm run build",
|
|
33
32
|
"clean": "rm -rf dist"
|
|
34
33
|
},
|
|
35
34
|
"keywords": [
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ParsemeConfig } from '../config.js';
|
|
2
|
-
import type { GitInfo } from '../types.js';
|
|
3
|
-
export declare class GitAnalyzer {
|
|
4
|
-
private readonly config;
|
|
5
|
-
constructor(config: ParsemeConfig);
|
|
6
|
-
analyze(rootDir: string): Promise<GitInfo | undefined>;
|
|
7
|
-
private getCurrentBranch;
|
|
8
|
-
private getLastCommit;
|
|
9
|
-
private getStatus;
|
|
10
|
-
private getChangedFiles;
|
|
11
|
-
getFileLastModified(filePath: string, rootDir: string): Promise<string | undefined>;
|
|
12
|
-
getFileHistory(filePath: string, rootDir: string, limit?: number): Promise<string[]>;
|
|
13
|
-
}
|
package/dist/types.d.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { ServiceInfo, ModelInfo, ConfigInfo, MiddlewareInfo, UtilityInfo } from './analyzers/pattern-detector.js';
|
|
2
|
-
export type { ServiceInfo, ModelInfo, ConfigInfo, MiddlewareInfo, UtilityInfo };
|
|
3
|
-
export interface GeneratorOptions {
|
|
4
|
-
rootDir?: string;
|
|
5
|
-
includeGitInfo?: boolean;
|
|
6
|
-
maxDepth?: number;
|
|
7
|
-
excludePatterns?: string[];
|
|
8
|
-
includePatterns?: string[];
|
|
9
|
-
}
|
|
10
|
-
export interface ProjectInfo {
|
|
11
|
-
name: string;
|
|
12
|
-
version?: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
type: 'typescript' | 'javascript' | 'mixed';
|
|
15
|
-
category: ProjectCategory;
|
|
16
|
-
packageManager: 'npm' | 'yarn' | 'pnpm' | 'bun';
|
|
17
|
-
framework?: FrameworkInfo;
|
|
18
|
-
buildTool?: BuildToolInfo;
|
|
19
|
-
dependencies: Record<string, string>;
|
|
20
|
-
devDependencies: Record<string, string>;
|
|
21
|
-
scripts?: Record<string, string>;
|
|
22
|
-
entryPoints?: string[];
|
|
23
|
-
outputTargets?: string[];
|
|
24
|
-
}
|
|
25
|
-
export type ProjectCategory = 'backend-api' | 'frontend-web' | 'frontend-mobile' | 'npm-package' | 'monorepo' | 'cli-tool' | 'desktop-app' | 'fullstack' | 'unknown';
|
|
26
|
-
export interface BuildToolInfo {
|
|
27
|
-
name: string;
|
|
28
|
-
version?: string;
|
|
29
|
-
configFiles: string[];
|
|
30
|
-
features: string[];
|
|
31
|
-
}
|
|
32
|
-
export interface FrameworkInfo {
|
|
33
|
-
name: string;
|
|
34
|
-
version?: string;
|
|
35
|
-
features: string[];
|
|
36
|
-
routes?: RouteInfo[];
|
|
37
|
-
components?: ComponentInfo[];
|
|
38
|
-
}
|
|
39
|
-
export interface RouteInfo {
|
|
40
|
-
method: string;
|
|
41
|
-
path: string;
|
|
42
|
-
handler: string;
|
|
43
|
-
middleware?: string[];
|
|
44
|
-
file: string;
|
|
45
|
-
line: number;
|
|
46
|
-
}
|
|
47
|
-
export interface ComponentInfo {
|
|
48
|
-
name: string;
|
|
49
|
-
file: string;
|
|
50
|
-
line: number;
|
|
51
|
-
}
|
|
52
|
-
export interface FileAnalysis {
|
|
53
|
-
path: string;
|
|
54
|
-
type: 'route' | 'middleware' | 'model' | 'service' | 'utility' | 'config' | 'test' | 'component';
|
|
55
|
-
framework?: string;
|
|
56
|
-
exports: string[];
|
|
57
|
-
imports: string[];
|
|
58
|
-
functions: string[];
|
|
59
|
-
classes: string[];
|
|
60
|
-
routes?: RouteInfo[];
|
|
61
|
-
components?: ComponentInfo[];
|
|
62
|
-
services?: ServiceInfo[];
|
|
63
|
-
models?: ModelInfo[];
|
|
64
|
-
configs?: ConfigInfo[];
|
|
65
|
-
middleware?: MiddlewareInfo[];
|
|
66
|
-
utilities?: UtilityInfo[];
|
|
67
|
-
}
|
|
68
|
-
export interface ContextOutput {
|
|
69
|
-
parseme: string;
|
|
70
|
-
context?: {
|
|
71
|
-
structure: string;
|
|
72
|
-
routes: string;
|
|
73
|
-
dependencies: string;
|
|
74
|
-
[key: string]: string;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
export interface GitInfo {
|
|
78
|
-
branch: string;
|
|
79
|
-
lastCommit: string;
|
|
80
|
-
changedFiles: string[];
|
|
81
|
-
status: 'clean' | 'dirty';
|
|
82
|
-
}
|
package/dist/types.js
DELETED
|
File without changes
|
|
File without changes
|