@shapeshift-labs/frontier-lang-compiler 0.2.129 → 0.2.130

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 CHANGED
@@ -170,7 +170,7 @@ small and dependency-free. They cover accepted projection/replay cases, exact
170
170
  source preservation, generated/source-map boundaries, safe import/declaration
171
171
  merges, safe unordered member merges, composed top-level/member safe merges,
172
172
  and rejected unsafe cases such as stale
173
- ledger spans, import specifier reordering, computed keys, duplicate exported
173
+ ledger spans, import specifier removals, computed keys, duplicate exported
174
174
  names, duplicate object members, decorators, overload anchors, and same-anchor
175
175
  edit conflicts. Fixture failures include the fixture id and the actual
176
176
  reason-code or gate values so distributed swarm evidence can point at a stable
@@ -103,34 +103,27 @@ function analyzeImportStatementChange(baseEntry, variantEntry, side, context) {
103
103
 
104
104
  const baseSpecifiers = baseImport.specifiers;
105
105
  const variantSpecifiers = variantImport.specifiers;
106
- if (variantSpecifiers.length < baseSpecifiers.length) {
106
+ const baseSpecifiersByCanonical = new Set(baseSpecifiers.map((specifier) => specifier.canonical));
107
+ const variantSpecifiersByCanonical = new Set(variantSpecifiers.map((specifier) => specifier.canonical));
108
+ const missingBaseSpecifiers = baseSpecifiers.filter((specifier) => !variantSpecifiersByCanonical.has(specifier.canonical));
109
+ if (missingBaseSpecifiers.length) {
107
110
  addConflict(context, {
108
111
  code: JsTsSafeMergeConflictCodes.importSpecifierRemoved,
109
112
  gateId: JsTsSafeMergeGateIds.independentImportSpecifiers,
110
113
  side,
111
114
  message: `${side} source removes import specifiers.`,
112
- details: { key: baseEntry.key }
115
+ details: {
116
+ key: baseEntry.key,
117
+ missing: missingBaseSpecifiers.map((specifier) => specifier.canonical)
118
+ }
113
119
  });
114
120
  return [];
115
121
  }
116
- for (let index = 0; index < baseSpecifiers.length; index += 1) {
117
- if (variantSpecifiers[index]?.canonical !== baseSpecifiers[index].canonical) {
118
- addConflict(context, {
119
- code: JsTsSafeMergeConflictCodes.importSpecifierReordered,
120
- gateId: JsTsSafeMergeGateIds.independentImportSpecifiers,
121
- side,
122
- message: `${side} source reorders or changes existing import specifiers.`,
123
- details: {
124
- key: baseEntry.key,
125
- expected: baseSpecifiers.map((specifier) => specifier.canonical),
126
- actual: variantSpecifiers.map((specifier) => specifier.canonical)
127
- }
128
- });
129
- return [];
130
- }
131
- }
132
- const additions = variantSpecifiers.slice(baseSpecifiers.length);
122
+ const additions = variantSpecifiers.filter((specifier) => !baseSpecifiersByCanonical.has(specifier.canonical));
133
123
  if (additions.length === 0 && !sameStatementText(baseEntry.text, variantEntry.text)) {
124
+ const baseCanonicalOrder = baseSpecifiers.map((specifier) => specifier.canonical);
125
+ const variantCanonicalOrder = variantSpecifiers.map((specifier) => specifier.canonical);
126
+ if (!arraysEqual(baseCanonicalOrder, variantCanonicalOrder)) return [];
134
127
  addConflict(context, {
135
128
  code: JsTsSafeMergeConflictCodes.importFormattingChanged,
136
129
  gateId: JsTsSafeMergeGateIds.independentImportSpecifiers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshift-labs/frontier-lang-compiler",
3
- "version": "0.2.129",
3
+ "version": "0.2.130",
4
4
  "description": "Compiler facade for Frontier Lang source documents and language projection adapters.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",