mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-29 08:00:06 +00:00
chore(ci): give the server test typecheck room, format new client files
The server's src and tests together are past 570,000 lines and the test typecheck needs about 4.3 GB, over Node's default heap; it now gets 8 GB like the test jobs. Forty new client files are formatted, and the react-hooks/refs baseline drops by the one warning a split hook removed.
This commit is contained in:
@@ -6,8 +6,8 @@ import type { DistanceUnit } from '../../../types';
|
||||
import { formatDistance, getDistanceUnitLabel } from '../../../utils/units';
|
||||
import { SoftPill } from '../../Planner/planParts';
|
||||
import ConfirmDialog from '../../shared/ConfirmDialog';
|
||||
import { fs } from '../../shared/DialogShell';
|
||||
import { INPUT, LABEL, PillSelect } from '../../shared/dialogParts';
|
||||
import { fs } from '../../shared/DialogShell';
|
||||
import { Tooltip } from '../../shared/Tooltip';
|
||||
import { TourNotice } from '../tourParts';
|
||||
import { MapCard, MapCardActions, MapCornerOverlay, StopDisc, VariantFigures, WayChoice } from './mapCardParts';
|
||||
|
||||
@@ -7,9 +7,9 @@ import { INPUT, LABEL } from '../../shared/dialogParts';
|
||||
import { fs } from '../../shared/DialogShell';
|
||||
import { FoldButton, InfoDot, TourNotice, TourSection } from '../tourParts';
|
||||
import { HikingPreferencesField } from './HikingPreferencesField';
|
||||
import { WinterActivityField } from './WinterActivityField';
|
||||
import { TOUR_DURATION_INPUT_MAX_LENGTH, formatTourDuration, parseTourDuration } from './tourDurationInput';
|
||||
import type { TourPlannerController } from './useTourPlanner';
|
||||
import { WinterActivityField } from './WinterActivityField';
|
||||
|
||||
type Difficulty = 1 | 2 | 3 | 4 | 5 | 6;
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ import { useSettingsStore } from '../../../store/settingsStore';
|
||||
import type { TourFerrataCrossing } from '../../../store/tourFerrataCrossingStore';
|
||||
import { formatDistance } from '../../../utils/units';
|
||||
import { FerrataGlyph } from '../../Ferratas/FerrataGlyph';
|
||||
import { HorseLegRow } from '../horse/HorseLegRow';
|
||||
import { fs } from '../../shared/DialogShell';
|
||||
import { Tooltip } from '../../shared/Tooltip';
|
||||
import { HorseLegRow } from '../horse/HorseLegRow';
|
||||
import { PaddleLegFailureRow, PaddleLegNotes } from '../paddle/PaddleLegParts';
|
||||
import { isRegionLoadPending, regionLoadFailure } from '../paddle/paddleRegionLoad';
|
||||
import { PaddleRegionLoadRow } from '../paddle/PaddleRegionLoadRow';
|
||||
|
||||
@@ -102,9 +102,9 @@ function hasNeighbour(grid: Map<string, Sample[]>, sample: Sample, counts: (othe
|
||||
const cy = cellOf(sample.y);
|
||||
for (let dx = -1; dx <= 1; dx += 1) {
|
||||
for (let dy = -1; dy <= 1; dy += 1) {
|
||||
const near = grid.get(`${cx + dx}:${cy + dy}`)?.some(
|
||||
(other) => Math.hypot(other.x - sample.x, other.y - sample.y) <= SAME_GROUND_M && counts(other)
|
||||
);
|
||||
const near = grid
|
||||
.get(`${cx + dx}:${cy + dy}`)
|
||||
?.some((other) => Math.hypot(other.x - sample.x, other.y - sample.y) <= SAME_GROUND_M && counts(other));
|
||||
if (near) return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ const { valhallaRun, enrichTourElevations } = vi.hoisted(() => ({
|
||||
vi.mock('../../Map/valhallaRoute', () => ({ valhallaRun }));
|
||||
vi.mock('./tourRouting', () => ({ enrichTourElevations }));
|
||||
|
||||
import { fitsWish, type RoundRequest } from './roundHikes';
|
||||
import { spotToward } from './roundHikeGeometry';
|
||||
import { findRoundHikes, MAX_ROUND_ASKS, type RoundSearchReport } from './roundHikeRouting';
|
||||
import { fitsWish, type RoundRequest } from './roundHikes';
|
||||
|
||||
type Spot = { lat: number; lng: number };
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { valhallaRun } from '../../Map/valhallaRoute';
|
||||
import { figuresOf } from './legVariants';
|
||||
import { loopSpots, retracedShare, sharedShare, STRAIGHT_PER_RADIUS_M } from './roundHikeGeometry';
|
||||
import { fitsWish, ROUND_KEYS, type RoundCandidate, type RoundRequest } from './roundHikes';
|
||||
import { enrichTourElevations } from './tourRouting';
|
||||
import { MAX_TOUR_SNAP_M } from './tourRouteOutcome';
|
||||
import { enrichTourElevations } from './tourRouting';
|
||||
|
||||
type Spot = { lat: number; lng: number };
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import { convertDistance } from '../../../utils/units';
|
||||
import type { CostingOptions } from '../../Map/valhallaRoute';
|
||||
import { OTHER_WAY_KEYS, type LegVariant } from './legVariants';
|
||||
import { spotToward } from './roundHikeGeometry';
|
||||
import { closeLoop } from './tourRouteActions';
|
||||
import type { TourPlannerWaypoint } from './tourPlannerWaypoints';
|
||||
import { closeLoop } from './tourRouteActions';
|
||||
|
||||
/**
|
||||
* RTE-03: round hikes of about a wished length out of a start point, as a
|
||||
@@ -139,9 +139,13 @@ export function roundPlanOf(
|
||||
newId: () => string
|
||||
): TourPlannerWaypoint[] {
|
||||
const { fixedLeg: _leg, lock: _lock, carryNext: _carry, auto: _auto, shaping: _shaping, ...own } = start;
|
||||
const steering = via.map(
|
||||
({ lat, lng }): TourPlannerWaypoint => ({ id: newId(), lat, lng, role: 'via', shaping: true })
|
||||
);
|
||||
const steering = via.map(({ lat, lng }): TourPlannerWaypoint => ({
|
||||
id: newId(),
|
||||
lat,
|
||||
lng,
|
||||
role: 'via',
|
||||
shaping: true,
|
||||
}));
|
||||
return closeLoop([{ ...own, role: 'start' }, ...steering], newId());
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@ function alongLine(
|
||||
const t =
|
||||
length === 0 ? 0 : Math.max(0, Math.min(1, ((lng - aLng) * cos * dx + (lat - aLat) * dy) / (length * length)));
|
||||
const distance = Math.hypot(aLng * cos + dx * t - lng * cos, aLat + dy * t - lat);
|
||||
if (distance < best.distance) best = { at: travelled + length * t, index: i, vertex: t < 0.5 ? i : i + 1, distance };
|
||||
if (distance < best.distance)
|
||||
best = { at: travelled + length * t, index: i, vertex: t < 0.5 ? i : i + 1, distance };
|
||||
}
|
||||
travelled += length;
|
||||
}
|
||||
|
||||
@@ -87,10 +87,7 @@ describe('useTourPlanner, the winter label of a hike (HIK-01)', () => {
|
||||
await act(async () => {
|
||||
await result.current.save();
|
||||
});
|
||||
expect(createTour).toHaveBeenCalledWith(
|
||||
61,
|
||||
expect.objectContaining({ tour_type: 'hike', winter_activity: null })
|
||||
);
|
||||
expect(createTour).toHaveBeenCalledWith(61, expect.objectContaining({ tour_type: 'hike', winter_activity: null }));
|
||||
});
|
||||
|
||||
it('FE-TOUR-WINTER-002: the label plans nothing again, is no step of the history and is kept in the draft', async () => {
|
||||
@@ -179,10 +176,7 @@ describe('useTourPlanner, the winter label of a hike (HIK-01)', () => {
|
||||
await act(async () => {
|
||||
await result.current.save();
|
||||
});
|
||||
expect(createTour).toHaveBeenCalledWith(
|
||||
65,
|
||||
expect.objectContaining({ tour_type: 'walk', winter_activity: null })
|
||||
);
|
||||
expect(createTour).toHaveBeenCalledWith(65, expect.objectContaining({ tour_type: 'walk', winter_activity: null }));
|
||||
});
|
||||
|
||||
it('FE-TOUR-WINTER-006: keeps the label the switch brings back with the tour, winter hiking for the next one', async () => {
|
||||
|
||||
Reference in New Issue
Block a user