Skip to content

Commit 5ee0bf4

Browse files
committed
refactor(scripting): remove catalog infrastructure now that every step is a typed POCO
All 205 FileMaker script steps are IStepFactory POCOs discovered via reflection in StepRegistry. The catalog-driven layer that preceded them has nothing left to serve, so it comes out entirely. Deleted: - step-catalog-en.json embedded resource (−8,306 lines). - StepCatalog.cs (StepDefinition, StepParam, enum converters). - StepCatalogLoader.cs (JSON loader + ByName/ById indices). - IStepCatalog.cs contract. - CatalogXmlBuilder.cs (XElement synthesis from param maps). - CatalogDisplayRenderer.cs (generic display-line renderer). - CatalogValidator.cs (generic per-param validator). - CatalogParamExtractor.cs (helper for reading values out of XML). Kept as forward-compat surface: - RawStep wraps elements whose name isn't in the registry (e.g. a step introduced by a future FileMaker release). It's sealed in the display editor and surfaced with a yellow-underline warning pointing users to the XML editor; round-trip remains byte-intact. - StepBlockPair + BlockPairRole recreated in BlockPair.cs — consumed by StepMetadata.BlockPair for indent / pair-match logic. Migrated to StepRegistry: - ScriptValidator.Validate now looks up StepMetadata + ParamMetadata. - FmScript.ToDisplayLines reads BlockPair through StepRegistry.MetadataFor. - FmScript.Apply(Add|Update) route new steps through POCO factories. - ScriptTextParser drops its catalog fallback; unknown names wrap in RawStep. Other moves: - ScriptStep.Definition property removed. Every POCO ctor now calls base(enabled) only. 198 POCOs mechanically updated. - CommentStep upgraded to IStepFactory. - Unknown-step diagnostic severity flipped Error → Warning with an 'edit via the XML editor' message.
1 parent 4498e97 commit 5ee0bf4

226 files changed

Lines changed: 444 additions & 9644 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
namespace SharpFM.Model.Scripting;
2+
3+
/// <summary>
4+
/// Role of a step in a block-pair construct (if/else/end-if, loop/end-loop).
5+
/// </summary>
6+
public enum BlockPairRole
7+
{
8+
Open,
9+
Middle,
10+
Close,
11+
}
12+
13+
/// <summary>
14+
/// Block-pair metadata carried by step POCOs that open, continue, or
15+
/// close a block. Drives indentation in <see cref="FmScript.ToDisplayLines"/>
16+
/// and matching-partner validation in <see cref="ScriptValidator"/>.
17+
/// </summary>
18+
public sealed record StepBlockPair
19+
{
20+
public required BlockPairRole Role { get; init; }
21+
22+
/// <summary>
23+
/// Canonical names of the other steps that participate in this
24+
/// block. E.g. an If's partners are ["Else", "Else If", "End If"].
25+
/// </summary>
26+
public required string[] Partners { get; init; }
27+
}

0 commit comments

Comments
 (0)