Skip to content

LuauRequireMode is pub(crate) instead of pub, breaking programmatic usage of BundleRequireMode::Luau #359

Description

@amirfarzamnia

Describe the bug
When using darklua_core programmatically, LuauRequireMode cannot be instantiated directly because it is marked as pub(crate) in the module hierarchy, whereas PathRequireMode is exported as pub.

As a result, users cannot construct a BundleConfiguration using BundleRequireMode::Luau in Rust code.

To Reproduce
Attempting to construct a bundle configuration using BundleRequireMode::Luau:

use darklua_core::rules::require::LuauRequireMode; // Error: module or type is private / pub(crate)
use darklua_core::rules::BundleRequireMode;
use darklua_core::config::Configuration;
use darklua_core::bundle::BundleConfiguration;

let configuration = Configuration::empty().with_bundle_configuration(
    BundleConfiguration::new(
        BundleRequireMode::Luau(LuauRequireMode::default()),
    )
);

Expected behavior
LuauRequireMode should be publicly accessible (pub) just like PathRequireMode, allowing full programmatic access:

use darklua_core::rules::require::PathRequireMode; // Works fine

let configuration = Configuration::empty().with_bundle_configuration(
    BundleConfiguration::new(
        BundleRequireMode::Path(PathRequireMode::default()),
    )
);

Suggested Solution
Change the visibility of LuauRequireMode from pub(crate) to pub.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions