Skip to content

feat: add --include-defaults flag to list commands and document {pm} token#91

Merged
IT-WIBRC merged 1 commit intodevelopfrom
feat/config-defaults-pm-token
Oct 3, 2025
Merged

feat: add --include-defaults flag to list commands and document {pm} token#91
IT-WIBRC merged 1 commit intodevelopfrom
feat/config-defaults-pm-token

Conversation

@IT-WIBRC
Copy link
Owner

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

Description

This PR introduces the --include-defaults option to the dk list and dk config list commands, allowing users to view Scaffolder's built-in, default settings and templates alongside their custom configurations.

Additionally, this PR includes updated documentation to clarify the use of the new {pm} token, which simplifies writing package manager-agnostic commands in template configurations.


Key Changes

1. Add --include-defaults (-d) Flag

  • dk list [-d | --include-defaults]: When used, the output will merge and display all available templates, including the built-in Scaffolder defaults. This provides a complete view of all templates that can be used with dk new.
  • dk config list [-d | --include-defaults]: Extends the detailed configuration view to include the Default configuration source, making it easier for users to debug configuration overrides and understand what settings/templates are provided out-of-the-box.

2. Introduce and Document {pm} Token

  • The special token {pm} can now be used in the location property of command-based template configurations (e.g., {pm} create next-app@latest).
  • This token is dynamically replaced at runtime with the effective package manager determined by the configuration hierarchy (template-specific packageManager > global defaultPackageManager > CLI default).
  • Documentation (README.md) has been updated to explain the purpose and usage of this token, promoting package manager-agnostic template definitions.

Why This is Valuable

These changes enhance user control and transparency:

  • Clarity: Users can now easily see which templates are custom, global, or system defaults.
  • Flexibility: The {pm} token allows users to define template commands that automatically adapt to their preferred package manager setting.

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 changed the title feat: add --include-defaults flag to list commands and document {pm} token feat: add --include-defaults flag to list commands and document {pm} token Oct 3, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

Coverage Report for ./packages/devkit

Status Category Percentage Covered / Total
🟢 Lines 97.4% (🎯 85%) 3038 / 3119
🟢 Statements 97.4% (🎯 85%) 3038 / 3119
🟢 Functions 95.91% (🎯 90%) 141 / 147
🟢 Branches 93.08% (🎯 85%) 660 / 709
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/devkit/src/commands/index.ts 100% 100% 100% 100%
packages/devkit/src/commands/list.ts 99.09% 91.3% 100% 99.09% 121
packages/devkit/src/commands/new.ts 93.67% 87.5% 100% 93.67% 14-17, 78
packages/devkit/src/commands/config/add.ts 100% 82.35% 100% 100%
packages/devkit/src/commands/config/index.ts 100% 95.45% 100% 100%
packages/devkit/src/commands/config/list.ts 95.37% 93.54% 100% 95.37% 48-53
packages/devkit/src/commands/config/logic.ts 97.56% 95% 100% 97.56% 90-91, 141
packages/devkit/src/commands/config/remove.ts 100% 96.55% 100% 100%
packages/devkit/src/core/config/finder.ts 100% 100% 100% 100%
packages/devkit/src/core/config/loader.ts 100% 100% 100% 100%
packages/devkit/src/core/config/merger.ts 100% 100% 66.66% 100%
packages/devkit/src/core/info/info.ts 97.36% 93.75% 100% 97.36% 22-23
packages/devkit/src/core/template/annotator.ts 100% 93.75% 100% 100%
packages/devkit/src/core/template/printer.ts 93.79% 72.97% 100% 93.79% 20, 47, 50, 107-110, 123, 140
packages/devkit/src/utils/i18n/translation-loader.ts 100% 100% 100% 100%
packages/devkit/src/utils/schema/schema.ts 100% 100% 100% 100%
Generated in workflow #269 for commit c260046 by the Vitest Coverage Report Action

@IT-WIBRC IT-WIBRC force-pushed the feat/config-defaults-pm-token branch from 265d9e2 to c260046 Compare October 3, 2025 18:12
@IT-WIBRC IT-WIBRC merged commit 962819a into develop Oct 3, 2025
2 checks passed
@github-actions github-actions bot deleted the feat/config-defaults-pm-token branch October 3, 2025 18: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