@eldrforge/commands-git 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,7 @@
1
+ export { execute as commit } from './commands/commit';
2
+ export { execute as precommit } from './commands/precommit';
3
+ export { execute as clean } from './commands/clean';
4
+ export { execute as review } from './commands/review';
5
+ export * from './util/precommitOptimizations';
6
+ export * from './util/performance';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,25 @@
1
+ export declare class PerformanceTimer {
2
+ private startTime;
3
+ private logger;
4
+ constructor(logger: any);
5
+ static start(logger: any, operation: string): PerformanceTimer;
6
+ end(operation: string): number;
7
+ }
8
+ export interface PackageJson {
9
+ name?: string;
10
+ dependencies?: Record<string, string>;
11
+ devDependencies?: Record<string, string>;
12
+ peerDependencies?: Record<string, string>;
13
+ }
14
+ export interface PackageJsonLocation {
15
+ path: string;
16
+ packageJson: PackageJson;
17
+ relativePath: string;
18
+ }
19
+ export declare const batchReadPackageJsonFiles: (packageJsonPaths: string[], storage: any, rootDir: string) => Promise<PackageJsonLocation[]>;
20
+ export declare const findAllPackageJsonFiles: (rootDir: string, storage: any) => Promise<PackageJsonLocation[]>;
21
+ export declare const scanDirectoryForPackages: (rootDir: string, storage: any) => Promise<Map<string, string>>;
22
+ export declare const findPackagesByScope: (dependencies: Record<string, string>, scopeRoots: Record<string, string>, storage: any) => Promise<Map<string, string>>;
23
+ export declare const collectAllDependencies: (packageJsonFiles: PackageJsonLocation[]) => Record<string, string>;
24
+ export declare const checkForFileDependencies: (packageJsonFiles: PackageJsonLocation[]) => void;
25
+ //# sourceMappingURL=performance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../src/util/performance.ts"],"names":[],"mappings":"AAMA,qBAAa,gBAAgB;IACzB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAM;gBAER,MAAM,EAAE,GAAG;IAKvB,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAK9D,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;CAKjC;AAED,MAAM,WAAW,WAAW;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACxB;AAiBD,eAAO,MAAM,yBAAyB,GAClC,kBAAkB,MAAM,EAAE,EAC1B,SAAS,GAAG,EACZ,SAAS,MAAM,KAChB,OAAO,CAAC,mBAAmB,EAAE,CA2B/B,CAAC;AAGF,eAAO,MAAM,uBAAuB,GAAU,SAAS,MAAM,EAAE,SAAS,GAAG,KAAG,OAAO,CAAC,mBAAmB,EAAE,CAwE1G,CAAC;AAGF,eAAO,MAAM,wBAAwB,GAAU,SAAS,MAAM,EAAE,SAAS,GAAG,KAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA4EzG,CAAC;AAGF,eAAO,MAAM,mBAAmB,GAC5B,cAAc,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,YAAY,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,SAAS,GAAG,KACb,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAmD7B,CAAC;AAGF,eAAO,MAAM,sBAAsB,GAAI,kBAAkB,mBAAmB,EAAE,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAarG,CAAC;AAGF,eAAO,MAAM,wBAAwB,GAAI,kBAAkB,mBAAmB,EAAE,KAAG,IA2ClF,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Check if dist directory needs to be cleaned (is outdated compared to source files)
3
+ */
4
+ export declare function isCleanNeeded(packageDir: string): Promise<{
5
+ needed: boolean;
6
+ reason: string;
7
+ }>;
8
+ /**
9
+ * Check if tests need to be run (source files changed since last test run)
10
+ */
11
+ export declare function isTestNeeded(packageDir: string): Promise<{
12
+ needed: boolean;
13
+ reason: string;
14
+ }>;
15
+ /**
16
+ * Record that tests were run for this package
17
+ */
18
+ export declare function recordTestRun(packageDir: string): Promise<void>;
19
+ /**
20
+ * Optimize a precommit command by skipping unnecessary steps
21
+ * Returns the optimized command and information about what was skipped
22
+ */
23
+ export declare function optimizePrecommitCommand(packageDir: string, originalCommand: string, options?: {
24
+ skipClean?: boolean;
25
+ skipTest?: boolean;
26
+ }): Promise<{
27
+ optimizedCommand: string;
28
+ skipped: {
29
+ clean: boolean;
30
+ test: boolean;
31
+ };
32
+ reasons: {
33
+ clean?: string;
34
+ test?: string;
35
+ };
36
+ }>;
37
+ //# sourceMappingURL=precommitOptimizations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"precommitOptimizations.d.ts","sourceRoot":"","sources":["../../../src/util/precommitOptimizations.ts"],"names":[],"mappings":"AA4GA;;GAEG;AACH,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAwEpG;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAwBnG;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAerE;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC1C,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,MAAM,EACvB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GAC1D,OAAO,CAAC;IACP,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE;QACL,KAAK,EAAE,OAAO,CAAC;QACf,IAAI,EAAE,OAAO,CAAC;KACjB,CAAC;IACF,OAAO,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACL,CAAC,CAiDD"}
package/guide/index.md ADDED
@@ -0,0 +1,48 @@
1
+ # @eldrforge/commands-git - Agentic Guide
2
+
3
+ ## Purpose
4
+
5
+ Git workflow commands for kodrdriv: commit, precommit, clean, review.
6
+
7
+ ## Commands
8
+
9
+ - `commit` - Create AI-generated commits with agentic workflow
10
+ - `precommit` - Pre-commit validation with smart caching
11
+ - `clean` - Clean up generated files
12
+ - `review` - Review changes and create GitHub issues
13
+
14
+ ## Usage
15
+
16
+ ```typescript
17
+ import * as Git from '@eldrforge/commands-git';
18
+
19
+ // Execute commands with config
20
+ await Git.commit(config);
21
+ await Git.precommit(config);
22
+ await Git.clean(config);
23
+ await Git.review(config);
24
+ ```
25
+
26
+ ## Dependencies
27
+
28
+ - @eldrforge/core - Shared infrastructure
29
+ - @eldrforge/git-tools - Git operations
30
+ - @eldrforge/github-tools - GitHub API
31
+ - @eldrforge/ai-service - AI/LLM integration
32
+ - @eldrforge/shared - Shared utilities
33
+
34
+ ## Package Structure
35
+
36
+ ```
37
+ src/
38
+ ├── commands/
39
+ │ ├── commit.ts # AI-powered commits
40
+ │ ├── precommit.ts # Validation checks
41
+ │ ├── clean.ts # Cleanup
42
+ │ └── review.ts # Code review
43
+ ├── util/
44
+ │ ├── precommitOptimizations.ts
45
+ │ └── performance.ts
46
+ └── index.ts
47
+ ```
48
+
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@eldrforge/commands-git",
3
+ "version": "0.1.0",
4
+ "description": "Git workflow commands for kodrdriv",
5
+ "main": "dist/index.js",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/index.js",
10
+ "types": "./dist/index.d.ts"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "guide"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/grunnverk/commands-git.git"
20
+ },
21
+ "scripts": {
22
+ "build": "npm run lint && tsc --noEmit && vite build",
23
+ "dev": "vite",
24
+ "watch": "vite build --watch",
25
+ "test": "vitest run --coverage",
26
+ "lint": "eslint . --ext .ts",
27
+ "lint:fix": "eslint . --ext .ts --fix",
28
+ "clean": "rm -rf dist",
29
+ "precommit": "npm run clean && npm run build && npm run lint && npm run test",
30
+ "prepublishOnly": "npm run clean && npm run lint && npm run build && npm run test"
31
+ },
32
+ "keywords": [
33
+ "kodrdriv",
34
+ "git",
35
+ "commands",
36
+ "workflow",
37
+ "automation"
38
+ ],
39
+ "author": "Tim O'Brien <tobrien@discursive.com>",
40
+ "license": "Apache-2.0",
41
+ "dependencies": {
42
+ "@eldrforge/core": "^0.1.0",
43
+ "@eldrforge/git-tools": "^0.1.16",
44
+ "@eldrforge/github-tools": "^0.1.18",
45
+ "@eldrforge/ai-service": "^0.1.17",
46
+ "@eldrforge/shared": "^0.1.6",
47
+ "@riotprompt/riotprompt": "^0.0.10",
48
+ "dotenv": "^16.4.7",
49
+ "openai": "^4.87.3",
50
+ "shell-escape": "^0.2.0"
51
+ },
52
+ "devDependencies": {
53
+ "@eslint/eslintrc": "^3.3.1",
54
+ "@eslint/js": "^9.33.0",
55
+ "@swc/core": "^1.13.3",
56
+ "@types/node": "^25.0.3",
57
+ "@types/shell-escape": "^0.2.3",
58
+ "@typescript-eslint/eslint-plugin": "^8.39.1",
59
+ "@typescript-eslint/parser": "^8.39.1",
60
+ "@vitest/coverage-v8": "^4.0.13",
61
+ "esbuild": "0.25.10",
62
+ "eslint": "^9.33.0",
63
+ "eslint-plugin-import": "^2.32.0",
64
+ "globals": "^16.3.0",
65
+ "mockdate": "^3.0.5",
66
+ "typescript": "^5.9.2",
67
+ "vite": "^7.1.2",
68
+ "vite-plugin-dts": "^4.3.0",
69
+ "vite-plugin-node": "^7.0.0",
70
+ "vitest": "^4.0.13"
71
+ }
72
+ }
73
+