@vibe-validate/git 0.19.0-rc.4 → 0.19.0-rc.6
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/dist/tree-hash.d.ts +22 -39
- package/dist/tree-hash.d.ts.map +1 -1
- package/dist/tree-hash.js +34 -68
- package/dist/tree-hash.js.map +1 -1
- package/dist/types.d.ts +9 -21
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/tree-hash.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import type { TreeHash, TreeHashResult } from './types.js';
|
|
|
20
20
|
* 3. Mark untracked files with --intent-to-add in temp index
|
|
21
21
|
* 4. Calculate tree hash with git write-tree using temp index
|
|
22
22
|
* 5. Detect and process git submodules (recursive)
|
|
23
|
-
* 6.
|
|
23
|
+
* 6. Return parent hash + optional submodule hashes
|
|
24
24
|
* 7. Clean up temp index file
|
|
25
25
|
*
|
|
26
26
|
* Why this is better than git stash create:
|
|
@@ -30,29 +30,39 @@ import type { TreeHash, TreeHashResult } from './types.js';
|
|
|
30
30
|
* Submodule Support (Issue #120):
|
|
31
31
|
* - Detects submodules via `git submodule status`
|
|
32
32
|
* - Recursively calculates tree hash for each submodule
|
|
33
|
-
* -
|
|
33
|
+
* - Returns TreeHashResult with parent hash + submodule hashes
|
|
34
34
|
* - Working tree changes in submodules invalidate cache
|
|
35
|
+
* - Git notes store full result for state reconstruction
|
|
36
|
+
*
|
|
37
|
+
* IMPORTANT: This function returns a structured result object, NOT a composite hash.
|
|
38
|
+
* Git notes store the TreeHashResult as-is. The hash field is the parent repo's
|
|
39
|
+
* standard Git SHA-1 hash (40 hex characters). The optional submoduleHashes field
|
|
40
|
+
* records each submodule's tree hash separately.
|
|
41
|
+
*
|
|
42
|
+
* Cache key format in git notes (v0.19.0+):
|
|
43
|
+
* - Parent-only repos: Use parent hash directly (backward compatible)
|
|
44
|
+
* - Repos with submodules: Use parent hash + submodule metadata
|
|
45
|
+
* - Result structure stored in git notes for state reconstruction
|
|
35
46
|
*
|
|
36
47
|
* CRITICAL: Uses GIT_INDEX_FILE to avoid corrupting real index during git commit hooks
|
|
37
48
|
*
|
|
38
49
|
* @returns TreeHashResult containing:
|
|
39
|
-
* - hash:
|
|
40
|
-
* -
|
|
50
|
+
* - hash: Parent repository tree hash (Git SHA-1, 40 hex chars)
|
|
51
|
+
* - submoduleHashes: Optional record of submodule paths to tree hashes
|
|
41
52
|
*
|
|
42
53
|
* @example
|
|
43
|
-
* // Repository without submodules
|
|
54
|
+
* // Repository without submodules (0.18.x compatible)
|
|
44
55
|
* const result = await getGitTreeHash();
|
|
45
|
-
* // { hash: 'abc123...'
|
|
56
|
+
* // { hash: 'abc123...' }
|
|
46
57
|
*
|
|
47
58
|
* @example
|
|
48
|
-
* // Repository with submodules
|
|
59
|
+
* // Repository with submodules (v0.19.0+)
|
|
49
60
|
* const result = await getGitTreeHash();
|
|
50
61
|
* // {
|
|
51
|
-
* // hash: '
|
|
52
|
-
* //
|
|
53
|
-
* //
|
|
54
|
-
* //
|
|
55
|
-
* // ]
|
|
62
|
+
* // hash: 'abc123...', // Parent repo hash
|
|
63
|
+
* // submoduleHashes: {
|
|
64
|
+
* // 'libs/auth': 'xyz789...'
|
|
65
|
+
* // }
|
|
56
66
|
* // }
|
|
57
67
|
*
|
|
58
68
|
* @throws Error if not in a git repository or git command fails
|
|
@@ -118,31 +128,4 @@ export declare function getSubmodules(): SubmoduleInfo[];
|
|
|
118
128
|
* @internal Exported for testing
|
|
119
129
|
*/
|
|
120
130
|
export declare function getSubmoduleTreeHash(submodulePath: string): Promise<TreeHashResult>;
|
|
121
|
-
/**
|
|
122
|
-
* Compute composite hash from multiple tree hash components
|
|
123
|
-
*
|
|
124
|
-
* Creates deterministic SHA-256 hash by:
|
|
125
|
-
* 1. Sorting components by path (lexicographic order)
|
|
126
|
-
* 2. Building string: "path:hash+path:hash+..."
|
|
127
|
-
* 3. Hashing with SHA-256
|
|
128
|
-
*
|
|
129
|
-
* This ensures same content always produces same hash regardless of input order.
|
|
130
|
-
*
|
|
131
|
-
* @param components - Array of path and tree hash pairs
|
|
132
|
-
* @returns Composite SHA-256 hash (64 hex characters)
|
|
133
|
-
*
|
|
134
|
-
* @example
|
|
135
|
-
* const components = [
|
|
136
|
-
* { path: '.', treeHash: 'abc123' },
|
|
137
|
-
* { path: 'libs/auth', treeHash: 'def456' }
|
|
138
|
-
* ];
|
|
139
|
-
* const composite = computeCompositeHash(components);
|
|
140
|
-
* // Returns SHA-256('.:abc123+libs/auth:def456')
|
|
141
|
-
*
|
|
142
|
-
* @internal Exported for testing
|
|
143
|
-
*/
|
|
144
|
-
export declare function computeCompositeHash(components: Array<{
|
|
145
|
-
path: string;
|
|
146
|
-
treeHash: TreeHash;
|
|
147
|
-
}>): TreeHash;
|
|
148
131
|
//# sourceMappingURL=tree-hash.d.ts.map
|
package/dist/tree-hash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-hash.d.ts","sourceRoot":"","sources":["../src/tree-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"tree-hash.d.ts","sourceRoot":"","sources":["../src/tree-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA+G3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH,wBAAsB,cAAc,IAAI,OAAO,CAAC,cAAc,CAAC,CA6H9D;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,QAAQ,CAAC,CAUzD;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAS9D;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,IAAI,aAAa,EAAE,CA2B/C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CASzF"}
|
package/dist/tree-hash.js
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* git stash create includes timestamps, making hashes non-deterministic.
|
|
11
11
|
* git write-tree produces content-based hashes only (no timestamps).
|
|
12
12
|
*/
|
|
13
|
-
import { createHash } from 'node:crypto';
|
|
14
13
|
import { copyFileSync, existsSync, unlinkSync, readdirSync, statSync } from 'node:fs';
|
|
15
14
|
import { join } from 'node:path';
|
|
16
15
|
import { isProcessRunning } from '@vibe-validate/utils';
|
|
@@ -126,7 +125,7 @@ function cleanupStaleIndexes(gitDir) {
|
|
|
126
125
|
* 3. Mark untracked files with --intent-to-add in temp index
|
|
127
126
|
* 4. Calculate tree hash with git write-tree using temp index
|
|
128
127
|
* 5. Detect and process git submodules (recursive)
|
|
129
|
-
* 6.
|
|
128
|
+
* 6. Return parent hash + optional submodule hashes
|
|
130
129
|
* 7. Clean up temp index file
|
|
131
130
|
*
|
|
132
131
|
* Why this is better than git stash create:
|
|
@@ -136,29 +135,39 @@ function cleanupStaleIndexes(gitDir) {
|
|
|
136
135
|
* Submodule Support (Issue #120):
|
|
137
136
|
* - Detects submodules via `git submodule status`
|
|
138
137
|
* - Recursively calculates tree hash for each submodule
|
|
139
|
-
* -
|
|
138
|
+
* - Returns TreeHashResult with parent hash + submodule hashes
|
|
140
139
|
* - Working tree changes in submodules invalidate cache
|
|
140
|
+
* - Git notes store full result for state reconstruction
|
|
141
|
+
*
|
|
142
|
+
* IMPORTANT: This function returns a structured result object, NOT a composite hash.
|
|
143
|
+
* Git notes store the TreeHashResult as-is. The hash field is the parent repo's
|
|
144
|
+
* standard Git SHA-1 hash (40 hex characters). The optional submoduleHashes field
|
|
145
|
+
* records each submodule's tree hash separately.
|
|
146
|
+
*
|
|
147
|
+
* Cache key format in git notes (v0.19.0+):
|
|
148
|
+
* - Parent-only repos: Use parent hash directly (backward compatible)
|
|
149
|
+
* - Repos with submodules: Use parent hash + submodule metadata
|
|
150
|
+
* - Result structure stored in git notes for state reconstruction
|
|
141
151
|
*
|
|
142
152
|
* CRITICAL: Uses GIT_INDEX_FILE to avoid corrupting real index during git commit hooks
|
|
143
153
|
*
|
|
144
154
|
* @returns TreeHashResult containing:
|
|
145
|
-
* - hash:
|
|
146
|
-
* -
|
|
155
|
+
* - hash: Parent repository tree hash (Git SHA-1, 40 hex chars)
|
|
156
|
+
* - submoduleHashes: Optional record of submodule paths to tree hashes
|
|
147
157
|
*
|
|
148
158
|
* @example
|
|
149
|
-
* // Repository without submodules
|
|
159
|
+
* // Repository without submodules (0.18.x compatible)
|
|
150
160
|
* const result = await getGitTreeHash();
|
|
151
|
-
* // { hash: 'abc123...'
|
|
161
|
+
* // { hash: 'abc123...' }
|
|
152
162
|
*
|
|
153
163
|
* @example
|
|
154
|
-
* // Repository with submodules
|
|
164
|
+
* // Repository with submodules (v0.19.0+)
|
|
155
165
|
* const result = await getGitTreeHash();
|
|
156
166
|
* // {
|
|
157
|
-
* // hash: '
|
|
158
|
-
* //
|
|
159
|
-
* //
|
|
160
|
-
* //
|
|
161
|
-
* // ]
|
|
167
|
+
* // hash: 'abc123...', // Parent repo hash
|
|
168
|
+
* // submoduleHashes: {
|
|
169
|
+
* // 'libs/auth': 'xyz789...'
|
|
170
|
+
* // }
|
|
162
171
|
* // }
|
|
163
172
|
*
|
|
164
173
|
* @throws Error if not in a git repository or git command fails
|
|
@@ -218,13 +227,15 @@ export async function getGitTreeHash() {
|
|
|
218
227
|
env: tempIndexEnv
|
|
219
228
|
}).stdout.trim();
|
|
220
229
|
// Calculate main repo tree hash
|
|
221
|
-
const
|
|
230
|
+
const parentHash = treeHash;
|
|
222
231
|
// Detect submodules
|
|
223
232
|
const submodules = getSubmodules();
|
|
224
|
-
//
|
|
225
|
-
|
|
226
|
-
{
|
|
227
|
-
|
|
233
|
+
// No submodules - simple case (0.18.x compatible)
|
|
234
|
+
if (submodules.length === 0) {
|
|
235
|
+
return { hash: parentHash };
|
|
236
|
+
}
|
|
237
|
+
// Build submodule hashes record
|
|
238
|
+
const submoduleHashes = {};
|
|
228
239
|
// Add submodule hashes (sorted by path for determinism)
|
|
229
240
|
const sortedSubmodules = submodules.toSorted((a, b) => a.path.localeCompare(b.path));
|
|
230
241
|
for (const sub of sortedSubmodules) {
|
|
@@ -234,8 +245,8 @@ export async function getGitTreeHash() {
|
|
|
234
245
|
}
|
|
235
246
|
try {
|
|
236
247
|
const subResult = await getSubmoduleTreeHash(sub.path);
|
|
237
|
-
//
|
|
238
|
-
|
|
248
|
+
// Store the submodule's hash in the record
|
|
249
|
+
submoduleHashes[sub.path] = subResult.hash;
|
|
239
250
|
}
|
|
240
251
|
catch (error) {
|
|
241
252
|
// Log warning but continue with other submodules
|
|
@@ -243,18 +254,9 @@ export async function getGitTreeHash() {
|
|
|
243
254
|
console.warn(`⚠️ Failed to hash submodule ${sub.path}: ${errorMsg}`);
|
|
244
255
|
}
|
|
245
256
|
}
|
|
246
|
-
// If no submodules, return main hash directly (optimization)
|
|
247
|
-
if (components.length === 1) {
|
|
248
|
-
return {
|
|
249
|
-
hash: mainTreeHash,
|
|
250
|
-
components
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
// Compute composite hash from all components
|
|
254
|
-
const compositeHash = computeCompositeHash(components);
|
|
255
257
|
return {
|
|
256
|
-
hash:
|
|
257
|
-
|
|
258
|
+
hash: parentHash,
|
|
259
|
+
submoduleHashes,
|
|
258
260
|
};
|
|
259
261
|
}
|
|
260
262
|
finally {
|
|
@@ -276,8 +278,7 @@ export async function getGitTreeHash() {
|
|
|
276
278
|
if (errorMessage.includes('not a git repository')) {
|
|
277
279
|
// Not in git repo - return "unknown" (caller should skip caching)
|
|
278
280
|
return {
|
|
279
|
-
hash: 'unknown'
|
|
280
|
-
components: [{ path: '.', treeHash: 'unknown' }]
|
|
281
|
+
hash: 'unknown'
|
|
281
282
|
};
|
|
282
283
|
}
|
|
283
284
|
// Other git errors
|
|
@@ -388,39 +389,4 @@ export async function getSubmoduleTreeHash(submodulePath) {
|
|
|
388
389
|
process.chdir(originalCwd);
|
|
389
390
|
}
|
|
390
391
|
}
|
|
391
|
-
/**
|
|
392
|
-
* Compute composite hash from multiple tree hash components
|
|
393
|
-
*
|
|
394
|
-
* Creates deterministic SHA-256 hash by:
|
|
395
|
-
* 1. Sorting components by path (lexicographic order)
|
|
396
|
-
* 2. Building string: "path:hash+path:hash+..."
|
|
397
|
-
* 3. Hashing with SHA-256
|
|
398
|
-
*
|
|
399
|
-
* This ensures same content always produces same hash regardless of input order.
|
|
400
|
-
*
|
|
401
|
-
* @param components - Array of path and tree hash pairs
|
|
402
|
-
* @returns Composite SHA-256 hash (64 hex characters)
|
|
403
|
-
*
|
|
404
|
-
* @example
|
|
405
|
-
* const components = [
|
|
406
|
-
* { path: '.', treeHash: 'abc123' },
|
|
407
|
-
* { path: 'libs/auth', treeHash: 'def456' }
|
|
408
|
-
* ];
|
|
409
|
-
* const composite = computeCompositeHash(components);
|
|
410
|
-
* // Returns SHA-256('.:abc123+libs/auth:def456')
|
|
411
|
-
*
|
|
412
|
-
* @internal Exported for testing
|
|
413
|
-
*/
|
|
414
|
-
export function computeCompositeHash(components) {
|
|
415
|
-
// Sort by path for deterministic ordering
|
|
416
|
-
const sorted = [...components].sort((a, b) => a.path.localeCompare(b.path));
|
|
417
|
-
// Build deterministic string: "path:hash+path:hash+..."
|
|
418
|
-
const parts = sorted.map(c => `${c.path}:${c.treeHash}`);
|
|
419
|
-
const combined = parts.join('+');
|
|
420
|
-
// SHA-256 hash for consistent length (64 hex chars)
|
|
421
|
-
const hash = createHash('sha256')
|
|
422
|
-
.update(combined)
|
|
423
|
-
.digest('hex');
|
|
424
|
-
return hash;
|
|
425
|
-
}
|
|
426
392
|
//# sourceMappingURL=tree-hash.js.map
|
package/dist/tree-hash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-hash.js","sourceRoot":"","sources":["../src/tree-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tree-hash.js","sourceRoot":"","sources":["../src/tree-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,wCAAwC;AAEnE;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;AAEtD;;;GAGG;AACH,SAAS,yBAAyB,CAAC,MAAc;IAC/C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;QAC1D,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC;QAEzC,IAAI,KAAK,IAAI,kBAAkB,EAAE,CAAC;YAChC,UAAU,CAAC,QAAQ,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,qCAAqC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpF,CAAC;IAC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AAc,EAAE,CAAC;IAChC,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -45,36 +45,24 @@ export type NotesRef = string & {
|
|
|
45
45
|
/**
|
|
46
46
|
* Result of git tree hash calculation with submodule support
|
|
47
47
|
*
|
|
48
|
-
* Contains both the composite hash (for cache lookups) and individual
|
|
49
|
-
* component hashes (for git operations and debugging).
|
|
50
|
-
*
|
|
51
48
|
* @example
|
|
52
49
|
* // Single repo (no submodules)
|
|
53
|
-
* {
|
|
54
|
-
* hash: 'abc123...',
|
|
55
|
-
* components: [{ path: '.', treeHash: 'abc123...' }]
|
|
56
|
-
* }
|
|
50
|
+
* { hash: 'abc123...' }
|
|
57
51
|
*
|
|
58
52
|
* @example
|
|
59
53
|
* // Repo with submodules
|
|
60
54
|
* {
|
|
61
|
-
* hash: '
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* ]
|
|
55
|
+
* hash: 'abc123...',
|
|
56
|
+
* submoduleHashes: {
|
|
57
|
+
* 'libs/auth': 'def456...',
|
|
58
|
+
* 'vendor/foo': '789ghi...'
|
|
59
|
+
* }
|
|
67
60
|
* }
|
|
68
61
|
*/
|
|
69
62
|
export interface TreeHashResult {
|
|
70
|
-
/**
|
|
63
|
+
/** Root repository tree hash (40-char SHA-1, git object) */
|
|
71
64
|
hash: TreeHash;
|
|
72
|
-
/**
|
|
73
|
-
|
|
74
|
-
/** Path relative to main repo ("." for main, "libs/auth" for submodule) */
|
|
75
|
-
path: string;
|
|
76
|
-
/** Git tree hash for this component */
|
|
77
|
-
treeHash: TreeHash;
|
|
78
|
-
}>;
|
|
65
|
+
/** Submodule tree hashes (path → tree hash mapping). Only present when submodules exist. */
|
|
66
|
+
submoduleHashes?: Record<string, TreeHash>;
|
|
79
67
|
}
|
|
80
68
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAEjE
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAEjE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,IAAI,EAAE,QAAQ,CAAC;IAEf,4FAA4F;IAC5F,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CAC5C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibe-validate/git",
|
|
3
|
-
"version": "0.19.0-rc.
|
|
3
|
+
"version": "0.19.0-rc.6",
|
|
4
4
|
"description": "Git utilities for vibe-validate - tree hash calculation, branch sync, and post-merge cleanup",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"yaml": "^2.8.2",
|
|
42
|
-
"@vibe-validate/utils": "0.19.0-rc.
|
|
42
|
+
"@vibe-validate/utils": "0.19.0-rc.6"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^22.19.2",
|