news-fragments 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/package.json +5 -5
- package/src/build-template.js +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
|
|
2
|
+
[//]: # (s-2.0.11)
|
|
3
|
+
|
|
4
|
+
# [2.0.11] - (2023-02-01)
|
|
5
|
+
|
|
6
|
+
## Bugfixes
|
|
7
|
+
* Fix function saveChangelogToFile to avoid duplicate fragment in loop. [#508](https://github.com/grupoboticario/news-fragments/issues/508) [#543](https://github.com/grupoboticario/news-fragments/pull/543)
|
|
8
|
+
|
|
9
|
+
## Misc
|
|
10
|
+
* Update project dependencies.
|
|
11
|
+
|
|
12
|
+
[//]: # (e-2.0.11)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
[//]: # (s-2.0.10)
|
|
16
|
+
|
|
17
|
+
# [2.0.10] - (2022-12-28)
|
|
18
|
+
|
|
19
|
+
## Misc
|
|
20
|
+
* Update project dependencies.
|
|
21
|
+
|
|
22
|
+
[//]: # (e-2.0.10)
|
|
23
|
+
|
|
24
|
+
|
|
2
25
|
[//]: # (s-2.0.9)
|
|
3
26
|
|
|
4
27
|
# [2.0.9] - (2022-12-02)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "news-fragments",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"description": "A release-it plugin to manipulate changelogs",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/grupoboticario/news-fragments#readme",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@release-it/bumper": "4.0.0",
|
|
32
|
+
"@release-it/bumper": "^4.0.0",
|
|
33
33
|
"eslint": "^8.26.0",
|
|
34
34
|
"eslint-config-prettier": "^8.3.0",
|
|
35
35
|
"eslint-plugin-prettier": "^4.1.0",
|
|
36
|
-
"eslint-plugin-simple-import-sort": "
|
|
36
|
+
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
37
37
|
"jest": "^29.0.0",
|
|
38
38
|
"mock-fs": "^5.1.0",
|
|
39
39
|
"mockdate": "^3.0.5",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"semver": "^7.3.5"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"chalk": "5.
|
|
46
|
-
"chalk-template": "^0.
|
|
45
|
+
"chalk": "^5.2.0",
|
|
46
|
+
"chalk-template": "^0.5.0",
|
|
47
47
|
"fs-extra": "^11.0.0",
|
|
48
48
|
"handlebars": "^4.7.7",
|
|
49
49
|
"joi": "^17.4.2",
|
package/src/build-template.js
CHANGED
|
@@ -18,15 +18,17 @@ export const renderTemplate = function (changelogTemplate, data, version) {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export const saveChangelogToFile = function (filePath, renderedTemplate) {
|
|
21
|
-
|
|
21
|
+
// Check if the file exists
|
|
22
|
+
if (!fs.existsSync(filePath)) {
|
|
23
|
+
// asynchronously create a directory
|
|
24
|
+
fs.writeFileSync(filePath, renderedTemplate);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
22
27
|
|
|
23
28
|
const oldData = fs.readFileSync(filePath);
|
|
24
29
|
const newData = new Buffer.from(renderedTemplate);
|
|
25
|
-
|
|
26
|
-
fs.
|
|
27
|
-
fs.writeSync(fileDescriptor, oldData, 0, oldData.length, newData.length);
|
|
28
|
-
|
|
29
|
-
fs.closeSync(fileDescriptor);
|
|
30
|
+
fs.unlinkSync(filePath);
|
|
31
|
+
fs.appendFileSync(filePath, newData + oldData);
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
export const generateTemplateData = function (
|