@scaleway/changesets-renovate 2.1.2 → 2.2.1

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/README.md CHANGED
@@ -34,4 +34,36 @@ To skip checking the branch name starts `renovate/`
34
34
  SKIP_BRANCH_CHECK=TRUE changesets-renovate
35
35
  ```
36
36
 
37
+ To sort both the package bumps and update messages alphabetically
38
+
39
+ ```bash
40
+ SORT_CHANGESETS=TRUE changesets-renovate
41
+ ```
42
+
43
+ Example:
44
+
45
+ Unsorted:
46
+ ```
47
+ ---
48
+ 'package-z': patch
49
+ 'package-a': patch
50
+ ---
51
+
52
+ Updated dependency `@company/zzz` to `0.228.0`.
53
+ Updated dependency `@company/aaa` to `1.1.15`.
54
+ Updated dependency `@company/zzz-backend` to `^0.228.0`.
55
+ ```
56
+
57
+ Sorted:
58
+ ```
59
+ ---
60
+ 'package-a': patch
61
+ 'package-z': patch
62
+ ---
63
+
64
+ Updated dependency `@company/aaa` to `1.1.15`.
65
+ Updated dependency `@company/zzz-backend` to `^0.228.0`.
66
+ Updated dependency `@company/zzz` to `0.228.0`.
67
+ ```
68
+
37
69
  It's inspired by this GitHub Action from Backstage: https://github.com/backstage/backstage/blob/master/.github/workflows/sync_renovate-changesets.yml
package/dist/index.js CHANGED
@@ -32,11 +32,15 @@ async function getPackagesNames(files) {
32
32
  return packages;
33
33
  }
34
34
  async function createChangeset(fileName, packageBumps, packages) {
35
- let message = "";
35
+ const messageLines = [];
36
36
  for (const [pkg, bump] of packageBumps) {
37
- message += `Updated dependency \`${pkg}\` to \`${bump}\`.
38
- `;
37
+ messageLines.push(`Updated dependency \`${pkg}\` to \`${bump}\`.`);
38
+ }
39
+ if (process.env["SORT_CHANGESETS"]) {
40
+ packages.sort();
41
+ messageLines.sort();
39
42
  }
43
+ const message = messageLines.join("\n");
40
44
  const pkgs = packages.map((pkg) => `'${pkg}': patch`).join("\n");
41
45
  const body = `---
42
46
  ${pkgs}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/changesets-renovate",
3
- "version": "2.1.2",
3
+ "version": "2.2.1",
4
4
  "description": "Automatically create changesets for Renovate",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -36,7 +36,7 @@
36
36
  "sync"
37
37
  ],
38
38
  "dependencies": {
39
- "simple-git": "3.27.0"
39
+ "simple-git": "3.28.0"
40
40
  },
41
41
  "scripts": {
42
42
  "prebuild": "shx rm -rf dist",