@docupace/pipeline 1.0.28 → 1.0.29-matttest.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docupace/pipeline",
3
- "version": "1.0.28",
3
+ "version": "1.0.29-matttest.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -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`);
@@ -123,6 +131,7 @@ async function versionCommand() {
123
131
  }
124
132
 
125
133
  console.log('✅ Changeset versioning complete.');
134
+ return { version, packageName };
126
135
  }
127
136
 
128
137
  async function commitTagCommand() {
@@ -193,6 +202,32 @@ program
193
202
  await commitTagCommand();
194
203
  });
195
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 add .`;
226
+ await $`git commit -m "Open next alpha version"`;
227
+ await $`git push origin`;
228
+
229
+ });
230
+
196
231
  program
197
232
  .name('create-changeset')
198
233
  .description(