Skip to content

feat(config): auto-resolve command from package.json scripts#88

Merged
hyldmo merged 3 commits intomainfrom
hyldmo/npm-name-shorthand
Mar 16, 2026
Merged

feat(config): auto-resolve command from package.json scripts#88
hyldmo merged 3 commits intomainfrom
hyldmo/npm-name-shorthand

Conversation

@hyldmo
Copy link
Copy Markdown
Owner

@hyldmo hyldmo commented Mar 16, 2026

Summary

  • When a process config has no command and its name matches a package.json script, the command is automatically set to <pm> run <name>
  • Eliminates redundancy like 'lint': { command: 'npm:lint' } — now just 'lint': {} works
  • Passes through unchanged if no matching script exists (validator catches missing command as before)

Test plan

  • Added test: commandless entry auto-resolves when name matches a script
  • Added test: commandless entry not matching a script passes through unchanged
  • Added test: no package.json — commandless entries pass through
  • All 598 existing tests pass
  • Typecheck clean
  • Lint clean

🤖 Generated with Claude Code

hyldmo and others added 3 commits March 16, 2026 14:09
When a process has no command and its name matches a package.json
script, the command is automatically set to `<pm> run <name>`.
This eliminates the redundancy of `'lint': { command: 'npm:lint' }` —
now just `'lint': {}` works.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
`lint: true` is now equivalent to `lint: {}` — both auto-resolve to
`<pm> run lint` when the name matches a package.json script.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hyldmo hyldmo merged commit 5a18dde into main Mar 16, 2026
2 checks passed
@hyldmo hyldmo deleted the hyldmo/npm-name-shorthand branch March 16, 2026 13:17
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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