npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

cbt-game-generator

v1.0.72

Published

Configuration generator for CBT animation apps

Readme

CBT Game Generator

A TypeScript-based library for generating game configurations for CBT (Computer-Based Training) applications. This library helps automate the creation of game configurations with support for multiple variants, sub-levels, and targets.

Features

  • Generate game configurations with multiple variants
  • Support for different game types (e.g., SPEECH, VISION, ANIMATION)
  • Automatic generation of TypeScript types and interfaces
  • Dynamic variant configuration based on targets
  • Support for multiple sub-levels (sub-los)
  • Asset mapping for various media types (Lottie, WebP/SVG, Audio, Video)
  • React component generation for game integration
  • Automatic creation of asset directory structure with placeholder files
  • Support for incremental updates to add new sub-levels

Installation

npm install -g cbt-game-generator

Usage

  1. Create a config.json file in your project:
{
  "skillName": "expressive-skill",
  "gameName": "LabelPlaces",
  "gameType": "SPEECH",
  "numberOfVariants": 3,
  "targets": {
    "sub-lo-1": ["ZOO", "PARK", "SCHOOL"],
    "sub-lo-2": ["MARKET", "HOSPITAL", "LIBRARY"]
  }
}
  1. Run the generator:
cbt-game-generator --config config.json

Or specify the config file path:

cbt-game-generator --config path/to/your/config.json

Incremental Updates

To add a new sub-level to an existing game configuration, create a config file with only the new sub-level:

{
  "skillName": "expressive-skill",
  "gameName": "LabelPlaces",
  "gameType": "SPEECH",
  "numberOfVariants": 3,
  "targets": {
    "sub-lo-3": ["BEACH", "MOUNTAIN", "FOREST"]
  },
  "isIncremental": true
}

Then run the generator with the same command:

cbt-game-generator --config config.json

The generator will:

  1. Update existing type definitions
  2. Add new variants to the configuration
  3. Generate new variant files
  4. Update the Main component
  5. Create new asset directories

Config File Format

| Field | Type | Description | Required | |-------|------|-------------|----------| | skillName | string | Name of the skill (e.g., 'expressive-skill') | Yes | | gameName | string | Name of the game (e.g., 'LabelPlaces') | Yes | | gameType | string | Type of the game ('SPEECH', 'VISION', 'ANIMATION') | Yes | | numberOfVariants | number | Number of variants per sub-level | Yes | | targets | object | Mapping of sub-levels to their targets | Yes | | isIncremental | boolean | Whether this is an incremental update | No |

Generated Structure

The generator creates the following directory structure:

src/experience/games/
└── expressive-skill/
    └── label-places/
        ├── types/
        │   ├── configuration.ts
        │   └── tagTypes.ts
        ├── constants/
        │   ├── targets.ts
        │   ├── variantsConfig.ts
        │   └── defaults.ts
        ├── configuration/
        │   ├── game-config/
        │   │   ├── gameBaseConfig.ts
        │   │   └── function.ts
        │   └── variants-config/
        │       ├── sub-lo-1/
        │       │   ├── variantsBaseConfigSubLo1.ts
        │       │   ├── LabelPlacesV1.ts
        │       │   ├── LabelPlacesV2.ts
        │       │   └── LabelPlacesV3.ts
        │       └── sub-lo-2/
        │           ├── variantsBaseConfigSubLo2.ts
        │           ├── LabelPlacesV4.ts
        │           ├── LabelPlacesV5.ts
        │           └── LabelPlacesV6.ts
        └── Main.tsx

public/assets/
└── expressive-skill/
    └── label-places/
        ├── textures/
        │   ├── sub-lo-1/
        │   │   ├── zoo.webp
        │   │   ├── zoo.json
        │   │   ├── park.webp
        │   │   ├── park.json
        │   │   └── ...
        │   └── sub-lo-2/
        │       ├── market.webp
        │       ├── market.json
        │       └── ...
        └── videos/
            ├── sub-lo-1/
            │   ├── zoo.mp4
            │   ├── zoo_half.mp4
            │   ├── park.mp4
            │   ├── park_half.mp4
            │   └── ...
            └── sub-lo-2/
                ├── market.mp4
                ├── market_half.mp4
                └── ...

Asset Structure

The generator automatically creates the following asset structure:

  1. Textures Directory:

    • Contains .webp files for backgrounds
    • Contains .json files for Lottie animations
    • Organized by sub-levels
  2. Videos Directory:

    • Contains .mp4 files for face prompts
    • Contains *_half.mp4 files for half face prompts
    • Organized by sub-levels

Placeholder files are created for all required assets. You can replace these with your actual asset files.