Skip to content

Dependency system for Mineunit modules #38

@S-S-X

Description

@S-S-X

As Mineunit is kind of built from modules and those are growing pretty fast it would be good to have well defined dependencies between modules.
Currently dependencies are handled by just implicitly loading dependencies when module is included in test set.

For example server module requires few others:

mineunit/server.lua

Lines 5 to 9 in 3ab99b0

mineunit("nodetimer")
mineunit("common/chatcommands")
mineunit("game/chat")

And itemstack requires metadata:

mineunit("metadata")

It would be good to have all these in one place so that loading order could be handled better, currently there's no well defined module loading order especially if modules are included individually.

However there's some upsides with not having well defined initialization order: it enforces writing code with better fault tolerance.
Basically it is harder to make shortcuts, global variables cannot be trusted.

It would be good if dependency system wont take away those restrictions but to enforce that quality it probably requires some way to test modules while ignoring dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions