feat(build): implement artifact processor

This commit is contained in:
2026-07-29 22:25:12 +02:00
parent da6dfe8091
commit 5c1c5fcf55
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);
};