@storm-software/git-tools 2.132.4 → 2.132.6

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/bin/git.js CHANGED
@@ -41,6 +41,7 @@ import { parse } from 'yaml';
41
41
  import { printAndFlushChanges } from 'nx/src/command-line/release/utils/print-changes';
42
42
  import { createGitTagValues, handleDuplicateGitTags, createCommitMessageValues, isPrerelease, shouldPreferDockerVersionForReleaseGroup, ReleaseVersion, noDiffInChangelogMessage, shouldSkipVersionActions } from 'nx/src/command-line/release/utils/shared';
43
43
  import { interpolate } from 'nx/src/tasks-runner/utils';
44
+ import { z } from 'zod';
44
45
  import { execCommand } from 'nx/src/command-line/release/utils/exec-command';
45
46
  import { getCommitHash, getFirstGitCommit, gitPush, gitAdd, parseCommits, getGitDiff, sanitizeProjectNameForGitTag, extractTagAndVersion } from 'nx/src/command-line/release/utils/git';
46
47
  import semver, { prerelease, coerce, gte, valid, gt, major } from 'semver';
@@ -88,130 +89,130 @@ function stringifyCargoToml(cargoToml) {
88
89
  // ../conventional-changelog/src/commit-types.ts
89
90
  var DEFAULT_COMMIT_TYPES = {
90
91
  /* --- Bumps version when selected --- */
91
- "chore": {
92
- "description": "Other changes that don't modify src or test files",
93
- "title": "Chore",
94
- "emoji": "\u2699\uFE0F ",
95
- "semverBump": "patch",
96
- "changelog": {
97
- "title": "Miscellaneous",
98
- "hidden": false
92
+ chore: {
93
+ description: "Other changes that don't modify src or test files",
94
+ title: "Chore",
95
+ emoji: "\u2699\uFE0F ",
96
+ semverBump: "patch",
97
+ changelog: {
98
+ title: "Miscellaneous",
99
+ hidden: false
99
100
  }
100
101
  },
101
- "fix": {
102
- "description": "A change that resolves an issue previously identified with the package",
103
- "title": "Bug Fix",
104
- "emoji": "\u{1FAB2} ",
105
- "semverBump": "patch",
106
- "changelog": {
107
- "title": "Bug Fixes",
108
- "hidden": false
102
+ fix: {
103
+ description: "A change that resolves an issue previously identified with the package",
104
+ title: "Bug Fix",
105
+ emoji: "\u{1FAB2} ",
106
+ semverBump: "patch",
107
+ changelog: {
108
+ title: "Bug Fixes",
109
+ hidden: false
109
110
  }
110
111
  },
111
- "feat": {
112
- "description": "A change that adds a new feature to the package",
113
- "title": "Feature",
114
- "emoji": "\u{1F511} ",
115
- "semverBump": "minor",
116
- "changelog": {
117
- "title": "Features",
118
- "hidden": false
112
+ feat: {
113
+ description: "A change that adds a new feature to the package",
114
+ title: "Feature",
115
+ emoji: "\u{1F511} ",
116
+ semverBump: "minor",
117
+ changelog: {
118
+ title: "Features",
119
+ hidden: false
119
120
  }
120
121
  },
121
- "ci": {
122
- "description": "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)",
123
- "title": "Continuous Integration",
124
- "emoji": "\u{1F9F0} ",
125
- "semverBump": "patch",
126
- "changelog": {
127
- "title": "Continuous Integration",
128
- "hidden": false
122
+ ci: {
123
+ description: "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)",
124
+ title: "Continuous Integration",
125
+ emoji: "\u{1F9F0} ",
126
+ semverBump: "patch",
127
+ changelog: {
128
+ title: "Continuous Integration",
129
+ hidden: false
129
130
  }
130
131
  },
131
- "refactor": {
132
- "description": "A code change that neither fixes a bug nor adds a feature",
133
- "title": "Code Refactoring",
134
- "emoji": "\u{1F9EA} ",
135
- "semverBump": "patch",
136
- "changelog": {
137
- "title": "Source Code Improvements",
138
- "hidden": false
132
+ refactor: {
133
+ description: "A code change that neither fixes a bug nor adds a feature",
134
+ title: "Code Refactoring",
135
+ emoji: "\u{1F9EA} ",
136
+ semverBump: "patch",
137
+ changelog: {
138
+ title: "Source Code Improvements",
139
+ hidden: false
139
140
  }
140
141
  },
141
- "style": {
142
- "description": "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",
143
- "title": "Style Improvements",
144
- "emoji": "\u{1F48E} ",
145
- "semverBump": "patch",
146
- "changelog": {
147
- "title": "Style Improvements",
148
- "hidden": false
142
+ style: {
143
+ description: "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",
144
+ title: "Style Improvements",
145
+ emoji: "\u{1F48E} ",
146
+ semverBump: "patch",
147
+ changelog: {
148
+ title: "Style Improvements",
149
+ hidden: false
149
150
  }
150
151
  },
151
- "perf": {
152
- "description": "A code change that improves performance",
153
- "title": "Performance Improvement",
154
- "emoji": "\u23F1\uFE0F ",
155
- "semverBump": "patch",
156
- "changelog": {
157
- "title": "Performance Improvements",
158
- "hidden": false
152
+ perf: {
153
+ description: "A code change that improves performance",
154
+ title: "Performance Improvement",
155
+ emoji: "\u23F1\uFE0F ",
156
+ semverBump: "patch",
157
+ changelog: {
158
+ title: "Performance Improvements",
159
+ hidden: false
159
160
  }
160
161
  },
161
162
  /* --- Does not bump version when selected --- */
162
- "docs": {
163
- "description": "A change that only includes documentation updates",
164
- "title": "Documentation",
165
- "emoji": "\u{1F4DC} ",
166
- "semverBump": "none",
167
- "changelog": {
168
- "title": "Documentation",
169
- "hidden": false
163
+ docs: {
164
+ description: "A change that only includes documentation updates",
165
+ title: "Documentation",
166
+ emoji: "\u{1F4DC} ",
167
+ semverBump: "none",
168
+ changelog: {
169
+ title: "Documentation",
170
+ hidden: false
170
171
  }
171
172
  },
172
- "test": {
173
- "description": "Adding missing tests or correcting existing tests",
174
- "title": "Testing",
175
- "emoji": "\u{1F6A8} ",
176
- "semverBump": "none",
177
- "changelog": {
178
- "title": "Testing",
179
- "hidden": true
173
+ test: {
174
+ description: "Adding missing tests or correcting existing tests",
175
+ title: "Testing",
176
+ emoji: "\u{1F6A8} ",
177
+ semverBump: "none",
178
+ changelog: {
179
+ title: "Testing",
180
+ hidden: true
180
181
  }
181
182
  },
182
183
  /* --- Not included in commitlint but included in changelog --- */
183
- "deps": {
184
- "description": "Changes that add, update, or remove dependencies. This includes devDependencies and peerDependencies",
185
- "title": "Dependencies",
186
- "emoji": "\u{1F4E6} ",
187
- "hidden": true,
188
- "semverBump": "patch",
189
- "changelog": {
190
- "title": "Dependency Upgrades",
191
- "hidden": false
184
+ deps: {
185
+ description: "Changes that add, update, or remove dependencies. This includes devDependencies and peerDependencies",
186
+ title: "Dependencies",
187
+ emoji: "\u{1F4E6} ",
188
+ hidden: true,
189
+ semverBump: "patch",
190
+ changelog: {
191
+ title: "Dependency Upgrades",
192
+ hidden: false
192
193
  }
193
194
  },
194
195
  /* --- Not included in commitlint or changelog --- */
195
- "build": {
196
- "description": "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)",
197
- "title": "Build",
198
- "emoji": "\u{1F6E0} ",
199
- "hidden": true,
200
- "semverBump": "none",
201
- "changelog": {
202
- "title": "Build",
203
- "hidden": true
196
+ build: {
197
+ description: "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)",
198
+ title: "Build",
199
+ emoji: "\u{1F6E0} ",
200
+ hidden: true,
201
+ semverBump: "none",
202
+ changelog: {
203
+ title: "Build",
204
+ hidden: true
204
205
  }
205
206
  },
206
- "release": {
207
- "description": "Publishing a commit containing a newly released version",
208
- "title": "Publish Release",
209
- "emoji": "\u{1F680} ",
210
- "hidden": true,
211
- "semverBump": "none",
212
- "changelog": {
213
- "title": "Publish Release",
214
- "hidden": true
207
+ release: {
208
+ description: "Publishing a commit containing a newly released version",
209
+ title: "Publish Release",
210
+ emoji: "\u{1F680} ",
211
+ hidden: true,
212
+ semverBump: "none",
213
+ changelog: {
214
+ title: "Publish Release",
215
+ hidden: true
215
216
  }
216
217
  }
217
218
  };
@@ -2417,6 +2418,51 @@ function titleCase(input2) {
2417
2418
  }
2418
2419
 
2419
2420
  // src/utilities/changelog-utils.ts
2421
+ var ChangelogItemType = z.enum([
2422
+ "chore",
2423
+ "fix",
2424
+ "feat",
2425
+ "refactor",
2426
+ "style",
2427
+ "perf",
2428
+ "deps"
2429
+ ]);
2430
+ var ChangelogBaseItemSchema = z.object({
2431
+ type: ChangelogItemType,
2432
+ scope: z.string(),
2433
+ description: z.string()
2434
+ });
2435
+ var ChangelogMinimalItemSchema = ChangelogBaseItemSchema.extend({
2436
+ type: z.enum(["chore", "refactor", "style", "perf"])
2437
+ });
2438
+ var ChangelogFixItemSchema = ChangelogBaseItemSchema.extend({
2439
+ type: z.enum(["fix"]),
2440
+ issue: z.string()
2441
+ });
2442
+ var ChangelogDepsUpdateItemSchema = ChangelogBaseItemSchema.extend({
2443
+ package: z.string(),
2444
+ version: z.string()
2445
+ });
2446
+ var ChangelogDepsItemSchema = ChangelogBaseItemSchema.extend({
2447
+ type: z.enum(["deps"]),
2448
+ updates: z.array(ChangelogDepsUpdateItemSchema)
2449
+ });
2450
+ var ChangelogFeatItemSchema = ChangelogBaseItemSchema.extend({
2451
+ type: z.enum(["feat"]),
2452
+ feature: z.string()
2453
+ });
2454
+ var ChangelogItemSchema = z.union([
2455
+ ChangelogMinimalItemSchema,
2456
+ ChangelogFixItemSchema,
2457
+ ChangelogDepsItemSchema,
2458
+ ChangelogFeatItemSchema
2459
+ ]);
2460
+ z.object({
2461
+ version: z.string(),
2462
+ project: z.string(),
2463
+ date: z.date(),
2464
+ changes: z.array(ChangelogItemSchema).default([])
2465
+ });
2420
2466
  async function generateChangelogContent(releaseVersion, filepath, newContent, currentContent, project, workspaceConfig) {
2421
2467
  const formatOptions = await resolveConfig(filepath) ?? {};
2422
2468
  const bannerUrl = typeof workspaceConfig?.release.banner === "string" ? workspaceConfig?.release.banner : workspaceConfig?.release.banner?.url;
@@ -2554,6 +2600,7 @@ async function generateChangelogForProjects({
2554
2600
  }
2555
2601
  const preferDockerVersion = shouldPreferDockerVersionForReleaseGroup(releaseGroup);
2556
2602
  const releaseVersion = new ReleaseVersion({
2603
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2557
2604
  version: (preferDockerVersion === true || preferDockerVersion === "both") && projectsVersionData[project.name]?.dockerVersion ? projectsVersionData[project.name]?.dockerVersion : projectsVersionData[project.name]?.newVersion,
2558
2605
  releaseTagPattern: releaseGroup.releaseTag.pattern,
2559
2606
  projectName: project.name