Skip to content

feat(config): add wildcard support for template remove/update and refactor logic#92

Merged
IT-WIBRC merged 1 commit intodevelopfrom
feat/add-wildcard-remove-update
Oct 3, 2025
Merged

feat(config): add wildcard support for template remove/update and refactor logic#92
IT-WIBRC merged 1 commit intodevelopfrom
feat/add-wildcard-remove-update

Conversation

@IT-WIBRC
Copy link
Owner

@IT-WIBRC IT-WIBRC commented Oct 3, 2025

Description

✨ Feature: Wildcard Template Management (*)

This PR introduces support for the wildcard character (*) in the dk config remove and dk config update commands. Users can now apply actions to all templates under a specific language with a single command.

🚀 Refactoring and Test Coverage

This change involves significant refactoring to separate the command logic from the Commander setup, leading to much improved modularity and testability.

Key Changes:

  • Logic Extraction: The core configuration management logic for init, remove, and update commands has been moved into dedicated logic.js files within their respective command folders (e.g., src/commands/config/remove/logic.js).
  • Wildcard Resolution: New utility functions, like resolveTemplateNamesForUpdate, were introduced to correctly map template names, aliases, and the wildcard (*) to the actual templates in the config.
  • Comprehensive Unit Tests: Added extensive unit tests for the core logic of init, remove, and update to ensure stability and maintain 100% test coverage for the refactored utility functions.
  • README Update: The documentation was updated to clearly showcase the new wildcard functionality for template removal and mass updates.

Examples of New Wildcard Usage:

Command Description
dk config remove javascript * Removes ALL templates under the javascript language.
dk config update python * --package-manager pip Applies packageManager: pip to ALL templates under the python language.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • New and existing feature support current supported languages
  • Any dependent changes have been merged and published in downstream modules

@IT-WIBRC IT-WIBRC force-pushed the feat/add-wildcard-remove-update branch from 9bada55 to 9bbb68f Compare October 3, 2025 20:59
@IT-WIBRC IT-WIBRC force-pushed the feat/add-wildcard-remove-update branch from 9bbb68f to c065024 Compare October 3, 2025 21:08
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

Coverage Report for ./packages/devkit

Status Category Percentage Covered / Total
🟢 Lines 92.68% (🎯 85%) 3432 / 3703
🟢 Statements 92.68% (🎯 85%) 3432 / 3703
🟢 Functions 95.65% (🎯 90%) 154 / 161
🟢 Branches 93.51% (🎯 85%) 750 / 802
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/devkit/src/commands/config/remove.ts 97.45% 97.29% 100% 97.45% 140-143
packages/devkit/src/commands/config/update.ts 0% 0% 0% 0% 1-209
packages/devkit/src/commands/config/remove/index.ts 100% 100% 100% 100%
packages/devkit/src/commands/config/remove/logic.ts 100% 100% 100% 100%
packages/devkit/src/commands/config/update/index.ts 100% 100% 100% 100%
packages/devkit/src/commands/config/update/logic.ts 100% 94.44% 100% 100%
packages/devkit/src/commands/init/index.ts 100% 100% 100% 100%
packages/devkit/src/commands/init/logic.ts 98.95% 93.75% 100% 98.95% 42
Generated in workflow #273 for commit c065024 by the Vitest Coverage Report Action

@IT-WIBRC IT-WIBRC merged commit c5260ed into develop Oct 3, 2025
2 checks passed
@github-actions github-actions bot deleted the feat/add-wildcard-remove-update branch October 3, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant