feat(build): implement artifact processor

This commit is contained in:
2026-07-29 21:47:05 +02:00
parent 02a1c2cd02
commit a99603f6c7
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);
};