Skip to content

Commit

Permalink
build: Refactor changelog generation & improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Marinerer committed Oct 23, 2024
1 parent f2f5e68 commit 7803607
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
4 changes: 0 additions & 4 deletions plugins/html-css/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

### Patch Changes 🌟

- feat: Add document & test cases ([78831bf](https://github.com/Meqn/pipflow/commit/78831bfd69f51a4b5f6a305051ef2cdbd5b7612e))
- feat: Enhance CSS processing with extended PostCSS config & improved error handling ([18e1352](https://github.com/Meqn/pipflow/commit/18e1352dba88f8842fb6db84c26d68f772e4e5e2))
- feat: Add Gulp plugin for processing style within HTML ([5abfe83](https://github.com/Meqn/pipflow/commit/5abfe83b525fbe9a7037a5fc9329d7e19b69cede))
- refactor: Improve PostCSS loader config & validate plugin options ([d0a1d1e](https://github.com/Meqn/pipflow/commit/d0a1d1e82915976bf3077c49ddd2f8e3b5158177))
- docs: Update README ([2cdacff](https://github.com/Meqn/pipflow/commit/2cdacff9e9f9a766308d57c20ae7b83ccea15141))

## 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const messagesType = ['feat', 'fix', 'perf', 'refactor', 'docs']
/**
* changeset 默认变更日志 (待替换)
*/
const defaultChangeLog = `- update.`
const defaultChangeLog = `update.`

module.exports = {
packagesMap,
Expand Down
15 changes: 3 additions & 12 deletions scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ function writePackageFile(name, data, filename) {
fs.writeFile(
path.resolve(__dirname, '../', packagesMap[name], filename || 'CHANGELOG.md'),
data,
(err) => {
if (err) {
reject(err)
}
resolve()
}
(err) => (err ? reject(err) : resolve())
)
})
}
Expand Down Expand Up @@ -77,12 +72,8 @@ function updateChangelog(content, version, logs) {
logStr = sortLogsByType(logs).join('\n')

return content
.replace(regex, (match, p1) => {
// console.log('replace : ', match, p1)
return match.replace('Changes', 'Changes ' + semverSymbol[p1])
// return match + ' ' + semverSymbol[p1]
})
.replace(defaultChangeLog, logStr)
.replace(regex, (match, p1) => match.replace('Changes', 'Changes ' + semverSymbol[p1]))
.replace(`- ${defaultChangeLog}`, logStr)
}

/**
Expand Down

0 comments on commit 7803607

Please sign in to comment.