This project is an IC10 emulator (programming language for the game Stationeers) with a complete toolkit for development, testing, and code generation.
- Full IC10 Emulation - Execute IC10 code with support for all instructions
- TypeScript Type Generation - Automatic generation of types for devices, instructions, and constants
- Device System - Typed classes for all in-game devices
- Development Tools - Automatic code generation, index files, and configurations
- Testing - Comprehensive test system with VSCode support
- Watch Mode - Automatic rebuild on source code changes
src/
βββ Core/ # Base classes (Device, Housing, Network, Slot, Stack)
βββ Defines/ # Generated constants and definitions
βββ Devices/ # Auto-generated device classes
βββ Ic10/ # IC10 emulator core
β βββ Context/ # Execution contexts (Real, Sandbox)
β βββ Instruction/ # IC10 instruction implementations
β βββ Lines/ # Code line processing
β βββ SandBox.ts # Execution sandbox
tests/ # Tests
tools/ # Generation scripts and utilities
samples/ # IC10 code examples
- Bun (required)
- IDE with TypeScript support (VSCode recommended)
git clone <repository-url>
cd ic10
bun install# Run in development mode with file watching
bun run dev
# Run tests
bun test
# Full project rebuild
bun run upgradedev- Development mode with file watchingbuild- Full project buildtest- Run testsupgrade- Full data update and regeneration
download- Download latest data from servergenerate-device- Generate device classesgenerate:index- Update index filesgenerate-intruction-index- Generate instruction indexgenerate-vscode- Update VSCode configuration
lint- Code checking with Biomefix- Automatic problem fixingformat- Code formatting
bun run upgradeThis script performs:
- Downloading current device, instruction, and constant data
- Generating TypeScript types and classes
- Creating index files
- Updating VSCode configuration
bun run devThe whatch.ts script monitors changes and automatically:
- Regenerates index files when sources change
- Updates devices when definitions change
- Rebuilds instruction index when instruction classes change
- Create a class in
src/Ic10/Instruction/ - Inherit from the base Instruction class
- Implement the
tests()method for testing - The system will automatically detect and add the instruction
# Run all tests
bun test
# Run specific test
bun test tests/ic10/main.test.ts
# Show executed tests
bun run showcomming soon
- Analyzes device data from API
- Creates typed TypeScript classes
- Groups devices by base types (Housing, Structure, Item)
- Generates index files for export
- Automatically discovers instruction classes
- Creates instruction map for quick access
- Generates TypeScript types for instruction names
- Collects instruction test information
- Updates launch.json for debugging
- Provides autocompletion for instruction names
The whatch.ts system provides:
- Debounce mechanism - Prevents multiple rebuilds
- Selective regeneration - Only necessary parts on change
- Template support - Different scripts for different file types
- Unnecessary file ignoring - Prevents cyclic rebuilds
The project uses a comprehensive testing system:
- Unit tests for individual components
- Integration tests for the IC10 emulator
- Instruction tests with automatic discovery
- JUnit format report generation
- Autocompletion for IC10 instructions
- Debug configuration for tests
- Biome integration for linting
- Code formatting
- TypeScript linting
- Automatic problem fixing
- Library building
- TypeScript type generation
- ESM and CommonJS support
- Porting mathematical and bitwise functions from the Game (C#) to Typescript
- Acknowledgments: Aidan647 for creating the exact math library that provides full calculation compatibility with Stationeers game
- crc-32 - Checksum calculation for device operations
- uuid - Unique identifier generation for emulator entities
- axios - HTTP client for data downloading
- vite - Modern project build system
- biome - Code formatting and linting
- Fork the repository
- Create a feature branch
- Implement changes
- Add tests
- Ensure all tests pass
- Create a Pull Request
- Use
bun run fixbefore commit - Follow Biome code style
- Add tests for new functionality
- Update documentation when necessary
# Quick project check
bun run fix
# Formatting only
bun run format
# Formatting check
bun run format:check
# Run specific generation script
bun run generate-device