Skip to content

Allows components, systems, and initializers to be placed in subdirectories and specified in deploy.json#625

Closed
emersonhsieh wants to merge 2 commits into
latticexyz:mainfrom
emersonhsieh:main
Closed

Allows components, systems, and initializers to be placed in subdirectories and specified in deploy.json#625
emersonhsieh wants to merge 2 commits into
latticexyz:mainfrom
emersonhsieh:main

Conversation

@emersonhsieh

@emersonhsieh emersonhsieh commented Apr 13, 2023

Copy link
Copy Markdown
Contributor

Allows components, systems, and initializers to be placed in subdirectories. This helps with organizing components if there is a lot of them.

For example, "components/base/PositionComponent.sol" in the components directory will be imported as import { PositionComponent, ID as PositionComponentID } from "components/base/PositionComponent.sol"; in LibDeploy.sol.

Sample deploy.json:

  "components": [
    "debug/CounterComponent",
    "base/GameConfigComponent",
    "base/PositionComponent",
    "base/TileComponent",
    "base/OwnedByComponent",
    "resource/IronComponent",
    "resource/CopperComponent",
    "resource/IridiumComponent",
    "crafted/BulletComponent",
    "crafted/FastMinerComponent"
  ]

@dk1a

dk1a commented Apr 13, 2023

Copy link
Copy Markdown
Contributor

MUD2 doesn't have this problem, I'd suggest you use it; for MUD1 you can also look at #309 (which was abandoned in favor of v2)

@alvrs

alvrs commented Apr 14, 2023

Copy link
Copy Markdown
Member

Thanks for this PR @emersonhsieh! Unfortunately this change alone is not sufficient for full support of subdirectories, since system-types and other CLI command also assume a flat setup. Changing all these would touch a lot of v1 code, and since v2 (currently in alpha) is very close a stable release, we're not planning to add new features to v1. As @dk1a mentioned, v2 doesn't have the problem this PR addresses for v1.

@alvrs alvrs closed this Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants