@shapeshift-labs/frontier-lang-compiler 0.2.149 → 0.2.151
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 +315 -9
- package/bench/real-repo-corpus-checkout-identity.mjs +134 -0
- package/bench/real-repo-corpus-checkout-proof.mjs +263 -0
- package/bench/real-repo-corpus-command-execution.mjs +314 -0
- package/bench/real-repo-corpus-evidence.mjs +165 -0
- package/bench/real-repo-corpus-suite.mjs +273 -0
- package/bench/smoke.mjs +109 -7
- package/dist/declarations/import-adapter-core.d.ts +4 -3
- package/dist/declarations/import-adapter-options-native.d.ts +21 -0
- package/dist/declarations/js-ts-project-merge-admission-routes.d.ts +35 -0
- package/dist/declarations/js-ts-project-merge-commonjs-interop.d.ts +29 -0
- package/dist/declarations/js-ts-project-merge-confidence.d.ts +64 -0
- package/dist/declarations/js-ts-project-merge-declaration-emit-parity.d.ts +37 -0
- package/dist/declarations/js-ts-project-merge-declarations.d.ts +65 -0
- package/dist/declarations/js-ts-project-merge-diagnostics.d.ts +97 -0
- package/dist/declarations/js-ts-project-merge-global-augmentation.d.ts +30 -0
- package/dist/declarations/js-ts-project-merge-jsx-render-branch.d.ts +48 -0
- package/dist/declarations/js-ts-project-merge-proof-levels.d.ts +109 -0
- package/dist/declarations/js-ts-project-merge-quality-gates.d.ts +38 -0
- package/dist/declarations/js-ts-project-merge-semantic-equivalence-proof.d.ts +45 -0
- package/dist/declarations/js-ts-project-merge-tsconfig.d.ts +43 -0
- package/dist/declarations/js-ts-safe-merge.d.ts +47 -0
- package/dist/declarations/js-ts-safe-project-merge.d.ts +120 -38
- package/dist/declarations/native-project-compiler-assignability-oracle.d.ts +41 -0
- package/dist/declarations/native-project-compiler-callable-signatures.d.ts +31 -0
- package/dist/declarations/native-project-compiler-class-member-runtime-proof.d.ts +87 -0
- package/dist/declarations/native-project-compiler-composite-types.d.ts +23 -0
- package/dist/declarations/native-project-compiler-enum-proof.d.ts +58 -0
- package/dist/declarations/native-project-compiler-index-signature.d.ts +7 -0
- package/dist/declarations/native-project-compiler-public-api-source-binding.d.ts +8 -0
- package/dist/declarations/native-project-compiler-scope.d.ts +37 -0
- package/dist/declarations/native-project-compiler-type-reference-targets.d.ts +38 -0
- package/dist/declarations/native-project-css-modules.d.ts +90 -0
- package/dist/declarations/native-project-decorator-metadata.d.ts +126 -0
- package/dist/declarations/native-project-jsx-graph.d.ts +313 -0
- package/dist/declarations/native-project-module-declarations.d.ts +52 -0
- package/dist/declarations/native-project-module-resolution.d.ts +76 -1
- package/dist/declarations/native-project-runtime-effect-target.d.ts +29 -0
- package/dist/declarations/native-project-runtime-executable-effect-evidence.d.ts +107 -0
- package/dist/declarations/native-project-runtime-mutation-target.d.ts +33 -0
- package/dist/declarations/native-project-runtime-promise-chain.d.ts +30 -0
- package/dist/declarations/native-project-runtime-promise-combinator.d.ts +22 -0
- package/dist/declarations/native-project-runtime-reachability.d.ts +30 -0
- package/dist/declarations/native-project-runtime-resource-management.d.ts +27 -0
- package/dist/declarations/native-project-runtime-yield-delegation.d.ts +10 -0
- package/dist/declarations/native-project-scope-template-reference.d.ts +13 -0
- package/dist/declarations/native-project-source-evidence.d.ts +8 -0
- package/dist/declarations/native-project.d.ts +40 -39
- package/dist/declarations/semantic-edit-script.d.ts +10 -8
- package/dist/declarations/semantic-graph-layers.d.ts +79 -0
- package/dist/declarations/semantic-patch-bundle-composition.d.ts +62 -0
- package/dist/declarations/semantic-sidecar.d.ts +3 -2
- package/dist/declarations/semantic-structural-diff.d.ts +94 -0
- package/dist/declarations/source-preservation.d.ts +32 -1
- package/dist/declarations/target-adapters.d.ts +22 -2
- package/dist/index.d.ts +32 -0
- package/dist/index.js +6 -0
- package/dist/internal/index-impl/compileNativeSource.js +53 -5
- package/dist/internal/index-impl/createLightweightNativeImport.js +58 -4
- package/dist/internal/index-impl/createNativeImportFromSyntaxAst.js +17 -1
- package/dist/internal/index-impl/createNativeImportFromTypeScriptAst.js +28 -4
- package/dist/internal/index-impl/createNativeProjectImportResult.js +31 -27
- package/dist/internal/index-impl/createNativeProjectModuleResolutionFromPackageManifests.js +145 -0
- package/dist/internal/index-impl/createNativeSourcePreservation.js +34 -7
- package/dist/internal/index-impl/createSemanticImportSidecar.js +27 -1
- package/dist/internal/index-impl/createTypeScriptCompilerNativeImporterAdapter.js +16 -5
- package/dist/internal/index-impl/dynamicImportExpressionMetadata.js +80 -0
- package/dist/internal/index-impl/importMetaUrlDependencyMetadata.js +176 -0
- package/dist/internal/index-impl/importNativeSource.js +2 -3
- package/dist/internal/index-impl/moduleImportAttributeMetadata.js +232 -0
- package/dist/internal/index-impl/projectSemanticEditScriptToSource.js +8 -1
- package/dist/internal/index-impl/projectSymbolGraphClassStaticBlocks.js +148 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerAdvancedTypeMetadata.js +45 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerCallableSignatureEquivalence.js +107 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerClassPrivateAccessorRuntimeProof.js +280 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerClassShapeEquivalence.js +103 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerConditionalTypeEquivalence.js +242 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerDecoratorRuntimeProof.js +197 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerEnumEquivalence.js +188 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerFacts.js +244 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerIndexSignatureEquivalence.js +58 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerMetadata.js +168 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerTypeEquivalence.js +199 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerTypeEquivalenceProof.js +204 -0
- package/dist/internal/index-impl/projectSymbolGraphCompilerTypeReferenceTargetEquivalence.js +99 -0
- package/dist/internal/index-impl/projectSymbolGraphCssModuleRecords.js +264 -0
- package/dist/internal/index-impl/projectSymbolGraphCssModuleScanners.js +242 -0
- package/dist/internal/index-impl/projectSymbolGraphCssModuleUtils.js +152 -0
- package/dist/internal/index-impl/projectSymbolGraphCssModules.js +82 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxComponentImports.js +170 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxComponentProviderLookup.js +167 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxComponentWrappers.js +150 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxContextTargets.js +71 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxContextValues.js +212 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxEventHandlers.js +172 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxHookEffects.js +124 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxHooks.js +281 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxMemberComponents.js +139 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxPropFlows.js +320 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxPropValues.js +145 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxProviderFlows.js +133 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxRecords.js +315 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxRenderCollections.js +155 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxRenderReturns.js +291 -0
- package/dist/internal/index-impl/projectSymbolGraphJsxRenderRisk.js +279 -0
- package/dist/internal/index-impl/projectSymbolGraphModuleDeclarationShapes.js +138 -0
- package/dist/internal/index-impl/projectSymbolGraphModuleResolution.js +89 -87
- package/dist/internal/index-impl/projectSymbolGraphPackageConditions.js +314 -0
- package/dist/internal/index-impl/projectSymbolGraphReExportImportTargets.js +43 -0
- package/dist/internal/index-impl/projectSymbolGraphReExports.js +55 -1
- package/dist/internal/index-impl/projectSymbolGraphRuntimeRegions.js +108 -0
- package/dist/internal/index-impl/projectSymbolGraphScopeUseDefAliases.js +307 -0
- package/dist/internal/index-impl/projectSymbolGraphScopeUseDefLexical.js +320 -0
- package/dist/internal/index-impl/projectSymbolGraphScopeUseDefOwners.js +50 -0
- package/dist/internal/index-impl/projectSymbolGraphScopeUseDefRecordBuilders.js +112 -0
- package/dist/internal/index-impl/projectSymbolGraphScopeUseDefRecords.js +238 -0
- package/dist/internal/index-impl/projectSymbolGraphScopeUseDefStructural.js +104 -0
- package/dist/internal/index-impl/projectSymbolGraphScopeUseDefStructuralNormalize.js +242 -0
- package/dist/internal/index-impl/projectSymbolGraphScopeUseDefUseHashes.js +107 -0
- package/dist/internal/index-impl/projectSymbolGraphSourceMapGeneratedBoundary.js +111 -0
- package/dist/internal/index-impl/projectSymbolGraphSourceRecords.js +268 -0
- package/dist/internal/index-impl/projectSymbolGraphSourceRecordsOwnership.js +309 -0
- package/dist/internal/index-impl/replaySemanticEditProjection.js +53 -39
- package/dist/internal/index-impl/runtimeOrderEvidenceBinding.js +151 -0
- package/dist/internal/index-impl/runtimeOrderProofSurfaces.js +253 -0
- package/dist/internal/index-impl/semanticEditCallsiteArgumentMerge.js +319 -0
- package/dist/internal/index-impl/semanticEditExplicitSourceReplacement.js +7 -2
- package/dist/internal/index-impl/semanticEditProjectionRecord.js +8 -0
- package/dist/internal/index-impl/semanticEditReplayDiagnostics.js +7 -2
- package/dist/internal/index-impl/semanticEditReplayOutputBinding.js +61 -0
- package/dist/internal/index-impl/semanticEditReplayRerunRoute.js +27 -0
- package/dist/internal/index-impl/semanticEditReplaySourceReplacement.js +6 -1
- package/dist/internal/index-impl/semanticEditRuntimeOrderReasons.js +320 -0
- package/dist/internal/index-impl/semanticEditScriptClassification.js +90 -5
- package/dist/internal/index-impl/semanticEditScripts.js +42 -5
- package/dist/internal/index-impl/semanticEditTypeSyntaxReasons.js +134 -0
- package/dist/internal/index-impl/semanticIndexFromNativeDeclarations.js +11 -5
- package/dist/internal/index-impl/semanticPatchBundleComposition.js +166 -0
- package/dist/internal/index-impl/semanticStructuralDiffRecords.js +150 -0
- package/dist/internal/index-impl/sourceMapGeneratedBoundaryGate.js +185 -0
- package/dist/internal/index-impl/staticMemberLiteral.js +31 -0
- package/dist/internal/index-impl/staticOptionalMemberReference.js +22 -0
- package/dist/internal/index-impl/syntaxAstSourcePreservation.js +273 -0
- package/dist/internal/index-impl/syntaxCommonJsModuleDeclarationEntries.js +297 -0
- package/dist/internal/index-impl/syntaxModuleDeclarationEntries.js +56 -132
- package/dist/internal/index-impl/syntaxModuleEntryRecords.js +160 -0
- package/dist/internal/index-impl/typeScriptCompilerAdvancedTypeShapes.js +160 -0
- package/dist/internal/index-impl/typeScriptCompilerAssignabilityOracle.js +97 -0
- package/dist/internal/index-impl/typeScriptCompilerClassApi.js +238 -0
- package/dist/internal/index-impl/typeScriptCompilerDecoratorMetadata.js +290 -0
- package/dist/internal/index-impl/typeScriptCompilerEnumShape.js +279 -0
- package/dist/internal/index-impl/typeScriptCompilerFacts.js +294 -0
- package/dist/internal/index-impl/typeScriptCompilerInferenceSyntax.js +170 -0
- package/dist/internal/index-impl/typeScriptCompilerReferenceGraph.js +186 -0
- package/dist/internal/index-impl/typeScriptCompilerSymbolIdentity.js +294 -0
- package/dist/internal/index-impl/typeScriptCompilerTypeReferenceTargets.js +142 -0
- package/dist/internal/index-impl/typeScriptDeclaration.js +10 -38
- package/dist/internal/index-impl/typeScriptModuleDeclarationEntries.js +52 -15
- package/dist/internal/index-impl/typeScriptSourceFilePreservation.js +296 -0
- package/dist/js-ts-safe-member-class-invariants.js +247 -0
- package/dist/js-ts-safe-member-merge-result.js +23 -3
- package/dist/js-ts-safe-member-merge.js +28 -4
- package/dist/js-ts-safe-merge-binding-patterns.js +170 -0
- package/dist/js-ts-safe-merge-context.js +1 -0
- package/dist/js-ts-safe-merge-jsx-attribute-fallback.js +314 -0
- package/dist/js-ts-safe-merge-jsx-attribute-parser.js +277 -0
- package/dist/js-ts-safe-merge-jsx-child-expression-fallback.js +161 -0
- package/dist/js-ts-safe-merge-jsx-child-expression-merge.js +319 -0
- package/dist/js-ts-safe-merge-jsx-child-expression-parser.js +300 -0
- package/dist/js-ts-safe-merge-parse-declarations.js +46 -2
- package/dist/js-ts-safe-merge-parse-statements.js +8 -0
- package/dist/js-ts-safe-merge-plan.js +3 -1
- package/dist/js-ts-safe-merge-semantic-edit-fallback.js +49 -0
- package/dist/js-ts-safe-merge-source-shape-fallbacks.js +5 -1
- package/dist/js-ts-safe-merge-top-level-rename-fallback.js +31 -5
- package/dist/js-ts-safe-merge-top-level-rename-result.js +7 -2
- package/dist/js-ts-safe-merge-variable-declarator-fallback.js +124 -6
- package/dist/js-ts-safe-merge-variable-declarator-parser.js +34 -4
- package/dist/js-ts-safe-merge.js +136 -0
- package/dist/js-ts-safe-project-merge-admission-routes.js +216 -0
- package/dist/js-ts-safe-project-merge-admission.js +161 -0
- package/dist/js-ts-safe-project-merge-ambient.js +110 -0
- package/dist/js-ts-safe-project-merge-core.js +85 -0
- package/dist/js-ts-safe-project-merge-css-module-conflicts.js +60 -0
- package/dist/js-ts-safe-project-merge-declaration-emit-parity.js +186 -0
- package/dist/js-ts-safe-project-merge-declarations.js +227 -0
- package/dist/js-ts-safe-project-merge-diagnostics-metadata.js +42 -0
- package/dist/js-ts-safe-project-merge-diagnostics-ts.js +73 -0
- package/dist/js-ts-safe-project-merge-diagnostics.js +283 -0
- package/dist/js-ts-safe-project-merge-evidence-routing.js +38 -0
- package/dist/js-ts-safe-project-merge-files.js +70 -0
- package/dist/js-ts-safe-project-merge-global-augmentation-compatibility.js +99 -0
- package/dist/js-ts-safe-project-merge-graph-conflicts.js +90 -2
- package/dist/js-ts-safe-project-merge-graph-delta-commonjs-interop.js +108 -0
- package/dist/js-ts-safe-project-merge-graph-delta-compiler-conflicts.js +179 -0
- package/dist/js-ts-safe-project-merge-graph-delta-compiler-details.js +189 -0
- package/dist/js-ts-safe-project-merge-graph-delta-conflicts.js +51 -184
- package/dist/js-ts-safe-project-merge-graph-delta-identity-conflicts.js +202 -0
- package/dist/js-ts-safe-project-merge-graph-delta-inference-syntax.js +80 -0
- package/dist/js-ts-safe-project-merge-graph-delta-module-declarations.js +155 -0
- package/dist/js-ts-safe-project-merge-graph-limits.js +16 -1
- package/dist/js-ts-safe-project-merge-graph.js +37 -5
- package/dist/js-ts-safe-project-merge-import-removal.js +292 -0
- package/dist/js-ts-safe-project-merge-jsx-graph-conflict-details.js +235 -0
- package/dist/js-ts-safe-project-merge-jsx-graph-conflicts.js +173 -0
- package/dist/js-ts-safe-project-merge-jsx-prop-contracts.js +86 -0
- package/dist/js-ts-safe-project-merge-jsx-render-branch-proof.js +189 -0
- package/dist/js-ts-safe-project-merge-missing-evidence.js +310 -0
- package/dist/js-ts-safe-project-merge-move-rename.js +209 -0
- package/dist/js-ts-safe-project-merge-proof-conflicts.js +44 -0
- package/dist/js-ts-safe-project-merge-proof-levels.js +320 -0
- package/dist/js-ts-safe-project-merge-quality-gates.js +140 -0
- package/dist/js-ts-safe-project-merge-routing-calibration.js +125 -0
- package/dist/js-ts-safe-project-merge-runtime-region-conflicts.js +156 -0
- package/dist/js-ts-safe-project-merge-scope-use-def-conflicts.js +292 -0
- package/dist/js-ts-safe-project-merge-semantic-equivalence-proof.js +175 -0
- package/dist/js-ts-safe-project-merge-semantic-replay-proof.js +311 -0
- package/dist/js-ts-safe-project-merge-semantic-replay-routes.js +179 -0
- package/dist/js-ts-safe-project-merge-source-span-conflicts.js +310 -0
- package/dist/js-ts-safe-project-merge-source-span-roundtrip-proof.js +172 -0
- package/dist/js-ts-safe-project-merge-split-merge-admission.js +96 -0
- package/dist/js-ts-safe-project-merge-split-merge-records.js +320 -0
- package/dist/js-ts-safe-project-merge-split-merge-shapes.js +234 -0
- package/dist/js-ts-safe-project-merge-split-merge.js +218 -0
- package/dist/js-ts-safe-project-merge-summary.js +320 -0
- package/dist/js-ts-safe-project-merge-symbol-move-admission.js +63 -0
- package/dist/js-ts-safe-project-merge-symbol-move-default-admission.js +143 -0
- package/dist/js-ts-safe-project-merge-symbol-move-risks.js +213 -0
- package/dist/js-ts-safe-project-merge-symbol-move.js +316 -0
- package/dist/js-ts-safe-project-merge-symbol-rename-admission.js +59 -0
- package/dist/js-ts-safe-project-merge-symbol-rename-default-admission.js +111 -0
- package/dist/js-ts-safe-project-merge-symbol-rename.js +319 -0
- package/dist/js-ts-safe-project-merge-ts-options.js +205 -0
- package/dist/js-ts-safe-project-merge-ts-program.js +268 -0
- package/dist/js-ts-safe-project-merge-typed-property-rename-rebase-utils.js +69 -0
- package/dist/js-ts-safe-project-merge-typed-property-rename-rebase.js +317 -0
- package/dist/js-ts-safe-project-merge-unsupported-surfaces.js +319 -0
- package/dist/js-ts-safe-project-merge.js +171 -172
- package/dist/js-ts-semantic-scope-use-def-bindings.js +287 -0
- package/dist/js-ts-semantic-scope-use-def-scan.js +241 -0
- package/dist/js-ts-semantic-scope-use-def-utils.js +132 -0
- package/dist/js-ts-semantic-scope-use-def.js +217 -0
- package/dist/lightweight-dependency-effects.js +28 -4
- package/dist/lightweight-dependency-relations.js +13 -7
- package/dist/lightweight-dependency-top-level.js +63 -0
- package/dist/native-import-language-profiles.js +27 -1
- package/dist/native-js-ts-importers.js +9 -5
- package/dist/native-parser-ast-format-profiles.js +12 -0
- package/dist/native-parser-html-css-format-profiles.js +85 -0
- package/dist/native-region-scanner-core.js +5 -3
- package/dist/native-region-scanner-js-commonjs.js +155 -0
- package/dist/native-region-scanner-js-imports.js +51 -13
- package/dist/native-region-scanner-js-reexports.js +79 -0
- package/dist/native-region-scanner-js-ts-helpers.js +23 -0
- package/dist/native-source-ledger-helpers.js +1 -1
- package/dist/native-source-ledger.js +24 -10
- package/dist/native-source-maps-ecma426.js +316 -0
- package/dist/native-source-maps.js +36 -6
- package/dist/native-source-preservation-ownership.js +292 -0
- package/dist/native-source-preservation-scanner.js +63 -25
- package/dist/native-source-preservation-types.d.ts +3 -0
- package/dist/semantic-import-effect-occurrences.js +242 -0
- package/dist/semantic-import-effect-regions.js +95 -58
- package/dist/semantic-import-graph-layers.js +224 -0
- package/dist/semantic-import-runtime-conditional-evidence.js +135 -0
- package/dist/semantic-import-runtime-effect-target-evidence.js +145 -0
- package/dist/semantic-import-runtime-exit-evidence.js +32 -0
- package/dist/semantic-import-runtime-import-meta-evidence.js +33 -0
- package/dist/semantic-import-runtime-mutation-evidence.js +155 -0
- package/dist/semantic-import-runtime-order-evidence.js +318 -0
- package/dist/semantic-import-runtime-promise-chain-evidence.js +103 -0
- package/dist/semantic-import-runtime-promise-combinator-evidence.js +166 -0
- package/dist/semantic-import-runtime-reachability-evidence.js +269 -0
- package/dist/semantic-import-runtime-resource-management-evidence.js +293 -0
- package/dist/semantic-import-runtime-switch-evidence.js +304 -0
- package/dist/semantic-import-runtime-throw-evidence.js +44 -0
- package/dist/semantic-import-runtime-try-finally-evidence.js +172 -0
- package/dist/semantic-import-sidecar-entry.js +4 -0
- package/dist/semantic-import-source-preservation.js +6 -2
- package/package.json +1 -1
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { uniqueStrings } from './js-ts-safe-merge-context.js';
|
|
2
|
+
|
|
3
|
+
export function parseJsxTags(sourceText) {
|
|
4
|
+
const tags = [];
|
|
5
|
+
const reasonCodes = [];
|
|
6
|
+
const ordinals = new Map();
|
|
7
|
+
let index = 0;
|
|
8
|
+
while (index < sourceText.length) {
|
|
9
|
+
const start = sourceText.indexOf('<', index);
|
|
10
|
+
if (start === -1) break;
|
|
11
|
+
const parsed = parseOpeningTag(sourceText, start);
|
|
12
|
+
if (!parsed) {
|
|
13
|
+
index = start + 1;
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
if (parsed.reasonCodes.length) reasonCodes.push(...parsed.reasonCodes);
|
|
17
|
+
const ordinal = (ordinals.get(parsed.tagName) ?? 0) + 1;
|
|
18
|
+
ordinals.set(parsed.tagName, ordinal);
|
|
19
|
+
tags.push({ ...parsed, key: `${parsed.tagName}#${ordinal}` });
|
|
20
|
+
index = parsed.end;
|
|
21
|
+
}
|
|
22
|
+
return { tags, byKey: new Map(tags.map((tag) => [tag.key, tag])), reasonCodes: uniqueStrings(reasonCodes) };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function attributeMap(tag) {
|
|
26
|
+
const byName = new Map();
|
|
27
|
+
const duplicateNames = [];
|
|
28
|
+
for (const attribute of tag.attributes) {
|
|
29
|
+
if (byName.has(attribute.name)) duplicateNames.push(attribute.name);
|
|
30
|
+
byName.set(attribute.name, attribute);
|
|
31
|
+
}
|
|
32
|
+
return { byName, reasonCodes: duplicateNames.length ? ['jsx-attribute-duplicate-name'] : [] };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function sameAttributeNames(left, right) {
|
|
36
|
+
return left.attributes.map((attr) => attr.name).join('\0') === right.attributes.map((attr) => attr.name).join('\0');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function sameTagText(left, right) {
|
|
40
|
+
return String(left?.text ?? '').trim() === String(right?.text ?? '').trim();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function sameAttrText(left, right) {
|
|
44
|
+
return String(left?.text ?? '').trim() === String(right?.text ?? '').trim();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function isJsxSpreadAttribute(attribute) {
|
|
48
|
+
return attribute?.kind === 'spread' || attribute?.spread === true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function isJsxComponentTag(tagName) {
|
|
52
|
+
const firstSegment = String(tagName ?? '').split(/[.:]/)[0] ?? '';
|
|
53
|
+
return /^[A-Z]/.test(firstSegment);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function jsxContextProviderBoundary(tagName) {
|
|
57
|
+
const segments = String(tagName ?? '').split(/[.:]/).filter(Boolean);
|
|
58
|
+
if (segments.length < 2 || segments[segments.length - 1] !== 'Provider') return undefined;
|
|
59
|
+
return { kind: 'context-provider', contextName: segments.slice(0, -1).join('.') };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function jsxContextProviderAncestorMap(tags, sourceText) {
|
|
63
|
+
const tagsByStart = new Map(tags.map((tag) => [tag.start, tag]));
|
|
64
|
+
const ancestorsByStart = new Map();
|
|
65
|
+
const providerStack = [];
|
|
66
|
+
for (const token of jsxTagTokens(sourceText)) {
|
|
67
|
+
if (token.kind === 'closing') {
|
|
68
|
+
closeContextProviderStack(providerStack, token.tagName);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const tag = tagsByStart.get(token.start);
|
|
72
|
+
if (tag) ancestorsByStart.set(tag.start, providerStack.map((provider) => ({ ...provider })));
|
|
73
|
+
const boundary = jsxContextProviderBoundary(token.tagName);
|
|
74
|
+
if (boundary && !token.selfClosing) {
|
|
75
|
+
providerStack.push({
|
|
76
|
+
tagName: token.tagName,
|
|
77
|
+
contextName: boundary.contextName,
|
|
78
|
+
contextBoundaryKind: boundary.kind,
|
|
79
|
+
start: token.start,
|
|
80
|
+
end: token.end
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return ancestorsByStart;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function closeContextProviderStack(providerStack, tagName) {
|
|
88
|
+
for (let index = providerStack.length - 1; index >= 0; index -= 1) {
|
|
89
|
+
if (providerStack[index].tagName !== tagName) continue;
|
|
90
|
+
providerStack.splice(index);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function jsxTagTokens(sourceText) {
|
|
96
|
+
const tokens = [];
|
|
97
|
+
let index = 0;
|
|
98
|
+
while (index < sourceText.length) {
|
|
99
|
+
const start = sourceText.indexOf('<', index);
|
|
100
|
+
if (start === -1) break;
|
|
101
|
+
if (sourceText[start + 1] === '/') {
|
|
102
|
+
const token = jsxClosingTagToken(sourceText, start);
|
|
103
|
+
if (token) tokens.push(token);
|
|
104
|
+
index = token?.end ?? start + 1;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const token = jsxOpeningTagToken(sourceText, start);
|
|
108
|
+
if (token) tokens.push(token);
|
|
109
|
+
index = token?.end ?? start + 1;
|
|
110
|
+
}
|
|
111
|
+
return tokens;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function jsxOpeningTagToken(sourceText, start) {
|
|
115
|
+
const parsed = parseOpeningTag(sourceText, start);
|
|
116
|
+
if (!parsed) return undefined;
|
|
117
|
+
return { kind: 'opening', tagName: parsed.tagName, start: parsed.start, end: parsed.end, selfClosing: jsxOpeningTagSelfClosing(sourceText, parsed.end) };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function jsxClosingTagToken(sourceText, start) {
|
|
121
|
+
const afterOpen = start + 2;
|
|
122
|
+
const nameMatch = /^[A-Za-z_$][\w$]*(?:[.:][A-Za-z_$][\w$]*|-[\w$]+)*/.exec(sourceText.slice(afterOpen));
|
|
123
|
+
if (!nameMatch) return undefined;
|
|
124
|
+
const end = sourceText.indexOf('>', afterOpen + nameMatch[0].length);
|
|
125
|
+
if (end === -1) return undefined;
|
|
126
|
+
return { kind: 'closing', tagName: nameMatch[0], start, end: end + 1 };
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function jsxOpeningTagSelfClosing(sourceText, end) {
|
|
130
|
+
let cursor = end - 2;
|
|
131
|
+
while (cursor >= 0 && /\s/.test(sourceText[cursor])) cursor -= 1;
|
|
132
|
+
return sourceText[cursor] === '/';
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function parseOpeningTag(sourceText, start) {
|
|
136
|
+
const afterOpen = start + 1;
|
|
137
|
+
if (/[/!?>]/.test(sourceText[afterOpen] ?? '')) return undefined;
|
|
138
|
+
const nameMatch = /^[A-Za-z_$][\w$]*(?:[.:][A-Za-z_$][\w$]*|-[\w$]+)*/.exec(sourceText.slice(afterOpen));
|
|
139
|
+
if (!nameMatch) return undefined;
|
|
140
|
+
const tagName = nameMatch[0];
|
|
141
|
+
const nameEnd = afterOpen + tagName.length;
|
|
142
|
+
const end = openingTagEnd(sourceText, nameEnd);
|
|
143
|
+
if (end === undefined) return undefined;
|
|
144
|
+
const attributes = parseAttributes(sourceText, nameEnd, end - 1);
|
|
145
|
+
return {
|
|
146
|
+
tagName,
|
|
147
|
+
start,
|
|
148
|
+
end,
|
|
149
|
+
text: sourceText.slice(start, end),
|
|
150
|
+
attributes: attributes.values,
|
|
151
|
+
reasonCodes: attributes.reasonCodes
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function parseAttributes(sourceText, start, end) {
|
|
156
|
+
const values = [];
|
|
157
|
+
const reasonCodes = [];
|
|
158
|
+
let cursor = start;
|
|
159
|
+
let spreadOrdinal = 0;
|
|
160
|
+
while (cursor < end) {
|
|
161
|
+
while (cursor < end && /\s/.test(sourceText[cursor])) cursor += 1;
|
|
162
|
+
if (sourceText[cursor] === '/') {
|
|
163
|
+
cursor += 1;
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
const attrStart = cursor;
|
|
167
|
+
const spreadEnd = spreadAttributeEnd(sourceText, cursor, end);
|
|
168
|
+
if (spreadEnd !== undefined) {
|
|
169
|
+
spreadOrdinal += 1;
|
|
170
|
+
values.push({
|
|
171
|
+
kind: 'spread',
|
|
172
|
+
spread: true,
|
|
173
|
+
spreadOrdinal,
|
|
174
|
+
name: `...spread#${spreadOrdinal}`,
|
|
175
|
+
start: attrStart,
|
|
176
|
+
end: spreadEnd,
|
|
177
|
+
text: sourceText.slice(attrStart, spreadEnd),
|
|
178
|
+
expressionText: spreadExpressionText(sourceText, attrStart, spreadEnd)
|
|
179
|
+
});
|
|
180
|
+
cursor = spreadEnd;
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
const nameMatch = /^[A-Za-z_$][\w$:-]*/.exec(sourceText.slice(cursor, end));
|
|
184
|
+
if (!nameMatch) {
|
|
185
|
+
reasonCodes.push('jsx-attribute-token-unsupported');
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
const name = nameMatch[0];
|
|
189
|
+
cursor += name.length;
|
|
190
|
+
while (cursor < end && /\s/.test(sourceText[cursor])) cursor += 1;
|
|
191
|
+
if (sourceText[cursor] === '=') {
|
|
192
|
+
cursor += 1;
|
|
193
|
+
while (cursor < end && /\s/.test(sourceText[cursor])) cursor += 1;
|
|
194
|
+
cursor = attributeValueEnd(sourceText, cursor, end);
|
|
195
|
+
if (cursor === undefined) return { values, reasonCodes: ['jsx-attribute-value-unterminated'] };
|
|
196
|
+
}
|
|
197
|
+
values.push({ name, start: attrStart, end: cursor, text: sourceText.slice(attrStart, cursor) });
|
|
198
|
+
}
|
|
199
|
+
return { values, reasonCodes: uniqueStrings(reasonCodes) };
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function spreadAttributeEnd(sourceText, start, end) {
|
|
203
|
+
if (sourceText[start] !== '{') return undefined;
|
|
204
|
+
let cursor = start + 1;
|
|
205
|
+
while (cursor < end && /\s/.test(sourceText[cursor])) cursor += 1;
|
|
206
|
+
if (sourceText.slice(cursor, cursor + 3) !== '...') return undefined;
|
|
207
|
+
return bracedValueEnd(sourceText, start, end);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function spreadExpressionText(sourceText, start, end) {
|
|
211
|
+
let cursor = start + 1;
|
|
212
|
+
while (cursor < end && /\s/.test(sourceText[cursor])) cursor += 1;
|
|
213
|
+
cursor += 3;
|
|
214
|
+
return sourceText.slice(cursor, Math.max(cursor, end - 1)).trim();
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function openingTagEnd(sourceText, start) {
|
|
218
|
+
let quote;
|
|
219
|
+
let escaped = false;
|
|
220
|
+
let braceDepth = 0;
|
|
221
|
+
for (let index = start; index < sourceText.length; index += 1) {
|
|
222
|
+
const char = sourceText[index];
|
|
223
|
+
if (quote) {
|
|
224
|
+
if (escaped) escaped = false;
|
|
225
|
+
else if (char === '\\') escaped = true;
|
|
226
|
+
else if (char === quote) quote = undefined;
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
if (char === '"' || char === '\'' || char === '`') quote = char;
|
|
230
|
+
else if (char === '{') braceDepth += 1;
|
|
231
|
+
else if (char === '}') braceDepth = Math.max(0, braceDepth - 1);
|
|
232
|
+
else if (char === '>' && braceDepth === 0) return index + 1;
|
|
233
|
+
}
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function attributeValueEnd(sourceText, start, end) {
|
|
238
|
+
const first = sourceText[start];
|
|
239
|
+
if (first === '"' || first === '\'') return quotedValueEnd(sourceText, start, end, first);
|
|
240
|
+
if (first === '{') return bracedValueEnd(sourceText, start, end);
|
|
241
|
+
let cursor = start;
|
|
242
|
+
while (cursor < end && !/[\s/]/.test(sourceText[cursor])) cursor += 1;
|
|
243
|
+
return cursor;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function quotedValueEnd(sourceText, start, end, quote) {
|
|
247
|
+
let escaped = false;
|
|
248
|
+
for (let cursor = start + 1; cursor < end; cursor += 1) {
|
|
249
|
+
const char = sourceText[cursor];
|
|
250
|
+
if (escaped) escaped = false;
|
|
251
|
+
else if (char === '\\') escaped = true;
|
|
252
|
+
else if (char === quote) return cursor + 1;
|
|
253
|
+
}
|
|
254
|
+
return undefined;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function bracedValueEnd(sourceText, start, end) {
|
|
258
|
+
let depth = 0;
|
|
259
|
+
let quote;
|
|
260
|
+
let escaped = false;
|
|
261
|
+
for (let cursor = start; cursor < end; cursor += 1) {
|
|
262
|
+
const char = sourceText[cursor];
|
|
263
|
+
if (quote) {
|
|
264
|
+
if (escaped) escaped = false;
|
|
265
|
+
else if (char === '\\') escaped = true;
|
|
266
|
+
else if (char === quote) quote = undefined;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
if (char === '"' || char === '\'' || char === '`') quote = char;
|
|
270
|
+
else if (char === '{') depth += 1;
|
|
271
|
+
else if (char === '}') {
|
|
272
|
+
depth -= 1;
|
|
273
|
+
if (depth === 0) return cursor + 1;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { JsTsSafeMergeStatuses, jsTsSafeMergeGateOrder } from './js-ts-safe-merge-constants.js';
|
|
2
|
+
import { createJsTsSafeMergeSemanticArtifacts } from './js-ts-safe-merge-semantic-artifacts.js';
|
|
3
|
+
import { uniqueStrings } from './js-ts-safe-merge-context.js';
|
|
4
|
+
import { mergeJsxChildExpressionSources } from './js-ts-safe-merge-jsx-child-expression-merge.js';
|
|
5
|
+
import { semanticFallbackChangedExistingDeclarations } from './js-ts-safe-merge-semantic-edit-fallback-utils.js';
|
|
6
|
+
|
|
7
|
+
function createJsxChildExpressionSemanticFallbackResult(input, topLevelResult, stagedFallback) {
|
|
8
|
+
const currentSourceText = stagedFallback?.directReplayCurrentSourceText
|
|
9
|
+
?? stagedFallback?.replayCurrentSourceText
|
|
10
|
+
?? input.headSourceText;
|
|
11
|
+
const merge = mergeJsxChildExpressionSources({
|
|
12
|
+
baseSourceText: input.baseSourceText,
|
|
13
|
+
workerSourceText: input.workerSourceText,
|
|
14
|
+
headSourceText: input.headSourceText,
|
|
15
|
+
currentSourceText
|
|
16
|
+
});
|
|
17
|
+
if (!merge.ok) return merge.policyBlocker ? jsxChildExpressionBlockedResult(input, topLevelResult, merge, stagedFallback) : undefined;
|
|
18
|
+
if (merge.sourceText === currentSourceText) return undefined;
|
|
19
|
+
const resultBase = stagedFallback?.stagedTopLevelResult ?? topLevelResult;
|
|
20
|
+
const language = input.language ?? topLevelResult.language ?? 'tsx';
|
|
21
|
+
const sourcePath = input.sourcePath ?? topLevelResult.sourcePath ?? 'inline.tsx';
|
|
22
|
+
const id = String(input.id ?? topLevelResult.id ?? 'js_ts_safe_merge');
|
|
23
|
+
const artifacts = createJsTsSafeMergeSemanticArtifacts({
|
|
24
|
+
...input,
|
|
25
|
+
id: `${id}_jsx_child_expression`,
|
|
26
|
+
language,
|
|
27
|
+
sourcePath,
|
|
28
|
+
headSourceText: currentSourceText,
|
|
29
|
+
headHash: undefined,
|
|
30
|
+
currentSourceHash: undefined
|
|
31
|
+
}, {
|
|
32
|
+
...resultBase,
|
|
33
|
+
id: `${String(input.id ?? resultBase.id ?? 'js_ts_safe_merge')}_jsx_child_expression`,
|
|
34
|
+
language,
|
|
35
|
+
sourcePath,
|
|
36
|
+
mergedSourceText: merge.sourceText,
|
|
37
|
+
outputSourceText: merge.sourceText
|
|
38
|
+
});
|
|
39
|
+
if (artifacts.status !== 'verified') return undefined;
|
|
40
|
+
const gates = semanticArtifactGates(artifacts);
|
|
41
|
+
return {
|
|
42
|
+
...resultBase,
|
|
43
|
+
id: String(input.id ?? resultBase.id ?? topLevelResult.id),
|
|
44
|
+
status: JsTsSafeMergeStatuses.merged,
|
|
45
|
+
mergedSourceText: merge.sourceText,
|
|
46
|
+
outputSourceText: merge.sourceText,
|
|
47
|
+
conflicts: [],
|
|
48
|
+
gates,
|
|
49
|
+
admission: {
|
|
50
|
+
status: 'auto-merge-candidate',
|
|
51
|
+
action: 'apply',
|
|
52
|
+
reviewRequired: false,
|
|
53
|
+
autoApplyCandidate: true,
|
|
54
|
+
autoMergeClaim: false,
|
|
55
|
+
semanticEquivalenceClaim: false,
|
|
56
|
+
reasonCodes: []
|
|
57
|
+
},
|
|
58
|
+
summary: {
|
|
59
|
+
...resultBase.summary,
|
|
60
|
+
changedExistingDeclarations: semanticFallbackChangedExistingDeclarations(topLevelResult, resultBase, stagedFallback),
|
|
61
|
+
conflicts: 0,
|
|
62
|
+
gatesPassed: gates.filter((gate) => gate.status === 'passed').length,
|
|
63
|
+
semanticEditOperations: artifacts.script.summary.operations,
|
|
64
|
+
semanticEditAppliedOperations: artifacts.replay.summary.applied,
|
|
65
|
+
semanticEditReplayStatus: artifacts.replay.status,
|
|
66
|
+
jsxChildExpressionElements: merge.summary.elements,
|
|
67
|
+
jsxChildExpressionEdits: merge.summary.edits,
|
|
68
|
+
jsxChildAdditions: merge.summary.childAdditions,
|
|
69
|
+
jsxKeyedChildAdditions: merge.summary.keyedChildAdditions,
|
|
70
|
+
jsxKeyedFragmentAdditions: merge.summary.keyedFragmentAdditions,
|
|
71
|
+
composedPhases: 2
|
|
72
|
+
},
|
|
73
|
+
metadata: {
|
|
74
|
+
...resultBase.metadata,
|
|
75
|
+
composed: {
|
|
76
|
+
phase: stagedFallback ? 'staged-top-level-jsx-child-expression-semantic-fallback' : 'jsx-child-expression-semantic-fallback',
|
|
77
|
+
phases: stagedFallback
|
|
78
|
+
? ['top-level-neutralization', 'top-level-ledger', 'jsx-child-expression']
|
|
79
|
+
: ['top-level-ledger', 'jsx-child-expression'],
|
|
80
|
+
originalReasonCodes: topLevelResult.admission?.reasonCodes ?? [],
|
|
81
|
+
stagedTopLevelSummary: stagedFallback?.stagedTopLevelResult?.summary,
|
|
82
|
+
neutralization: stagedFallback?.neutralization?.summary,
|
|
83
|
+
jsxChildExpressionFallback: merge.summary
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
semanticArtifacts: artifacts
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function jsxChildExpressionBlockedResult(input, topLevelResult, merge, stagedFallback) {
|
|
91
|
+
const reasonCodes = uniqueStrings(merge.reasonCodes);
|
|
92
|
+
const gates = jsTsSafeMergeGateOrder.map((id, index) => ({
|
|
93
|
+
id,
|
|
94
|
+
status: index === 0 ? 'blocked' : 'skipped',
|
|
95
|
+
reasonCodes: index === 0 ? reasonCodes : []
|
|
96
|
+
}));
|
|
97
|
+
return {
|
|
98
|
+
...topLevelResult,
|
|
99
|
+
id: String(input.id ?? topLevelResult.id),
|
|
100
|
+
status: JsTsSafeMergeStatuses.blocked,
|
|
101
|
+
mergedSourceText: undefined,
|
|
102
|
+
outputSourceText: undefined,
|
|
103
|
+
conflicts: [{
|
|
104
|
+
code: 'jsx-child-expression-policy-blocked',
|
|
105
|
+
gateId: 'parse-ledger',
|
|
106
|
+
message: 'JSX child merge policy could not prove stable keyed identity and render ordering.',
|
|
107
|
+
side: 'worker',
|
|
108
|
+
sourcePath: input.sourcePath ?? topLevelResult.sourcePath,
|
|
109
|
+
details: { reasonCodes }
|
|
110
|
+
}],
|
|
111
|
+
gates,
|
|
112
|
+
admission: {
|
|
113
|
+
status: 'blocked',
|
|
114
|
+
action: 'human-review',
|
|
115
|
+
reviewRequired: true,
|
|
116
|
+
autoApplyCandidate: false,
|
|
117
|
+
autoMergeClaim: false,
|
|
118
|
+
semanticEquivalenceClaim: false,
|
|
119
|
+
reasonCodes
|
|
120
|
+
},
|
|
121
|
+
summary: {
|
|
122
|
+
...topLevelResult.summary,
|
|
123
|
+
changedExistingDeclarations: semanticFallbackChangedExistingDeclarations(topLevelResult, topLevelResult, stagedFallback),
|
|
124
|
+
conflicts: 1,
|
|
125
|
+
gatesPassed: 0,
|
|
126
|
+
jsxChildExpressionPolicyBlocked: true,
|
|
127
|
+
composedPhases: 2
|
|
128
|
+
},
|
|
129
|
+
metadata: {
|
|
130
|
+
...topLevelResult.metadata,
|
|
131
|
+
composed: {
|
|
132
|
+
phase: stagedFallback
|
|
133
|
+
? 'staged-top-level-jsx-child-expression-policy-blocked'
|
|
134
|
+
: 'jsx-child-expression-policy-blocked',
|
|
135
|
+
phases: stagedFallback
|
|
136
|
+
? ['top-level-neutralization', 'top-level-ledger', 'jsx-child-expression-policy']
|
|
137
|
+
: ['top-level-ledger', 'jsx-child-expression-policy'],
|
|
138
|
+
originalReasonCodes: topLevelResult.admission?.reasonCodes ?? [],
|
|
139
|
+
stagedTopLevelSummary: stagedFallback?.stagedTopLevelResult?.summary,
|
|
140
|
+
neutralization: stagedFallback?.neutralization?.summary,
|
|
141
|
+
jsxChildExpressionPolicy: { reasonCodes }
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
semanticArtifacts: topLevelResult.semanticArtifacts
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function semanticArtifactGates(artifacts) {
|
|
149
|
+
return [
|
|
150
|
+
gate('semantic-edit-script', artifacts.script?.admission?.status === 'auto-merge-candidate', artifacts.script?.admission?.reasonCodes),
|
|
151
|
+
gate('semantic-edit-projection', artifacts.projection?.status === 'projected', artifacts.projection?.admission?.reasonCodes),
|
|
152
|
+
gate('semantic-edit-replay', artifacts.replay?.status === 'accepted-clean', artifacts.replay?.admission?.reasonCodes),
|
|
153
|
+
gate('semantic-edit-already-applied', artifacts.alreadyAppliedReplay?.status === 'already-applied', artifacts.alreadyAppliedReplay?.admission?.reasonCodes)
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function gate(id, passed, reasonCodes = []) {
|
|
158
|
+
return { id, status: passed ? 'passed' : 'blocked', reasonCodes: passed ? [] : uniqueStrings(reasonCodes) };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export { createJsxChildExpressionSemanticFallbackResult };
|