@vamship/build-utils 2.3.2 → 2.4.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": "@vamship/build-utils",
3
- "version": "2.3.2",
3
+ "version": "2.4.0",
4
4
  "description": "Utility library for build tooling",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -31,7 +31,7 @@ export class PublishContainerTaskBuilder extends TaskBuilder {
31
31
  super(
32
32
  // When specifying the container target, if it is not called default, this
33
33
  // will create a named task
34
- `publish-container${target === 'default' ? '' : '-' + target}`,
34
+ `publish-container${target === 'default' ? '' : '-' + target}-${tag}`,
35
35
  `Publish container image for ${target}:${tag}`,
36
36
  );
37
37
 
@@ -71,6 +71,7 @@ export class PublishContainerTaskBuilder extends TaskBuilder {
71
71
  * crashing with an unhandled error.
72
72
  */
73
73
  });
74
+ tagTask.displayName = `tag-${definition.name}-${tag}`;
74
75
  return tagTask;
75
76
  });
76
77
  const pushTaskList = semverComponents.map((tag) => {
@@ -84,6 +85,7 @@ export class PublishContainerTaskBuilder extends TaskBuilder {
84
85
  * crashing with an unhandled error.
85
86
  */
86
87
  });
88
+ pushTask.displayName = `push-${definition.name}-${tag}`;
87
89
  return pushTask;
88
90
  });
89
91
 
@@ -80,19 +80,25 @@ export class PublishTaskBuilder extends TaskBuilder {
80
80
  }
81
81
  // Type container
82
82
  else if (type === 'container') {
83
- return [new PublishContainerTaskBuilder('default')];
83
+ return [
84
+ new PublishContainerTaskBuilder('default', project.version),
85
+ ];
84
86
  }
85
87
  // Type cli
86
88
  else if (type === 'cli') {
87
89
  if (containerTargetList.length > 0) {
88
- return [new PublishContainerTaskBuilder('default')];
90
+ return [
91
+ new PublishContainerTaskBuilder('default', project.version),
92
+ ];
89
93
  } else {
90
94
  return [new PublishNpmTaskBuilder()];
91
95
  }
92
96
  }
93
97
  // Type api
94
98
  else if (type === 'api') {
95
- return [new PublishContainerTaskBuilder('default')];
99
+ return [
100
+ new PublishContainerTaskBuilder('default', project.version),
101
+ ];
96
102
  }
97
103
  // Type ui (and potentially others that are not supported)
98
104
  else {
@@ -42,13 +42,9 @@ export class ApiTaskFactory extends TaskFactory {
42
42
  const additionalTaskList = (target) => {
43
43
  return [
44
44
  new PackageContainerTaskBuilder(target),
45
- new PublishContainerTaskBuilder(target),
45
+ new PublishContainerTaskBuilder(target, this._project.version),
46
46
  ];
47
47
  };
48
- const additionalTasks = generateAdditionalContainerTasks(
49
- this._project,
50
- additionalTaskList,
51
- );
52
48
 
53
49
  return [
54
50
  new CleanTaskBuilder(),
@@ -62,6 +58,11 @@ export class ApiTaskFactory extends TaskFactory {
62
58
  new BuildTaskBuilder(this._project),
63
59
  new PackageTaskBuilder(this._project),
64
60
  new PublishTaskBuilder(this._project),
65
- ].concat(additionalTasks);
61
+ new PublishContainerTaskBuilder('default'),
62
+ ].concat(
63
+ generateAdditionalContainerTasks(this._project, additionalTaskList),
64
+ ); // Note: Instantiating the additional container tasks in a different
65
+ // order will break tests. This is less than ideal, but it will have
66
+ // to do for now.
66
67
  }
67
68
  }
@@ -44,13 +44,11 @@ export class CliTaskFactory extends TaskFactory {
44
44
  const additionalTaskList = (target) => {
45
45
  return [
46
46
  new PackageContainerTaskBuilder(target),
47
- new PublishContainerTaskBuilder(target),
47
+ new PublishContainerTaskBuilder(target, this._project.version),
48
48
  ];
49
49
  };
50
- const additionalTasks = generateAdditionalContainerTasks(
51
- this._project,
52
- additionalTaskList,
53
- );
50
+
51
+ const hasContainer = this._project.getContainerTargets().length > 0;
54
52
 
55
53
  return [
56
54
  new CleanTaskBuilder(),
@@ -63,6 +61,19 @@ export class CliTaskFactory extends TaskFactory {
63
61
  new BuildTaskBuilder(this._project),
64
62
  new PackageTaskBuilder(this._project),
65
63
  new PublishTaskBuilder(this._project),
66
- ].concat(additionalTasks);
64
+ hasContainer
65
+ ? new PublishContainerTaskBuilder('default')
66
+ : undefined,
67
+ // Note: Instantiating the additional container tasks in a different
68
+ // order will break tests. This is less than ideal, but it will have
69
+ // to do for now.
70
+ ]
71
+ .concat(
72
+ generateAdditionalContainerTasks(
73
+ this._project,
74
+ additionalTaskList,
75
+ ),
76
+ )
77
+ .filter(Boolean);
67
78
  }
68
79
  }
@@ -42,13 +42,9 @@ export class ContainerTaskFactory extends TaskFactory {
42
42
  const additionalTaskList = (target) => {
43
43
  return [
44
44
  new PackageContainerTaskBuilder(target),
45
- new PublishContainerTaskBuilder(target),
45
+ new PublishContainerTaskBuilder(target, this._project.version),
46
46
  ];
47
47
  };
48
- const additionalTasks = generateAdditionalContainerTasks(
49
- this._project,
50
- additionalTaskList,
51
- );
52
48
 
53
49
  return [
54
50
  new CleanTaskBuilder(),
@@ -59,6 +55,11 @@ export class ContainerTaskFactory extends TaskFactory {
59
55
  new DocsTaskBuilder(this._project),
60
56
  new PackageTaskBuilder(this._project),
61
57
  new PublishTaskBuilder(this._project),
62
- ].concat(additionalTasks);
58
+ new PublishContainerTaskBuilder('default'),
59
+ ].concat(
60
+ generateAdditionalContainerTasks(this._project, additionalTaskList),
61
+ ); // Note: Instantiating the additional container tasks in a different
62
+ // order will break tests. This is less than ideal, but it will have
63
+ // to do for now.
63
64
  }
64
65
  }