@docupace/pipeline 1.0.59 → 1.0.60-alpha.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 +2 -10
- package/src/changeset/validate.js +21 -15
package/package.json
CHANGED
package/src/changeset/cli.js
CHANGED
|
@@ -110,16 +110,8 @@ program
|
|
|
110
110
|
if (!process.env.BITBUCKET_PR_ID) {
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
await validateChangesets();
|
|
116
|
-
console.log('✅ Changeset validation passed.');
|
|
117
|
-
} catch {
|
|
118
|
-
console.error(
|
|
119
|
-
'❌ No changeset found. Please add a changeset to this PR. Please see more information at https://docupacellc.atlassian.net/wiki/spaces/PM/pages/1350893571/Creating+changesets+for+Docupace+Next',
|
|
120
|
-
);
|
|
121
|
-
process.exit(1);
|
|
122
|
-
}
|
|
113
|
+
await validateChangesets();
|
|
114
|
+
process.exit(1);
|
|
123
115
|
});
|
|
124
116
|
// Command: version
|
|
125
117
|
program
|
|
@@ -17,25 +17,31 @@ function areArraysEqualIgnoringOrder(arr1, arr2) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export async function validateChangesets() {
|
|
20
|
-
if (isMonoRepo()) {
|
|
21
20
|
await setGitInfo();
|
|
22
21
|
const destBranch = process.env.BITBUCKET_PR_DESTINATION_BRANCH;
|
|
23
22
|
await $`git fetch origin ${destBranch}:${destBranch}`;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(
|
|
29
|
-
|
|
23
|
+
let releases;
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
console.log('🔍 Validating changesets...');
|
|
27
|
+
releases = await versionStatus(destBranch);
|
|
28
|
+
}
|
|
29
|
+
catch(e) {
|
|
30
|
+
console.error(
|
|
31
|
+
'❌ No changeset found. Please add a changeset to this PR. Please see more information at https://docupacellc.atlassian.net/wiki/spaces/PM/pages/1350893571/Creating+changesets+for+Docupace+Next',
|
|
32
|
+
);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if(!['master', 'main'].includes(destBranch)) {
|
|
37
|
+
if(releases.some(item => item.type !== 'patch')) {
|
|
38
|
+
console.error('❌ A changeset must be a patch for change to a release branch');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
console.log('✅ Changeset validation passed.');
|
|
30
44
|
|
|
31
|
-
if (!areArraysEqualIgnoringOrder(releaseNames, changedPackageNames)) {
|
|
32
|
-
throw new Error(
|
|
33
|
-
'Changesets must be created for all packages created and for those that have those changed as dependencies',
|
|
34
|
-
);
|
|
35
|
-
}*/
|
|
36
|
-
} else {
|
|
37
|
-
await validateChangesetPath(path.resolve(process.cwd(), CHANGESET_DIR));
|
|
38
|
-
}
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
export async function validateChangesetPath(directoryPath) {
|