Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Exclusion/Inclusion Tags #66

Open
jtmuller5 opened this issue Sep 1, 2024 · 3 comments
Open

Feature request: Exclusion/Inclusion Tags #66

jtmuller5 opened this issue Sep 1, 2024 · 3 comments
Labels
enhancement New feature or request needs discussion Issues needing discussion and a decision to be made before action can be taken

Comments

@jtmuller5
Copy link

I've been using this tool for a few days and it's great. I've created a handful of config files for when I'm working on different parts of my app (UI, cloud functions, scripts, etc) and it works well but I've found myself wanting to only include specific parts of files in specific "packs".

For example, when working on an edge function feature, I want my AI to be aware of my button component so it can create a test page and I want to reference a few lines of a separate file that shows how the button is used (this is a very simple example but it gets the idea across).

My idea is to specify optional inclusion and Exclusion tags in the config file (ex. "// KEEP" and "// OMIT", respectively) and then when you run repopack, if it has those tags it will include code between the "KEEP" comments and exclude code between the "OMIT" comments. If a file has neither of the specific tags, all of it is included.

This would give users a lot of flexibility when creating repopacks that are specific to some domain within their apps:

  • UI-KEEP
  • UI-OMIT
  • DB-KEEP
  • DB-OMIT
  • ...

The idea needs little bit of ironing out but it has the potential to save on token counts and help in situations where your files are huge.

This is an awesome tool, especially combined with Claude projects!

@yamadashy
Copy link
Owner

yamadashy commented Sep 1, 2024

Hi @jtmuller5,

Thanks for sharing this interesting idea! I appreciate your feedback and the time you've taken to explain your needs.

Considering future maintenance, i believe implementing a slightly simpler version of this feature would be beneficial for the project's long-term sustainability. With this in mind, i'm considering an approach like this:

// Normal code (included in output)

// repopack-ignore-start
// This block will be excluded from the Repopack output
// repopack-ignore-end

// More normal code (included in output)

This approach would:

  • Require no configuration
  • Work in any file
  • Be straightforward to implement and use
  • Feel familiar to developers who have used ESLint (eslint-disable, eslint-enable) or similar tools

It could allow for focused "packs" as you described, while maintaining simplicity in the codebase and ensuring easier maintenance going forward.

What are your thoughts on this approach? Would it address your needs?

Thank you again for your valuable input in helping us improve Repopack!

@jtmuller5
Copy link
Author

Hi! I think this helps make packs smaller but it wouldn't let users create specific "packs" since the same code would be omitted for every pack.

Maybe that can be it's own issue (having some way to configure what code is omitted in a config file).

Thanks!

@yamadashy
Copy link
Owner

I apologize for misunderstanding your initial request. You're right - the ability to create context-specific "packs" is key.

I now understand you're looking for a way to dynamically include or exclude different parts of the code based on the specific context or task. Your idea about configuring this in a config file is interesting. Does this align with what you had in mind?

I agree there's a need for this in larger projects. I'll give this more thought and consider how to implement a solution for dynamic code selection.

Thank you for helping me understand better!

@yamadashy yamadashy added the enhancement New feature or request label Nov 6, 2024
@yamadashy yamadashy added the needs discussion Issues needing discussion and a decision to be made before action can be taken label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs discussion Issues needing discussion and a decision to be made before action can be taken
Projects
None yet
Development

No branches or pull requests

2 participants