counsel-rule-script
adds a npm/yarn script to package.json.
example
- create your rules
const ScriptRule = let publishRules = scriptName: 'publish-minor' // required scriptCommand: 'npm version minor' // required scriptName: 'publish-minor' scriptCommand: 'git push origin master --tags && npm publish' // optionally, let multiple ScriptRules add to the same `script`. scriptAppend: true scriptName: 'bananas' scriptCommand: 'bananas --peel' // permit variants of a script to exist for `scriptName`. // variants can be explict strings or RegExp's // @NOTE: `scriptCommandVariants: '*'` allows any user provided script to override the rule scriptCommandVariants: 'bananas --eat' 'apples --eat' /fruit.io --consume/ scriptName: 'lint' scriptCommand: 'standard' // do you _know_ that you've changed your ways? // force upgrade everyone if you know what to look for! // for instance, you use standard now instead of eslint overrideConditions: oldScript
- apply your rules (per
counsel
docs) - observe your package.json's
publish-minor
script
in this contrived example, we observe how the ScriptRule can add scripts to the package. further, we can see how in append mode, you can chain commands to a common script name.