github-lang-stats 0.1.0

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.
@@ -0,0 +1,53 @@
1
+ export interface Repo {
2
+ owner: string;
3
+ name: string;
4
+ }
5
+ export interface CommitSha {
6
+ owner: string;
7
+ repo: string;
8
+ sha: string;
9
+ }
10
+ export interface CommitFileDetail {
11
+ filename: string;
12
+ additions: number;
13
+ deletions: number;
14
+ status: string;
15
+ }
16
+ export interface CommitDetail {
17
+ sha: string;
18
+ files: CommitFileDetail[];
19
+ }
20
+ export interface RepoLanguageStats {
21
+ repo: string;
22
+ languages: Record<string, number>;
23
+ }
24
+ export interface AggregatedStats {
25
+ /** Total lines changed (additions + deletions) per language across all repos */
26
+ totals: Record<string, number>;
27
+ /** Per-repo breakdown: { "owner/repo": { TypeScript: 1234, ... } } */
28
+ byRepo: Record<string, Record<string, number>>;
29
+ /** Metadata */
30
+ meta: {
31
+ user: string;
32
+ generatedAt: string;
33
+ totalCommitsProcessed: number;
34
+ totalRepos: number;
35
+ unit: "lines_changed";
36
+ };
37
+ }
38
+ export interface Cache {
39
+ version: number;
40
+ repos: Repo[];
41
+ /** Repos whose commit SHAs have been fully collected */
42
+ completedRepos: string[];
43
+ /** Map of "owner/repo" → array of commit SHAs */
44
+ commitsByRepo: Record<string, string[]>;
45
+ /** Map of "<sha>" → CommitDetail (or null if 404/error) */
46
+ commitDetails: Record<string, CommitDetail | null>;
47
+ }
48
+ export interface RateLimitInfo {
49
+ limit: number;
50
+ remaining: number;
51
+ reset: number;
52
+ }
53
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,CAAC;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C;IAClB,KAAK,EAAE,MAAM,CAAC;CACd"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "github-lang-stats",
3
+ "version": "0.1.0",
4
+ "description": "CLI that computes per-author GitHub language statistics by sampling commit file changes",
5
+ "type": "module",
6
+ "main": "./dist/lib.js",
7
+ "types": "./dist/lib.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/lib.js",
11
+ "types": "./dist/lib.d.ts"
12
+ }
13
+ },
14
+ "bin": {
15
+ "github-lang-stats": "./dist/index.js",
16
+ "gls": "./dist/index.js"
17
+ },
18
+ "scripts": {
19
+ "build": "tsc",
20
+ "dev": "tsx src/index.ts",
21
+ "start": "node dist/index.js",
22
+ "lint": "biome lint src",
23
+ "lint:fix": "biome check --write src",
24
+ "format": "biome format --write src",
25
+ "prepublishOnly": "npm run build"
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "README.md",
30
+ "LICENSE"
31
+ ],
32
+ "dependencies": {
33
+ "@inquirer/checkbox": "^3.0.1",
34
+ "chalk": "^5.3.0",
35
+ "commander": "^12.1.0",
36
+ "ora": "^8.1.0"
37
+ },
38
+ "devDependencies": {
39
+ "@biomejs/biome": "^2.4.3",
40
+ "@types/node": "^22.0.0",
41
+ "tsx": "^4.19.0",
42
+ "typescript": "^5.6.0"
43
+ },
44
+ "engines": {
45
+ "node": ">=18"
46
+ },
47
+ "keywords": [
48
+ "github",
49
+ "statistics",
50
+ "languages",
51
+ "cli",
52
+ "developer",
53
+ "git"
54
+ ],
55
+ "license": "MIT",
56
+ "publishConfig": {
57
+ "access": "public"
58
+ }
59
+ }