@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docupace/pipeline",
3
- "version": "1.0.59",
3
+ "version": "1.0.60-alpha.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -110,16 +110,8 @@ program
110
110
  if (!process.env.BITBUCKET_PR_ID) {
111
111
  return;
112
112
  }
113
- console.log('🔍 Validating changesets...');
114
- try {
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
- await versionStatus(destBranch);
25
- /*const changedPackages = await getChangedPackages();
26
- const releaseNames = releases.map((release) => release.name);
27
- const changedPackageNames = changedPackages.map(
28
- (changedPackage) => changedPackage.name,
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) {