Skip to content

Conversation

@whizzzkid
Copy link
Contributor

@whizzzkid whizzzkid commented Jan 29, 2026

Part 1 of 8

This is 1/8 of #265

Description of Changes (auto-gen)

  • Rename crate from dev-scope to dx-scope
  • Add src/internal module with UserInteraction and ProgressReporter traits
  • Add InquireInteraction implementation in cli/mod.rs
  • Update build.rs for library support
  • Update doc tests and binaries to use new crate name

This establishes the library-first architecture foundation.

- Rename crate from dev-scope to dx-scope
- Add src/internal module with UserInteraction and ProgressReporter traits
- Add InquireInteraction implementation in cli/mod.rs
- Update build.rs for library support
- Update doc tests and binaries to use new crate name

This establishes the library-first architecture foundation.

Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
@whizzzkid whizzzkid force-pushed the feat/refactor-library-part_1 branch from 3de01b0 to 2f73416 Compare January 29, 2026 23:57
@whizzzkid whizzzkid changed the title feat: add core library foundation with internal abstractions feat(refactor): add core library foundation with internal abstractions [1 of 8] Jan 30, 2026
@whizzzkid whizzzkid marked this pull request as ready for review January 30, 2026 00:04
Copy link
Contributor

@rubberduck203 rubberduck203 left a comment

Choose a reason for hiding this comment

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

Thanks for breaking this up. Much easier to review.

@@ -1,5 +1,5 @@
use clap::Parser;
use dev_scope::prelude::*;
use dx_scope::prelude::*;
Copy link
Contributor

Choose a reason for hiding this comment

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

2 questions

  • Why?
  • What does dx refer to here?

#[test]
fn test_inquire_interaction_is_send_sync() {
fn assert_send_sync<T: Send + Sync>() {}
assert_send_sync::<InquireInteraction>();
Copy link
Contributor

Choose a reason for hiding this comment

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

This test appears to be testing the compiler's type system.
I don't think we need to do that.


// Re-export commonly used types at the module level
pub use progress::{NoOpProgress, ProgressReporter};
pub use prompts::{AutoApprove, DenyAll, UserInteraction};
Copy link
Contributor

Choose a reason for hiding this comment

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

As part of this, we should stop reexporting everything all the time.
This dumps all of these types into the internal namespace.


/// Finish the current group.
fn finish_group(&self);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I actually really like this abstraction. I'm interested to see how it's used because I'm wondering if there's an auto-close implementation using the Drop trait that could automatically call finish_group for us.

#[test]
fn test_noop_progress_is_send_sync() {
fn assert_send_sync<T: Send + Sync>() {}
assert_send_sync::<NoOpProgress>();
Copy link
Contributor

Choose a reason for hiding this comment

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

We seem to be testing the compiler again.

@@ -1,10 +1,14 @@
pub mod analyze;
pub mod doctor;
pub mod internal;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe this should be pub considering it's an internal module.

pub mod shared;

// CLI module is internal - not part of public library API
pub(crate) mod cli;
Copy link
Contributor

Choose a reason for hiding this comment

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

It's okay if this comes later, but ideally, we do not export cli here, even inside the library.
We should only consume cli from the executables.

I do totally understand if this is mid-refactor and we're not there yet.


// Re-export internal abstractions at crate root for convenience
pub use internal::progress::{NoOpProgress, ProgressReporter};
pub use internal::prompts::{AutoApprove, DenyAll, UserInteraction};
Copy link
Contributor

Choose a reason for hiding this comment

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

We really need to stop dumping everything into the root namespace and preludes.

pub use internal::prompts::{AutoApprove, DenyAll, UserInteraction};

// Re-export CLI implementation for interactive applications
pub use cli::InquireInteraction;
Copy link
Contributor

Choose a reason for hiding this comment

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

This exports the type directly into the crate's root namespace.

builder.all_build();

// Git info only available when building from git repo
// This allows the crate to be built from crates.io where .git doesn't exist
Copy link
Contributor

Choose a reason for hiding this comment

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

Good comment. Says why not what. Double plus good.

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