@aspruyt/xfg 3.9.2 → 3.9.3

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.
@@ -7,6 +7,7 @@ import { formatValuePlain, formatRulesetConfigPlain, } from "./settings-report.j
7
7
  // =============================================================================
8
8
  function formatCombinedSummary(input) {
9
9
  const parts = [];
10
+ const dry = input.dryRun;
10
11
  // Lifecycle totals
11
12
  if (input.lifecycle) {
12
13
  const t = input.lifecycle.totals;
@@ -14,11 +15,11 @@ function formatCombinedSummary(input) {
14
15
  if (repoTotal > 0) {
15
16
  const repoParts = [];
16
17
  if (t.created > 0)
17
- repoParts.push(`${t.created} to create`);
18
+ repoParts.push(`${t.created} ${dry ? "to create" : "created"}`);
18
19
  if (t.forked > 0)
19
- repoParts.push(`${t.forked} to fork`);
20
+ repoParts.push(`${t.forked} ${dry ? "to fork" : "forked"}`);
20
21
  if (t.migrated > 0)
21
- repoParts.push(`${t.migrated} to migrate`);
22
+ repoParts.push(`${t.migrated} ${dry ? "to migrate" : "migrated"}`);
22
23
  const repoWord = repoTotal === 1 ? "repo" : "repos";
23
24
  parts.push(`${repoTotal} ${repoWord} (${repoParts.join(", ")})`);
24
25
  }
@@ -30,11 +31,11 @@ function formatCombinedSummary(input) {
30
31
  if (fileTotal > 0) {
31
32
  const fileParts = [];
32
33
  if (t.files.create > 0)
33
- fileParts.push(`${t.files.create} to create`);
34
+ fileParts.push(`${t.files.create} ${dry ? "to create" : "created"}`);
34
35
  if (t.files.update > 0)
35
- fileParts.push(`${t.files.update} to update`);
36
+ fileParts.push(`${t.files.update} ${dry ? "to update" : "updated"}`);
36
37
  if (t.files.delete > 0)
37
- fileParts.push(`${t.files.delete} to delete`);
38
+ fileParts.push(`${t.files.delete} ${dry ? "to delete" : "deleted"}`);
38
39
  const fileWord = fileTotal === 1 ? "file" : "files";
39
40
  parts.push(`${fileTotal} ${fileWord} (${fileParts.join(", ")})`);
40
41
  }
@@ -47,9 +48,9 @@ function formatCombinedSummary(input) {
47
48
  const settingWord = settingsTotal === 1 ? "setting" : "settings";
48
49
  const actions = [];
49
50
  if (t.settings.add > 0)
50
- actions.push(`${t.settings.add} to add`);
51
+ actions.push(`${t.settings.add} ${dry ? "to add" : "added"}`);
51
52
  if (t.settings.change > 0)
52
- actions.push(`${t.settings.change} to change`);
53
+ actions.push(`${t.settings.change} ${dry ? "to change" : "changed"}`);
53
54
  parts.push(`${settingsTotal} ${settingWord} (${actions.join(", ")})`);
54
55
  }
55
56
  const rulesetsTotal = t.rulesets.create + t.rulesets.update + t.rulesets.delete;
@@ -57,18 +58,19 @@ function formatCombinedSummary(input) {
57
58
  const rulesetWord = rulesetsTotal === 1 ? "ruleset" : "rulesets";
58
59
  const actions = [];
59
60
  if (t.rulesets.create > 0)
60
- actions.push(`${t.rulesets.create} to create`);
61
+ actions.push(`${t.rulesets.create} ${dry ? "to create" : "created"}`);
61
62
  if (t.rulesets.update > 0)
62
- actions.push(`${t.rulesets.update} to update`);
63
+ actions.push(`${t.rulesets.update} ${dry ? "to update" : "updated"}`);
63
64
  if (t.rulesets.delete > 0)
64
- actions.push(`${t.rulesets.delete} to delete`);
65
+ actions.push(`${t.rulesets.delete} ${dry ? "to delete" : "deleted"}`);
65
66
  parts.push(`${rulesetsTotal} ${rulesetWord} (${actions.join(", ")})`);
66
67
  }
67
68
  }
68
69
  if (parts.length === 0) {
69
70
  return "No changes";
70
71
  }
71
- return `Plan: ${parts.join(", ")}`;
72
+ const prefix = dry ? "Plan" : "Applied";
73
+ return `${prefix}: ${parts.join(", ")}`;
72
74
  }
73
75
  function hasAnyChanges(input) {
74
76
  if (input.lifecycle && hasLifecycleChanges(input.lifecycle))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aspruyt/xfg",
3
- "version": "3.9.2",
3
+ "version": "3.9.3",
4
4
  "description": "CLI tool for repository-as-code: sync files and manage settings across GitHub, Azure DevOps, and GitLab",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",