@docupace/pipeline 1.0.51 → 1.0.52
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/package.json +1 -1
- package/src/changeset/cli.js +17 -5
- package/src/changeset/version.js +7 -0
package/package.json
CHANGED
package/src/changeset/cli.js
CHANGED
|
@@ -4,7 +4,11 @@ import { $ } from 'zx';
|
|
|
4
4
|
import { validateChangesets } from './validate.js';
|
|
5
5
|
import dotenv from 'dotenv';
|
|
6
6
|
import { isMonoRepo, setGitInfo } from '../next/util.js';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
toShortVersion,
|
|
9
|
+
updateJiraWithVersion,
|
|
10
|
+
versionCommand,
|
|
11
|
+
} from './version.js';
|
|
8
12
|
import { createChangeset } from './create.js';
|
|
9
13
|
|
|
10
14
|
dotenv.config({ path: ['.env.pipeline.local', 'config/.env.pipeline.local'] });
|
|
@@ -157,12 +161,20 @@ program
|
|
|
157
161
|
if (isMonoRepo()) {
|
|
158
162
|
for (const release of getAppReleases(releases)) {
|
|
159
163
|
const appName = getAppNameFromPackageName(release.name);
|
|
160
|
-
|
|
161
|
-
|
|
164
|
+
const newVersion = toShortVersion(release.newVersion);
|
|
165
|
+
if (!newVersion) {
|
|
166
|
+
throw new Error('Error calculating branch name');
|
|
167
|
+
}
|
|
168
|
+
await $`git checkout -b release/${appName}/${newVersion}`;
|
|
169
|
+
await $`git push origin release/${appName}/${newVersion}`;
|
|
162
170
|
}
|
|
163
171
|
} else {
|
|
164
|
-
|
|
165
|
-
|
|
172
|
+
const newVersion = toShortVersion(releases[0].newVersion);
|
|
173
|
+
if (!newVersion) {
|
|
174
|
+
throw new Error('Error calculating branch name');
|
|
175
|
+
}
|
|
176
|
+
await $`git checkout -b release/${newVersion}`;
|
|
177
|
+
await $`git push origin release/${newVersion}`;
|
|
166
178
|
}
|
|
167
179
|
|
|
168
180
|
// Return to original branch
|
package/src/changeset/version.js
CHANGED
|
@@ -4,6 +4,7 @@ import fs from 'fs';
|
|
|
4
4
|
import { updateComponentVersion } from '../next/jira.js';
|
|
5
5
|
import { findJiraTicketId } from './util.js';
|
|
6
6
|
import { revertBaseBranch, updateBaseBranch } from './changeset-config.js';
|
|
7
|
+
import semver from 'semver';
|
|
7
8
|
|
|
8
9
|
const changeSetPackage = `{
|
|
9
10
|
"name": "changeset-package",
|
|
@@ -22,6 +23,12 @@ const changeSetPackage = `{
|
|
|
22
23
|
}
|
|
23
24
|
`;
|
|
24
25
|
|
|
26
|
+
export function toShortVersion(version) {
|
|
27
|
+
const parsed = semver.parse(version);
|
|
28
|
+
if (!parsed) return null;
|
|
29
|
+
return `${parsed.major}.${parsed.minor}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
export async function versionStatus(sinceBranch) {
|
|
26
33
|
const outputPath = './changeset-output.json';
|
|
27
34
|
|