@shapeshift-labs/frontier-lang-compiler 0.2.133 → 0.2.134
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/README.md +3 -1
- package/dist/js-ts-safe-merge-composed.js +22 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -194,7 +194,9 @@ generic semantic edit script path. The fallback admits the merge only after the
|
|
|
194
194
|
script is an auto-merge candidate, the source projection succeeds, replay on
|
|
195
195
|
current head is `accepted-clean`, and replay on the projected source is
|
|
196
196
|
`already-applied`. Same-anchor head edits, stale anchors, and non-body conflicts
|
|
197
|
-
remain blocked for review.
|
|
197
|
+
remain blocked for review. The same fallback composes with declared unordered
|
|
198
|
+
member-addition regions, so a verified body edit can still merge alongside safe
|
|
199
|
+
interface, type, class, or object member additions.
|
|
198
200
|
|
|
199
201
|
Project-level JS/TS safe merges compose the same file-level gates across a
|
|
200
202
|
base/worker/head file set. They preserve head-only files, admit worker-only
|
|
@@ -25,12 +25,16 @@ function safeMergeJsTsSource(input = {}) {
|
|
|
25
25
|
return composedBlockedResult(input, 'member-analysis', memberNeutralization.result, memberNeutralization.analysis);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const topLevelInput = {
|
|
29
29
|
...input,
|
|
30
30
|
baseSourceText: memberNeutralization.baseSourceText,
|
|
31
31
|
workerSourceText: memberNeutralization.workerSourceText,
|
|
32
32
|
headSourceText: memberNeutralization.headSourceText
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
|
+
const topLevelLedgerResult = safeMergeJsTsImportsAndDeclarations(topLevelInput);
|
|
35
|
+
const topLevelResult = topLevelLedgerResult.status === JsTsSafeMergeStatuses.merged
|
|
36
|
+
? topLevelLedgerResult
|
|
37
|
+
: semanticEditFallbackResult(topLevelInput, topLevelLedgerResult);
|
|
34
38
|
if (topLevelResult.status !== JsTsSafeMergeStatuses.merged) {
|
|
35
39
|
return composedBlockedResult(input, 'top-level', topLevelResult, memberNeutralization.analysis);
|
|
36
40
|
}
|
|
@@ -61,7 +65,7 @@ function safeMergeJsTsSource(input = {}) {
|
|
|
61
65
|
metadata: {
|
|
62
66
|
...topLevelResult.metadata,
|
|
63
67
|
composed: {
|
|
64
|
-
phases:
|
|
68
|
+
phases: composedPhaseList(topLevelResult),
|
|
65
69
|
memberRegions: memberNeutralization.analysis.preparedRegions.map((region) => ({
|
|
66
70
|
kind: region.kind,
|
|
67
71
|
name: region.name,
|
|
@@ -78,6 +82,13 @@ function safeMergeJsTsSource(input = {}) {
|
|
|
78
82
|
};
|
|
79
83
|
}
|
|
80
84
|
|
|
85
|
+
function composedPhaseList(topLevelResult) {
|
|
86
|
+
const topLevelPhases = topLevelResult.metadata?.composed?.phases;
|
|
87
|
+
if (Array.isArray(topLevelPhases) && topLevelPhases.length) return [...topLevelPhases, 'member'];
|
|
88
|
+
const topLevelPhase = topLevelResult.metadata?.composed?.phase;
|
|
89
|
+
return topLevelPhase ? [topLevelPhase, 'member'] : ['top-level', 'member'];
|
|
90
|
+
}
|
|
91
|
+
|
|
81
92
|
function hasMemberMergePolicy(input) {
|
|
82
93
|
const policy = input.policy ?? input.mergePolicy ?? input;
|
|
83
94
|
const regions = Array.isArray(policy)
|
|
@@ -119,14 +130,20 @@ function composedBlockedResult(input, phase, result, memberAnalysis) {
|
|
|
119
130
|
gatesPassed: result.gates?.filter((gate) => gate.status === 'passed').length ?? 0,
|
|
120
131
|
memberRegions: memberAnalysis?.preparedRegions?.length ?? 0,
|
|
121
132
|
memberAdditions: 0,
|
|
133
|
+
semanticEditOperations: result.summary?.semanticEditOperations,
|
|
134
|
+
semanticEditAppliedOperations: result.summary?.semanticEditAppliedOperations,
|
|
135
|
+
semanticEditReplayStatus: result.summary?.semanticEditReplayStatus,
|
|
122
136
|
composedPhases: phase === 'top-level' ? 2 : 1
|
|
123
137
|
},
|
|
124
138
|
metadata: {
|
|
125
139
|
composed: {
|
|
126
140
|
phase,
|
|
127
|
-
sourceKind: result.kind
|
|
141
|
+
sourceKind: result.kind,
|
|
142
|
+
topLevelPhase: result.metadata?.composed?.phase,
|
|
143
|
+
topLevelPhases: result.metadata?.composed?.phases
|
|
128
144
|
}
|
|
129
|
-
}
|
|
145
|
+
},
|
|
146
|
+
semanticArtifacts: result.semanticArtifacts
|
|
130
147
|
};
|
|
131
148
|
}
|
|
132
149
|
|
package/package.json
CHANGED