Skip to content

fix:re-export XpFile#103

Closed
mors119 wants to merge 0 commit into
utilForever:mainfrom
mors119:fix/rltk-rex-exports
Closed

fix:re-export XpFile#103
mors119 wants to merge 0 commit into
utilForever:mainfrom
mors119:fix/rltk-rex-exports

Conversation

@mors119
Copy link
Copy Markdown

@mors119 mors119 commented May 24, 2026

What

Re-exports XpFile, XpLayer, and XpCell from the bracket-lib prelude and adds a rexpaint module for full bracket-rex access.

Why

Common RexPaint workflows currently require importing these types from bracket-rex directly. This change makes the commonly used types available through the main bracket-lib facade while avoiding a broad bracket-rex prelude re-export, which could introduce conflicts such as XpColor.

No related issue.

Checklist

Required

  • cargo check --all passes
  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets -- -D warnings -A clippy::multiple-crate-versions passes
  • cargo test --all passes
  • I linked the related issue (for example: Closes #123)

Functional Validation

  • Behavior related to this change was verified locally (if applicable)
  • Rendering/backend behavior was verified when runtime code changed (if applicable)
  • Algorithm behavior (pathfinding/FOV/noise/random) was verified when affected (if applicable)
  • I added or updated tests for changed behavior (if applicable)

Configuration & Docs

  • User-facing docs were updated (README.md, ARCHITECTURE.md, or relevant manual pages, if applicable)
  • New dependencies/configuration are documented (if applicable)
  • No sensitive values or credentials were introduced

If Applicable

  • Security impact considered (run cargo audit locally if needed)
  • Breaking behavior changes are clearly described in this PR

Summary by CodeRabbit

  • New Features
    • RexPaint file format support is now available through the library's public API for user access and manipulation.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 24, 2026

📝 Walkthrough

Walkthrough

The PR integrates the bracket-rex crate by declaring it as a local dependency in Cargo.toml and exposing its RexPaint types (XpCell, XpFile, XpLayer) through bracket-lib's public API via prelude re-exports and a new dedicated rexpaint module.

Changes

RexPaint Integration

Layer / File(s) Summary
Dependency and API integration
Cargo.toml, src/lib.rs
bracket-rex is added as a local path dependency with version ~0.8, and its core types are re-exported through the prelude and a new public rexpaint module for direct access.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Suggested reviewers

  • utilForever

Poem

📦 A crate arrives by local path's grace,
With RexPaint types now finding their place,
Through prelude and rexpaint modules bright,
The rabbit bundles bracket-lib right. 🎨✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions re-exporting XpFile, which is part of the change, but omits the equally important additions of XpLayer and XpCell re-exports and the new rexpaint module.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib.rs`:
- Line 13: Add a colocated tests module file (e.g., src/tests.rs) that verifies
the new public re-exports compile by importing crate::prelude::{XpCell, XpFile,
XpLayer} and crate::rexpaint::XpColor and adding two minimal tests: one that
calls core::mem::size_of::<XpCell|XpLayer|XpFile>() to ensure those types
resolve, and another that references XpColor::BLACK to ensure the rexpaint
module exposes its prelude; place these tests alongside the module so CI will
compile-time verify the new exports.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 433901f8-f2f3-4a25-8dce-1c0ce8ce54cf

📥 Commits

Reviewing files that changed from the base of the PR and between fe7bf77 and fb94a77.

📒 Files selected for processing (2)
  • Cargo.toml
  • src/lib.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: Format all Rust code using cargo fmt --all
Fix all cargo clippy warnings — the CI enforces -D warnings
Add tests for new functionality in the relevant module; for split domains, prefer colocated tests.rs

Files:

  • src/lib.rs
🔇 Additional comments (1)
Cargo.toml (1)

46-46: LGTM!

Comment thread src/lib.rs Outdated
pub use bracket_noise::prelude::*;
pub use bracket_pathfinding::prelude::*;
pub use bracket_random::prelude::*;
pub use bracket_rex::prelude::{XpCell, XpFile, XpLayer};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add API-surface tests for the new rexpaint exports.

This introduces new public entry points (prelude::{XpCell, XpFile, XpLayer} and rexpaint::*) but no tests validate those exports compile and resolve correctly.

Proposed minimal test wiring
--- a/src/lib.rs
+++ b/src/lib.rs
@@
 pub mod rexpaint {
     pub use bracket_rex::prelude::*;
 }
+
+#[cfg(test)]
+mod tests;
// src/tests.rs
use crate::prelude::{XpCell, XpFile, XpLayer};
use crate::rexpaint::XpColor;

#[test]
fn prelude_reexports_rex_core_types() {
    let _ = core::mem::size_of::<XpCell>();
    let _ = core::mem::size_of::<XpLayer>();
    let _ = core::mem::size_of::<XpFile>();
}

#[test]
fn rexpaint_module_exposes_full_prelude() {
    let _ = XpColor::BLACK;
}

As per coding guidelines, "Add tests for new functionality in the relevant module; for split domains, prefer colocated tests.rs."

Also applies to: 58-62

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib.rs` at line 13, Add a colocated tests module file (e.g.,
src/tests.rs) that verifies the new public re-exports compile by importing
crate::prelude::{XpCell, XpFile, XpLayer} and crate::rexpaint::XpColor and
adding two minimal tests: one that calls
core::mem::size_of::<XpCell|XpLayer|XpFile>() to ensure those types resolve, and
another that references XpColor::BLACK to ensure the rexpaint module exposes its
prelude; place these tests alongside the module so CI will compile-time verify
the new exports.

@mors119 mors119 closed this May 25, 2026
@mors119 mors119 force-pushed the fix/rltk-rex-exports branch from fb94a77 to fe7bf77 Compare May 25, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant