feat(build): implement artifact processor

This commit is contained in:
2026-08-01 13:48:24 +02:00
committed by jakob.scheid
parent 07c6e60527
commit 053372cbb6
3 changed files with 89 additions and 3 deletions
+5 -2
View File
@@ -14,12 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { processArtifact } from './artifact.js';
const runPlugin = async function runPlugin (plugin) {
const result = plugin();
if (result instanceof Promise) return await result;
else return result;
};
export const processPlugin = async function processPlugin (plugin) {
await runPlugin(plugin);
export const processPlugin = async function processPlugin (plugin, options) {
const { artifacts } = await runPlugin(plugin);
for (const artifact of artifacts) await processArtifact(artifact, options);
};