@willcgage/module-schematic 0.66.0 → 0.67.0

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/dist/index.cjs CHANGED
@@ -703,18 +703,20 @@ function stateToDoc(state, recordNumber) {
703
703
  ]
704
704
  ) : [
705
705
  { id: "A", label: "West", tracks: [{ trackId: MAIN_TRACK_ID, lane: 0, config: state.configA }] },
706
- // Non-loop modules always have a real B ("none" never applies).
707
- {
708
- id: "B",
709
- label: "East",
710
- tracks: [
711
- {
712
- trackId: MAIN_TRACK_ID,
713
- lane: 0,
714
- config: state.configB === "none" ? "single" : state.configB
715
- }
716
- ]
717
- }
706
+ // ⚠️ `configB: "none"` means the module HAS NO FAR ENDPLATE, and
707
+ // that is not loop-only (#184). An *end of the line* or a *pocket*
708
+ // presents one conforming face and the track simply stops. The
709
+ // standard governs the ends a module offers for joining; it never
710
+ // required a module to offer two. This used to coerce "none" to
711
+ // "single" and emit a B regardless, so a single-ended module was
712
+ // impossible to author.
713
+ ...state.configB !== "none" ? [
714
+ {
715
+ id: "B",
716
+ label: "East",
717
+ tracks: [{ trackId: MAIN_TRACK_ID, lane: 0, config: state.configB }]
718
+ }
719
+ ] : []
718
720
  ],
719
721
  // Branch endplates C, D, … — junction connections at pos, off one side
720
722
  // (#170). A set can carry several (e.g. a second railroad through).
@@ -1984,7 +1986,7 @@ function deriveEndplatePoses(geo) {
1984
1986
  trackOffsets: offsetsFor(cfg(0), half)
1985
1987
  })
1986
1988
  );
1987
- const noB = geo.geometryType === "dead_end" || geo.loop === true;
1989
+ const noB = geo.geometryType === "dead_end" || geo.loop === true || geo.endplateConfigs?.[1] === "none";
1988
1990
  const end = sectionedEndPose({ sections: geo.sections });
1989
1991
  if (!noB && end) {
1990
1992
  poses.push(