hammerkit 1.14.0 → 1.14.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.
|
@@ -94,7 +94,18 @@ async function parseReferences(ctx, mainScope, environment) {
|
|
|
94
94
|
}
|
|
95
95
|
exports.parseReferences = parseReferences;
|
|
96
96
|
function applySchemaExtension(reference, task) {
|
|
97
|
+
// a base is reached once per task extending it; applying it again would add
|
|
98
|
+
// its own base's lists a second time
|
|
99
|
+
if (task.extension === 'applied') {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (task.extension === 'applying') {
|
|
103
|
+
throw new Error(`task ${task.relativeName} extends itself`);
|
|
104
|
+
}
|
|
105
|
+
task.extension = 'applying';
|
|
106
|
+
task.bases = [];
|
|
97
107
|
if (!task.schema.extend) {
|
|
108
|
+
task.extension = 'applied';
|
|
98
109
|
return;
|
|
99
110
|
}
|
|
100
111
|
const extend = findTask(reference, task.scope, task.schema.extend, null).task;
|
|
@@ -112,8 +123,14 @@ function applySchemaExtension(reference, task) {
|
|
|
112
123
|
taskSchema.image = taskSchema.image ?? extend.schema.image;
|
|
113
124
|
taskSchema.mounts = extendArray(taskSchema.mounts, extend.schema.mounts);
|
|
114
125
|
}
|
|
115
|
-
|
|
116
|
-
|
|
126
|
+
// deps and needs resolve in the file that declares them, so every base up the
|
|
127
|
+
// chain contributes its own, not only the nearest
|
|
128
|
+
task.bases = [...(extend.bases ?? []), { scope: extend.scope, schema: extend.schema }];
|
|
129
|
+
for (const base of task.bases) {
|
|
130
|
+
resolveNeeds(reference, task, base.scope, base.schema);
|
|
131
|
+
resolveDeps(reference, task, base.scope, base.schema);
|
|
132
|
+
}
|
|
133
|
+
task.extension = 'applied';
|
|
117
134
|
}
|
|
118
135
|
function extendArray(base, extend) {
|
|
119
136
|
if (!extend) {
|
package/package.json
CHANGED