![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Standardized commit message generation
Writing commit messages should benefit of automated assistance.
While the rules of this library are not perfect, it still helps writing commit messages with consistent style.
yarn add commit-fn
The library uses Inquirer
to take text or choice from the user. Generating the message includes the following steps:
The user can select one among:
'feat' - Significant change in functionality
'fix' - Fixing an issue
'test' - Writing unit or end-to-end tests for specific feature
'chore' - Update build tasks, lint files or similar(no production code change)
'docs' - Edit the documentation of the project
Start typing to select from predefined list of labels
In this step the user writes the actual commit message.
import { commitMessage } from 'commit-fn'
commitMessage().then((commitMessageValue: string) => {
console.log(commitMessageValue)
//=> 'feat@UI: use animation when logout'
})
commitAndPush
method will take the generated commit message and run the following commands for you:
1.git add . --all
2.git commit -m COMMIT_MESSAGE
3.git push
import { commitAndPush } from 'commit-fn'
commitAndPush().then((commitMessageValue: string) => {
console.log(commitMessageValue)
//=> Pushed with message 'feat@UI: use animation when logout'
})
Recommended way is to add the following in the scripts
property of your package.json
{
...
scripts:{
"commit":"commit-fn"
}
...
}
Now running yarn commit
will execute the commitAndPush
method.
"commitMessage": [
"script",
"build",
"prepublish",
"lint",
"typings",
"benchmark",
"refactor",
"method",
"docs",
"typings"
]
}
Every time STOP label is selected, the commit message will stay as WORK_IN_PROGRESS text.
Later if PROGRESS or STOP is selected, the WORK_IN_PROGRESS text will be prepended to the user input.
When STOP is selected WORK_IN_PROGRESS is reset back to an empty string.
Add commitMessage
field in your package.json
like so:
{
...
"commitMessage":{
"labels":[
"foo",
"bar",
"baz"
]
}
...
}
Custom labels belong to feat, fix, test
commit types.
type(label): COMMIT_MESSAGE
You just need to pass true
like so:
commitMessage(true).then((commitMessageValue: string) => {
console.log(commitMessageValue)
//=> 'feat(UI): use animation when logout'
})
You can further customize the behaviour of this library with setting commitMessage
field in your package.json
:
"commitMessage": {
"labels": [
"choose-word",
"learning-meme"
],
"feature": [
"speed"
],
"support": [
"webpack"
]
}
In the above example, all labels
members will be labels in feat, fix, test
commit types.
All feature
members will be labels in feat
commit type.
All support
members will be labels in chore
commit type.
const cwd = process.env.COMMIT_MESSAGE_CWD || process.cwd()
Replace fuzzy with fuzzyset
FAQs
commit-message
The npm package commit-fn receives a total of 5 weekly downloads. As such, commit-fn popularity was classified as not popular.
We found that commit-fn demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.