@dboio/cli 0.9.6 → 0.9.8
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/package.json +1 -1
- package/src/commands/clone.js +3 -7
- package/src/lib/delta.js +29 -3
package/package.json
CHANGED
package/src/commands/clone.js
CHANGED
|
@@ -2533,13 +2533,9 @@ async function processRecord(entityName, record, structure, options, usedNames,
|
|
|
2533
2533
|
meta._contentColumns = ['Content'];
|
|
2534
2534
|
}
|
|
2535
2535
|
|
|
2536
|
-
//
|
|
2537
|
-
//
|
|
2538
|
-
// detection from flagging
|
|
2539
|
-
if (ext && !record.Extension) {
|
|
2540
|
-
meta.Extension = ext;
|
|
2541
|
-
record.Extension = ext;
|
|
2542
|
-
}
|
|
2536
|
+
// Extension was derived from Name/Path for local filename purposes only.
|
|
2537
|
+
// Do NOT write it to metadata or baseline when the server doesn't have it —
|
|
2538
|
+
// this prevents delta detection from flagging a false change on push.
|
|
2543
2539
|
|
|
2544
2540
|
await writeFile(metaPath, JSON.stringify(meta, null, 2) + '\n');
|
|
2545
2541
|
log.dim(` → ${metaPath}`);
|
package/src/lib/delta.js
CHANGED
|
@@ -48,12 +48,31 @@ export function findBaselineEntry(baseline, entity, uid) {
|
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
// Check top-level array first
|
|
51
52
|
const entityArray = baseline.children[entity];
|
|
52
|
-
if (
|
|
53
|
-
|
|
53
|
+
if (Array.isArray(entityArray)) {
|
|
54
|
+
const found = entityArray.find(item => item.UID === uid);
|
|
55
|
+
if (found) return found;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// For output hierarchy entities (output_value, output_value_filter,
|
|
59
|
+
// output_value_entity_column_rel), also search nested inside each
|
|
60
|
+
// output record's .children — server nests them per-output.
|
|
61
|
+
if (entity !== 'output') {
|
|
62
|
+
const outputs = baseline.children.output;
|
|
63
|
+
if (Array.isArray(outputs)) {
|
|
64
|
+
for (const o of outputs) {
|
|
65
|
+
if (!o.children) continue;
|
|
66
|
+
const nested = o.children[entity];
|
|
67
|
+
if (Array.isArray(nested)) {
|
|
68
|
+
const found = nested.find(item => item.UID === uid);
|
|
69
|
+
if (found) return found;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
54
73
|
}
|
|
55
74
|
|
|
56
|
-
return
|
|
75
|
+
return null;
|
|
57
76
|
}
|
|
58
77
|
|
|
59
78
|
/**
|
|
@@ -127,6 +146,13 @@ export async function detectChangedColumns(metaPath, baseline) {
|
|
|
127
146
|
const baselineValue = normalizeValue(baselineEntry[columnName]);
|
|
128
147
|
|
|
129
148
|
if (currentValue !== baselineValue) {
|
|
149
|
+
// Skip Extension column when baseline is null/empty — clone derives
|
|
150
|
+
// it from the filename for local use but it's not a user change.
|
|
151
|
+
if (columnName === 'Extension'
|
|
152
|
+
&& !baselineValue
|
|
153
|
+
&& (baselineEntry[columnName] === null || baselineEntry[columnName] === undefined)) {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
130
156
|
changedColumns.push(columnName);
|
|
131
157
|
}
|
|
132
158
|
}
|