Skip to content

feat: implement map file import/export functionality#50

Merged
zuhanit merged 10 commits intomasterfrom
feat/frontend-map-io
Jun 25, 2025
Merged

feat: implement map file import/export functionality#50
zuhanit merged 10 commits intomasterfrom
feat/frontend-map-io

Conversation

@zuhanit
Copy link
Copy Markdown
Owner

@zuhanit zuhanit commented Jun 25, 2025

Summary

  • Add support for importing StarCraft map files (.chk, .scx, .scm) and Webditor project files (.wproject)
  • Implement save functionality for Webditor project format
  • Add backend endpoint for map file processing

Changes Made

Frontend

  • App Menu: Added Open and Save menu items with file input handling
  • Map Store: Enhanced with openUsemap action supporting multiple file formats
  • Project Store: New store for managing project metadata
  • File Handling: Support for both binary map files and JSON project files

Backend

  • New Endpoint: /api/v1/maps/open for processing uploaded map files
  • Bug Fix: Fixed string section detection in CHK parser
  • Test Maps: Added example map files for testing

Features

  • Import .chk/.scx/.scm files via backend processing
  • Import .wproject files with schema validation (non-destructive)
  • Export current map as .wproject JSON format
  • Error handling and user feedback for file operations

Technical Details

  • Uses Zod safeParse to validate imported data without removing unknown fields
  • Maintains compatibility with existing Immer-based state management
  • Proper file extension detection and format-specific processing
  • TypeScript type safety throughout the import/export pipeline

Test Plan

  • Import various StarCraft map formats
  • Export and re-import .wproject files
  • Verify all entity data preservation during save/load cycles
  • Error handling for invalid file formats

🤖 Generated with Claude Code

@zuhanit zuhanit merged commit 554397d into master Jun 25, 2025
3 checks passed
@zuhanit zuhanit added the enhancement New feature or request label Jun 25, 2025
@zuhanit zuhanit self-assigned this Jun 25, 2025
@zuhanit zuhanit deleted the feat/frontend-map-io branch March 28, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant