@docupace/pipeline 1.0.28-matttest.2 → 1.0.29-matttest.0
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 +35 -2
- package/src/next/jira.js +0 -1
package/package.json
CHANGED
package/src/changeset/cli.js
CHANGED
|
@@ -85,7 +85,7 @@ const changeSetPackage = `{
|
|
|
85
85
|
}
|
|
86
86
|
`;
|
|
87
87
|
|
|
88
|
-
async function versionCommand() {
|
|
88
|
+
async function versionCommand(closeVersion = false) {
|
|
89
89
|
console.log('📦 Running Changeset versioning...');
|
|
90
90
|
await setGitInfo();
|
|
91
91
|
await $`mv package.json package.json.bak`;
|
|
@@ -95,6 +95,10 @@ async function versionCommand() {
|
|
|
95
95
|
await $`rm package.json pnpm-lock.yaml`;
|
|
96
96
|
await $`mv package.json.bak package.json`;
|
|
97
97
|
await $`mv pnpm-lock.yaml.bak pnpm-lock.yaml`;
|
|
98
|
+
if (closeVersion) {
|
|
99
|
+
await $`pnpm changeset pre exit`;
|
|
100
|
+
}
|
|
101
|
+
|
|
98
102
|
await $`pnpm changeset version`;
|
|
99
103
|
|
|
100
104
|
// Read the updated package.json to get the new version and package name
|
|
@@ -104,6 +108,10 @@ async function versionCommand() {
|
|
|
104
108
|
const version = packageJson.version;
|
|
105
109
|
const packageName = packageJson.name;
|
|
106
110
|
|
|
111
|
+
if (closeVersion) {
|
|
112
|
+
return { version, packageName };
|
|
113
|
+
}
|
|
114
|
+
|
|
107
115
|
// Get the last commit message and extract Jira ticket
|
|
108
116
|
const lastCommit = (await $`git log -1 --pretty=%B`).stdout.trim();
|
|
109
117
|
console.log(`Last commit '${lastCommit}' being processed to get Jira ticket`);
|
|
@@ -119,11 +127,11 @@ async function versionCommand() {
|
|
|
119
127
|
console.error(
|
|
120
128
|
`Failed to update Jira component version: ${error.message}`,
|
|
121
129
|
);
|
|
122
|
-
throw error;
|
|
123
130
|
}
|
|
124
131
|
}
|
|
125
132
|
|
|
126
133
|
console.log('✅ Changeset versioning complete.');
|
|
134
|
+
return { version, packageName };
|
|
127
135
|
}
|
|
128
136
|
|
|
129
137
|
async function commitTagCommand() {
|
|
@@ -194,6 +202,31 @@ program
|
|
|
194
202
|
await commitTagCommand();
|
|
195
203
|
});
|
|
196
204
|
|
|
205
|
+
program
|
|
206
|
+
.command('close-version')
|
|
207
|
+
.description('Closes a version')
|
|
208
|
+
.action(async () => {
|
|
209
|
+
console.log('📦 Running all steps...');
|
|
210
|
+
const { version } = await versionCommand(true);
|
|
211
|
+
await commitTagCommand();
|
|
212
|
+
|
|
213
|
+
// Get current branch
|
|
214
|
+
const { stdout: currentBranch } = await $`git rev-parse --abbrev-ref HEAD`;
|
|
215
|
+
|
|
216
|
+
// Create and push release branch
|
|
217
|
+
await $`git checkout -b release/${version}`;
|
|
218
|
+
await $`git push origin --tags`;
|
|
219
|
+
|
|
220
|
+
// Return to original branch
|
|
221
|
+
await $`git checkout ${currentBranch.trim()}`;
|
|
222
|
+
|
|
223
|
+
// Open next alpha version
|
|
224
|
+
await $`pnpm changeset pre enter alpha`;
|
|
225
|
+
await $`git commit -m "Open next alpha version"`;
|
|
226
|
+
await $`git push origin`;
|
|
227
|
+
|
|
228
|
+
});
|
|
229
|
+
|
|
197
230
|
program
|
|
198
231
|
.name('create-changeset')
|
|
199
232
|
.description(
|
package/src/next/jira.js
CHANGED
|
@@ -63,7 +63,6 @@ export async function updateComponentVersion(issueKey, packageName, version) {
|
|
|
63
63
|
console.log(`Updated component versions for ${issueKey}: ${newValue}`);
|
|
64
64
|
} catch (error) {
|
|
65
65
|
console.error(`Error updating Jira component version: ${error.message}`);
|
|
66
|
-
throw error;
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
|