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

Extend 'CSSBuilder' to Support In-Memory Config #54

Open
dmtrshat opened this issue Jan 6, 2025 · 0 comments
Open

Extend 'CSSBuilder' to Support In-Memory Config #54

dmtrshat opened this issue Jan 6, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@dmtrshat
Copy link
Member

dmtrshat commented Jan 6, 2025

Description

Add new methods or constructor in CSSBuilder that accept ConfigInMemory (it's better to create new CSSBuilder constructor or a separate impl). This means:

  • Parsing/Collecting Classes (if needed):
  • Replace file reads with direct iteration over the provided strings in ConfigInMemory.projects.
  • Possibly reuse the same parsing logic (Parser) by adding a method like parse_classes_from_string(content: &str).
  • Minification/Optimization:
    • Reuse CSSOptimizer but feed it the concatenated or generated string from memory, not from files.
    • Return or store compiled CSS in some internal structure (e.g., (output_name, compiled_css)).

Acceptance Criteria

  1. A new function, for example, CSSBuilder::new_in_memory(config: &ConfigInMemory, optimizer: &dyn CSSOptimizer, ...) -> Self (or an equivalent approach) is implemented.
  2. The method reads CSS from content: Vec<String> rather than file paths.
  3. For each in-memory project, returns (or stores) a compiled CSS string associated with output_name.
  4. Existing file-based constructor or build() remains functional and unbroken.
@dmtrshat dmtrshat added the enhancement New feature or request label Jan 6, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Grimoire CSS Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant