@docupace/pipeline 1.0.39-newrelease.16 → 1.0.39-newrelease.17
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 +22 -0
package/package.json
CHANGED
package/src/changeset/cli.js
CHANGED
|
@@ -5,6 +5,9 @@ dotenv.config({ path: ['.env.pipeline.local', 'config/.env.pipeline.local'] });
|
|
|
5
5
|
import { Command } from 'commander';
|
|
6
6
|
import { $ } from 'zx';
|
|
7
7
|
import { validateChangesets } from './validate.js';
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
import { dirname, join } from 'path';
|
|
10
|
+
import { readFileSync } from 'fs';
|
|
8
11
|
|
|
9
12
|
import { isMonoRepo, setGitInfo } from '../next/util.js';
|
|
10
13
|
import {
|
|
@@ -18,6 +21,18 @@ const program = new Command();
|
|
|
18
21
|
|
|
19
22
|
const args = process.argv;
|
|
20
23
|
|
|
24
|
+
// Add version logging function
|
|
25
|
+
async function logPackageVersion() {
|
|
26
|
+
try {
|
|
27
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
28
|
+
const packageJsonPath = join(__dirname, '../../package.json');
|
|
29
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
|
30
|
+
console.log(`📦 CLI Package version: ${packageJson.version}`);
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.log('📦 CLI Package version: Not available');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
21
36
|
async function commitTagCommand(releases) {
|
|
22
37
|
console.log('📌 Checking for updates to commit...');
|
|
23
38
|
|
|
@@ -108,6 +123,7 @@ program
|
|
|
108
123
|
.command('validate')
|
|
109
124
|
.description('Validate changesets for the provided PR')
|
|
110
125
|
.action(async () => {
|
|
126
|
+
await logPackageVersion();
|
|
111
127
|
if (!process.env.BITBUCKET_PR_ID) {
|
|
112
128
|
return;
|
|
113
129
|
}
|
|
@@ -127,6 +143,7 @@ program
|
|
|
127
143
|
.command('version')
|
|
128
144
|
.description('Run Changeset versioning')
|
|
129
145
|
.action(async () => {
|
|
146
|
+
await logPackageVersion();
|
|
130
147
|
await versionCommand();
|
|
131
148
|
});
|
|
132
149
|
|
|
@@ -135,6 +152,7 @@ program
|
|
|
135
152
|
.command('commit-tag')
|
|
136
153
|
.description('Commit and tag the new version')
|
|
137
154
|
.action(async () => {
|
|
155
|
+
await logPackageVersion();
|
|
138
156
|
await commitTagCommand();
|
|
139
157
|
});
|
|
140
158
|
|
|
@@ -143,6 +161,7 @@ program
|
|
|
143
161
|
.command('version-commit-tag')
|
|
144
162
|
.description('Run versioning and commit-and-tag in sequence')
|
|
145
163
|
.action(async () => {
|
|
164
|
+
await logPackageVersion();
|
|
146
165
|
console.log('📦 Running all steps...');
|
|
147
166
|
const releases = await versionCommand();
|
|
148
167
|
await updateJiraWithVersion(releases);
|
|
@@ -155,6 +174,7 @@ program
|
|
|
155
174
|
.command('close-version')
|
|
156
175
|
.description('Closes a version')
|
|
157
176
|
.action(async () => {
|
|
177
|
+
await logPackageVersion();
|
|
158
178
|
console.log('📦 Running all steps...');
|
|
159
179
|
const releases = await versionCommand(true);
|
|
160
180
|
await commitTagCommand(releases);
|
|
@@ -196,8 +216,10 @@ program
|
|
|
196
216
|
'Creates a changeset based on the current branch and Jira ticket information',
|
|
197
217
|
)
|
|
198
218
|
.action(async (jiraIssueKey) => {
|
|
219
|
+
await logPackageVersion();
|
|
199
220
|
await createChangeset(jiraIssueKey);
|
|
200
221
|
});
|
|
201
222
|
|
|
202
223
|
// Parse arguments
|
|
203
224
|
program.parse(args);
|
|
225
|
+
|