From cc33e24cd457306347036c9a14e3f012314c9bc6 Mon Sep 17 00:00:00 2001 From: Jage9 Date: Tue, 24 Feb 2026 02:07:18 -0500 Subject: [PATCH] Reorganize client items into per-item folders --- client/public/version.js | 2 +- client/src/items/types/{clock.ts => clock/definition.ts} | 3 +-- client/src/items/types/clock/index.ts | 2 ++ client/src/items/types/{dice.ts => dice/definition.ts} | 3 +-- client/src/items/types/dice/index.ts | 2 ++ client/src/items/types/index.ts | 1 - client/src/items/types/{piano.ts => piano/definition.ts} | 5 ++--- client/src/items/types/piano/index.ts | 3 +++ .../items/{pianoController.ts => types/piano/runtime.ts} | 7 +++---- .../types/{radioStation.ts => radioStation/definition.ts} | 7 +++---- client/src/items/types/radioStation/index.ts | 2 ++ client/src/items/types/{wheel.ts => wheel/definition.ts} | 3 +-- client/src/items/types/wheel/index.ts | 2 ++ client/src/items/types/{widget.ts => widget/definition.ts} | 5 ++--- client/src/items/types/widget/index.ts | 2 ++ client/src/main.ts | 2 +- 16 files changed, 28 insertions(+), 23 deletions(-) rename client/src/items/types/{clock.ts => clock/definition.ts} (95%) create mode 100644 client/src/items/types/clock/index.ts rename client/src/items/types/{dice.ts => dice/definition.ts} (87%) create mode 100644 client/src/items/types/dice/index.ts rename client/src/items/types/{piano.ts => piano/definition.ts} (81%) create mode 100644 client/src/items/types/piano/index.ts rename client/src/items/{pianoController.ts => types/piano/runtime.ts} (99%) rename client/src/items/types/{radioStation.ts => radioStation/definition.ts} (76%) create mode 100644 client/src/items/types/radioStation/index.ts rename client/src/items/types/{wheel.ts => wheel/definition.ts} (87%) create mode 100644 client/src/items/types/wheel/index.ts rename client/src/items/types/{widget.ts => widget/definition.ts} (85%) create mode 100644 client/src/items/types/widget/index.ts diff --git a/client/public/version.js b/client/public/version.js index 04a4493..7964015 100644 --- a/client/public/version.js +++ b/client/public/version.js @@ -1,5 +1,5 @@ // Maintainer-controlled web client version. // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) -window.CHGRID_WEB_VERSION = "2026.02.24 R224"; +window.CHGRID_WEB_VERSION = "2026.02.24 R225"; // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. window.CHGRID_TIME_ZONE = "America/Detroit"; diff --git a/client/src/items/types/clock.ts b/client/src/items/types/clock/definition.ts similarity index 95% rename from client/src/items/types/clock.ts rename to client/src/items/types/clock/definition.ts index 916ab2f..5ec042b 100644 --- a/client/src/items/types/clock.ts +++ b/client/src/items/types/clock/definition.ts @@ -1,4 +1,4 @@ -import { type ItemTypeClientDefinition } from './shared'; +import { type ItemTypeClientDefinition } from '../shared'; export const CLOCK_TIME_ZONE_OPTIONS = [ 'America/Anchorage', @@ -61,4 +61,3 @@ export const clockDefinition: ItemTypeClientDefinition = { timeZone: [...CLOCK_TIME_ZONE_OPTIONS], }, }; - diff --git a/client/src/items/types/clock/index.ts b/client/src/items/types/clock/index.ts new file mode 100644 index 0000000..27de3d4 --- /dev/null +++ b/client/src/items/types/clock/index.ts @@ -0,0 +1,2 @@ +export { clockDefinition, CLOCK_TIME_ZONE_OPTIONS } from './definition'; + diff --git a/client/src/items/types/dice.ts b/client/src/items/types/dice/definition.ts similarity index 87% rename from client/src/items/types/dice.ts rename to client/src/items/types/dice/definition.ts index 400ec9e..3bd11df 100644 --- a/client/src/items/types/dice.ts +++ b/client/src/items/types/dice/definition.ts @@ -1,4 +1,4 @@ -import { type ItemTypeClientDefinition } from './shared'; +import { type ItemTypeClientDefinition } from '../shared'; /** Default client-side UI definition for dice items. */ export const diceDefinition: ItemTypeClientDefinition = { @@ -15,4 +15,3 @@ export const diceDefinition: ItemTypeClientDefinition = { emitSoundTempo: 50, }, }; - diff --git a/client/src/items/types/dice/index.ts b/client/src/items/types/dice/index.ts new file mode 100644 index 0000000..578fc14 --- /dev/null +++ b/client/src/items/types/dice/index.ts @@ -0,0 +1,2 @@ +export { diceDefinition } from './definition'; + diff --git a/client/src/items/types/index.ts b/client/src/items/types/index.ts index b4e6157..290a05b 100644 --- a/client/src/items/types/index.ts +++ b/client/src/items/types/index.ts @@ -19,4 +19,3 @@ export const DEFAULT_ITEM_TYPE_DEFINITIONS: ItemTypeClientDefinition[] = [ /** Default add-item menu ordering derived from local item definitions. */ export const DEFAULT_ITEM_TYPE_SEQUENCE: ItemType[] = DEFAULT_ITEM_TYPE_DEFINITIONS.map((definition) => definition.type); - diff --git a/client/src/items/types/piano.ts b/client/src/items/types/piano/definition.ts similarity index 81% rename from client/src/items/types/piano.ts rename to client/src/items/types/piano/definition.ts index 9de4c06..2f5bf98 100644 --- a/client/src/items/types/piano.ts +++ b/client/src/items/types/piano/definition.ts @@ -1,5 +1,5 @@ -import { PIANO_INSTRUMENT_OPTIONS } from '../../audio/pianoSynth'; -import { type ItemTypeClientDefinition } from './shared'; +import { PIANO_INSTRUMENT_OPTIONS } from '../../../audio/pianoSynth'; +import { type ItemTypeClientDefinition } from '../shared'; /** Default client-side UI definition for piano items. */ export const pianoDefinition: ItemTypeClientDefinition = { @@ -20,4 +20,3 @@ export const pianoDefinition: ItemTypeClientDefinition = { voiceMode: ['poly', 'mono'], }, }; - diff --git a/client/src/items/types/piano/index.ts b/client/src/items/types/piano/index.ts new file mode 100644 index 0000000..1532358 --- /dev/null +++ b/client/src/items/types/piano/index.ts @@ -0,0 +1,3 @@ +export { pianoDefinition } from './definition'; +export { PianoController } from './runtime'; + diff --git a/client/src/items/pianoController.ts b/client/src/items/types/piano/runtime.ts similarity index 99% rename from client/src/items/pianoController.ts rename to client/src/items/types/piano/runtime.ts index 6e4781e..2720586 100644 --- a/client/src/items/pianoController.ts +++ b/client/src/items/types/piano/runtime.ts @@ -3,9 +3,9 @@ import { PIANO_INSTRUMENT_OPTIONS, PianoSynth, type PianoInstrumentId, -} from '../audio/pianoSynth'; -import { type IncomingMessage, type OutgoingMessage } from '../network/protocol'; -import { type GameMode, type WorldItem } from '../state/gameState'; +} from '../../../audio/pianoSynth'; +import { type IncomingMessage, type OutgoingMessage } from '../../../network/protocol'; +import { type GameMode, type WorldItem } from '../../../state/gameState'; const PIANO_WHITE_KEY_MIDI_BY_CODE: Record = { KeyA: 60, @@ -815,4 +815,3 @@ export class PianoController { } } } - diff --git a/client/src/items/types/radioStation.ts b/client/src/items/types/radioStation/definition.ts similarity index 76% rename from client/src/items/types/radioStation.ts rename to client/src/items/types/radioStation/definition.ts index 2729156..76cb78c 100644 --- a/client/src/items/types/radioStation.ts +++ b/client/src/items/types/radioStation/definition.ts @@ -1,6 +1,6 @@ -import { RADIO_CHANNEL_OPTIONS } from '../../audio/radioStationRuntime'; -import { EFFECT_SEQUENCE } from '../../audio/effects'; -import { type ItemTypeClientDefinition } from './shared'; +import { RADIO_CHANNEL_OPTIONS } from '../../../audio/radioStationRuntime'; +import { EFFECT_SEQUENCE } from '../../../audio/effects'; +import { type ItemTypeClientDefinition } from '../shared'; /** Default client-side UI definition for radio_station items. */ export const radioStationDefinition: ItemTypeClientDefinition = { @@ -21,4 +21,3 @@ export const radioStationDefinition: ItemTypeClientDefinition = { mediaChannel: [...RADIO_CHANNEL_OPTIONS], }, }; - diff --git a/client/src/items/types/radioStation/index.ts b/client/src/items/types/radioStation/index.ts new file mode 100644 index 0000000..ae80d4f --- /dev/null +++ b/client/src/items/types/radioStation/index.ts @@ -0,0 +1,2 @@ +export { radioStationDefinition } from './definition'; + diff --git a/client/src/items/types/wheel.ts b/client/src/items/types/wheel/definition.ts similarity index 87% rename from client/src/items/types/wheel.ts rename to client/src/items/types/wheel/definition.ts index 06c9dc5..adad777 100644 --- a/client/src/items/types/wheel.ts +++ b/client/src/items/types/wheel/definition.ts @@ -1,4 +1,4 @@ -import { type ItemTypeClientDefinition } from './shared'; +import { type ItemTypeClientDefinition } from '../shared'; /** Default client-side UI definition for wheel items. */ export const wheelDefinition: ItemTypeClientDefinition = { @@ -15,4 +15,3 @@ export const wheelDefinition: ItemTypeClientDefinition = { emitSoundTempo: 50, }, }; - diff --git a/client/src/items/types/wheel/index.ts b/client/src/items/types/wheel/index.ts new file mode 100644 index 0000000..08db340 --- /dev/null +++ b/client/src/items/types/wheel/index.ts @@ -0,0 +1,2 @@ +export { wheelDefinition } from './definition'; + diff --git a/client/src/items/types/widget.ts b/client/src/items/types/widget/definition.ts similarity index 85% rename from client/src/items/types/widget.ts rename to client/src/items/types/widget/definition.ts index 958bd79..37afe26 100644 --- a/client/src/items/types/widget.ts +++ b/client/src/items/types/widget/definition.ts @@ -1,5 +1,5 @@ -import { EFFECT_SEQUENCE } from '../../audio/effects'; -import { type ItemTypeClientDefinition } from './shared'; +import { EFFECT_SEQUENCE } from '../../../audio/effects'; +import { type ItemTypeClientDefinition } from '../shared'; /** Default client-side UI definition for widget items. */ export const widgetDefinition: ItemTypeClientDefinition = { @@ -32,4 +32,3 @@ export const widgetDefinition: ItemTypeClientDefinition = { emitEffect: EFFECT_SEQUENCE.map((effect) => effect.id), }, }; - diff --git a/client/src/items/types/widget/index.ts b/client/src/items/types/widget/index.ts new file mode 100644 index 0000000..7c28e49 --- /dev/null +++ b/client/src/items/types/widget/index.ts @@ -0,0 +1,2 @@ +export { widgetDefinition } from './definition'; + diff --git a/client/src/main.ts b/client/src/main.ts index 2c5129a..215c794 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -57,7 +57,7 @@ import { } from './items/itemRegistry'; import { createItemPropertyEditor } from './items/itemPropertyEditor'; import { createItemPropertyPresentation } from './items/itemPropertyPresentation'; -import { PianoController } from './items/pianoController'; +import { PianoController } from './items/types/piano'; import { NICKNAME_STORAGE_KEY, SettingsStore } from './settings/settingsStore'; import { runConnectFlow, runDisconnectFlow, type ConnectFlowDeps } from './session/connectionFlow'; import { MediaSession } from './session/mediaSession';