docs(README): enhance badge update documentation and improve npm badge
- Updated the npm version badge in `README.md` to explicitly display the current version dynamically. - Added a new "Badge Maintenance" section to detail the automated badge update process during build or version changes. - Enhanced `generate-version.js` script to improve badge update logic, ensuring the npm version badge reflects `package.json` accurately. - Strengthened maintainability and accuracy of documentation for future updates.
This commit is contained in:
parent
1210638242
commit
64d77dfb5c
2 changed files with 14 additions and 3 deletions
|
|
@ -66,12 +66,12 @@ try {
|
|||
// Get TypeScript version from package.json devDependencies
|
||||
const typescriptVersion = packageJson.devDependencies.typescript.replace('^', '')
|
||||
|
||||
// Update npm badge - using a more flexible approach
|
||||
// Update npm badge - using a more flexible approach with explicit version
|
||||
const npmBadgeRegex = /\[\!\[npm\].*?\]\(https:\/\/www\.npmjs\.com\/package\/@soulcraft\/brainy\)/g
|
||||
if (npmBadgeRegex.test(readmeContent)) {
|
||||
readmeContent = readmeContent.replace(
|
||||
npmBadgeRegex,
|
||||
`[](https://www.npmjs.com/package/@soulcraft/brainy)`
|
||||
`[](https://www.npmjs.com/package/@soulcraft/brainy)`
|
||||
)
|
||||
} else {
|
||||
console.log('Warning: Could not find npm badge in README.md')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue