@adhdev/mesh-shared 1.0.58-rc.99 → 1.0.58
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/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -5
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +4 -3
- package/package.json +1 -1
- package/src/git-normalize.ts +5 -4
- package/src/types.ts +4 -3
package/dist/index.mjs
CHANGED
|
@@ -76,9 +76,10 @@ function readGitSubmodules(value, parentRepoRoot) {
|
|
|
76
76
|
path,
|
|
77
77
|
commit,
|
|
78
78
|
dirty: readBoolean(submodule.dirty) ?? false,
|
|
79
|
-
outOfSync: readBoolean(submodule.outOfSync, submodule.out_of_sync) ?? false
|
|
80
|
-
lastCheckedAt: readNumber(submodule.lastCheckedAt, submodule.last_checked_at) ?? Date.now()
|
|
79
|
+
outOfSync: readBoolean(submodule.outOfSync, submodule.out_of_sync) ?? false
|
|
81
80
|
};
|
|
81
|
+
const lastCheckedAt = readNumber(submodule.lastCheckedAt, submodule.last_checked_at);
|
|
82
|
+
if (lastCheckedAt !== void 0) result.lastCheckedAt = lastCheckedAt;
|
|
82
83
|
if (repoPath) result.repoPath = repoPath;
|
|
83
84
|
const error = readString(submodule.error);
|
|
84
85
|
if (error) result.error = error;
|
|
@@ -117,6 +118,7 @@ function normalizeGitStatus(status, node, options) {
|
|
|
117
118
|
const untracked = readNumber(status.untracked) ?? 0;
|
|
118
119
|
const deleted = readNumber(status.deleted) ?? 0;
|
|
119
120
|
const renamed = readNumber(status.renamed) ?? 0;
|
|
121
|
+
const lastCheckedAt = options?.lastCheckedAt ?? readNumber(status.lastCheckedAt, status.last_checked_at);
|
|
120
122
|
return {
|
|
121
123
|
workspace: readString(status.workspace, node.workspace) || "",
|
|
122
124
|
repoRoot: repoRoot ?? null,
|
|
@@ -139,7 +141,7 @@ function normalizeGitStatus(status, node, options) {
|
|
|
139
141
|
hasConflicts,
|
|
140
142
|
conflictFiles,
|
|
141
143
|
stashCount: readNumber(status.stashCount, status.stash_count) ?? 0,
|
|
142
|
-
lastCheckedAt
|
|
144
|
+
...lastCheckedAt !== void 0 ? { lastCheckedAt } : {},
|
|
143
145
|
...submodules ? { submodules } : {},
|
|
144
146
|
// Deploy-lag visibility: daemonBuildBehind is computed by the reporting
|
|
145
147
|
// daemon's git probe (build commit vs workspace/submodule HEAD). It must
|
|
@@ -175,10 +177,9 @@ function pickBestTransitGitStatus(node, options) {
|
|
|
175
177
|
const probeGitResult = readRecord(probeGit.result);
|
|
176
178
|
const probeDirectStatus = readRecord(probeGit.status);
|
|
177
179
|
const probeNestedStatus = readRecord(probeGitResult.status);
|
|
178
|
-
const lastCheckedAt = options?.lastCheckedAt;
|
|
179
180
|
let best = null;
|
|
180
181
|
for (const status of [directStatus, nestedStatus, probeDirectStatus, probeNestedStatus]) {
|
|
181
|
-
const normalized = normalizeGitStatus(status, node,
|
|
182
|
+
const normalized = normalizeGitStatus(status, node, options);
|
|
182
183
|
if (!normalized) continue;
|
|
183
184
|
const score = scoreGitStatusCandidate(normalized);
|
|
184
185
|
if (!best || score > best.score) best = { git: normalized, score };
|