Skip to content

Extract commands into a dedicated package - #358

Merged
waynemwashuma merged 5 commits into
wimaengine:devfrom
waynemwashuma:commands-package
Aug 17, 2026
Merged

Extract commands into a dedicated package#358
waynemwashuma merged 5 commits into
wimaengine:devfrom
waynemwashuma:commands-package

Conversation

@waynemwashuma

@waynemwashuma waynemwashuma commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Objective

Introduces a dedicated @wimaengine/commands package for high-level engine commands and moves command execution out of @wimaengine/core.

Solution

The command architecture is split into three responsibilities:

  • @wimaengine/command provides the command infrastructure, including CommandQueue and command execution.
  • @wimaengine/commands provides high-level commands and APIs such as EntityCommands and ResourceCommands.
  • @wimaengine/core retains core engine functionality without depending on the command package.

Command execution is now registered by CommandsPlugin during both Startup and Update, in the CoreSystems.End group.

Why This Approach

This solution was chosen because:

  • It separates the low-level command infrastructure from the high-level engine commands that depend on it.
  • It removes high-level command functionality from @wimaengine/core, reducing the responsibility of the core package.
  • Command execution now belongs to the command package that provides the command infrastructure.
  • Consumers that need high-level commands can depend directly on @wimaengine/commands instead of importing them from @wimaengine/core.

Showcase

Before

High-level commands and command execution were part of @wimaengine/core:

import { EntityCommands } from '@wimaengine/core'

Command execution was also registered by CorePlugin.

After

High-level commands are provided by the dedicated commands package:

import { EntityCommands } from '@wimaengine/commands'

Command execution is provided by @wimaengine/command and registered through CommandsPlugin

Migration Guide

No migration is required.

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@waynemwashuma
waynemwashuma merged commit 2e7ae6a into wimaengine:dev Aug 17, 2026
7 checks passed
@waynemwashuma
waynemwashuma deleted the commands-package branch August 17, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant