Skip to content

Support for Configurable Directories for Generated and Loaded Content in rclnodejs via Environment Variables for Monorepo Reuse #1221

@uinz

Description

@uinz

Currently, the rclnodejs project generates and stores its output within the node_modules/rclnodejs directory in the repository. This approach is limiting in monorepo projects, as the generated content is tightly coupled to a specific directory structure, making it challenging to reuse a single rclnodejs dependency across multiple sub-projects. This restricts its adaptability for diverse platforms or applications, particularly in monorepo scenarios where dependency sharing is critical.
To improve flexibility, enable reuse of a single rclnodejs instance in monorepo projects, and better accommodate the needs of different platforms and applications, I propose adding support for configurable directories for both generating and loading content via environment variables. This would allow users to specify custom directories while preserving the current behavior as the default.
Proposed Changes:

  1. Configurable Output Directory for Generated Content via Environment Variables:
    • Add support for specifying the output directory for generated files through an environment variable.
    • This would allow users to define a custom location for generated content, facilitating organization and management in monorepo setups.
    • Default behavior: Continue generating content in node_modules/rclnodejs to maintain backward compatibility.
  2. Configurable Loading Directory for Generated Content via Environment Variables:
    • Add support for specifying the directory from which generated content is loaded through an environment variable .
    • This would enable users to load content from a custom directory, supporting use cases where monorepo sub-projects need to source content from different locations.
    • Default behavior: Continue loading content from node_modules/rclnodejs to ensure existing functionality remains unchanged.
    Benefits:
    • Enhanced ability to reuse a single rclnodejs dependency across monorepo sub-projects.
    • Increased flexibility for projects targeting multiple platforms or applications.
    • Better organization of generated content for complex workflows.
    • Backward compatibility with the current directory structure to avoid breaking existing setups.
    Additional Notes:
    • Configuration should be implemented via environment variables for simplicity and cross-platform compatibility.
    • Documentation should be updated to guide users on setting these environment variables, particularly for monorepo scenarios.
export RCLNODEJS_GENERATED_DIR="./custom-dir"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions