SceneryStack Development Guide¶
Under Construction
This section and others in Getting Started with SceneryStack are under heavy revisement and will be updated in January 2025.
Introduction¶
Welcome to the SceneryStack development guide! This document is intended for developers who want to contribute to SceneryStack, an open-source library ecosystem for building interactive educational simulations in HTML5.
SceneryStack is built with a modular approach, making it versatile for creating simulations that integrate features like custom graphics, audio effects, animations, and accessibility. This guide will walk you through setting up your environment, understanding the repository structure, and starting your development journey.
For discussions and feedback, visit the SceneryStack Discussions forum.
Getting Started¶
Prerequisites¶
Before setting up your development environment, ensure the following tools are installed:
- Command Line Interface: Use Terminal (macOS) or Command Prompt (Windows).
- Git: Download from git-scm.com or install via Xcode command-line tools on macOS.
- Node.js and npm: Install the latest version from Node.js. After installation, run:
- Grunt CLI: For building simulations, install Grunt globally:
- HTTP Server: To serve files locally, install a lightweight server:
Setting Up the Project Directory¶
- Create a directory for the source code:
- Clone the repository:
- Run the repository setup script:
Installing Dependencies¶
Install project dependencies:
- Navigate to the required directories and run:
Development Workflow¶
Transpiling TypeScript¶
- Navigate to the build tools directory:
- Run the TypeScript transpiler with live reloading:
Running a Simulation¶
- Serve the files locally:
- Open your browser and navigate to:
Modifying and Testing¶
- Modify the simulation source code in your text editor.
- Refresh the browser to see the changes.
Building a Simulation¶
To create a production-ready build:
- Navigate to the simulation directory:
- Run the build command:
- Access the built simulation at:
Repository Overview¶
SceneryStack libraries are modular and follow the Model-View-Controller (MVC) design pattern. Here’s a breakdown of key repositories:
Core Libraries¶
- Dot: Core math utilities (vectors, matrices).
- Axon: Event-driven architecture with properties and emitters.
- Tandem: Support for name-object registration and instrumentation.
Rendering and UI¶
- Scenery: Graphics rendering engine (SVG, Canvas, WebGL).
- Sun: UI components like buttons and sliders.
- Twixt: Animation and tweening.
Interaction and Accessibility¶
- Tambo: Audio effects and sonification.
- UtteranceQueue: Accessibility support via ARIA live regions.
- Tangible: Tangible input via computer vision.
Tooling¶
Contributing¶
Coding Standards¶
- Follow the SceneryStack Code Style Guide.
- Use ESLint for linting:
- Add comments and documentation for maintainability.
Testing¶
- Run unit tests after modifications:
- Use query parameters for debugging:
?ea
: Enable assertions.?showPointerAreas
: Visualize touch/mouse input regions.
Submitting Changes¶
- Create a new branch for your feature or fix.
- Commit changes with clear messages referencing any relevant issues.
- Submit a pull request for review.
Resources¶
- Developer Community: For community support and feedback.
- Example Simulation: A template to create new simulations.