@huoye/app-ship 0.1.0 → 0.1.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.
package/dist/index.cjs CHANGED
@@ -607,23 +607,38 @@ var UploadManager = class {
607
607
  };
608
608
  }
609
609
  const files = Array.isArray(filePaths) ? filePaths : [filePaths];
610
- logger.info(`Processing ${files.length} file(s) for ${validPlatforms.length} platform(s)`);
611
- const uploadPromises = validPlatforms.map((platform) => {
610
+ const tasks = [];
611
+ validPlatforms.forEach((platform) => {
612
612
  const uploader = this.uploaders.get(platform);
613
- const targetFile = files.find((f) => uploader.canHandle(f));
614
- if (!targetFile) {
613
+ const matchedFiles = files.filter((f) => uploader.canHandle(f));
614
+ if (matchedFiles.length === 0) {
615
615
  logger.warn(`[${platform}] No compatible file found in provided files`);
616
- return Promise.resolve({
617
- platform,
618
- success: false,
619
- message: `No compatible file found for ${platform}`
616
+ } else {
617
+ matchedFiles.forEach((file) => {
618
+ tasks.push({ platform, file });
620
619
  });
621
620
  }
622
- logger.info(`[${platform}] Matched file: ${import_path2.default.basename(targetFile)}`);
623
- return this.uploadToPlatform(platform, targetFile, config, metadata);
621
+ });
622
+ if (tasks.length === 0) {
623
+ logger.error("No valid platform-file matches found");
624
+ return {
625
+ totalUploads: validPlatforms.length,
626
+ successCount: 0,
627
+ failureCount: validPlatforms.length,
628
+ successPlatforms: [],
629
+ failurePlatforms: validPlatforms,
630
+ results: [],
631
+ totalDurationMs: Date.now() - startTime,
632
+ summary: "No compatible files found for any of the selected platforms"
633
+ };
634
+ }
635
+ logger.info(`Scheduled ${tasks.length} upload task(s) for ${validPlatforms.length} platform(s)`);
636
+ const uploadPromises = tasks.map((task) => {
637
+ logger.info(`[${task.platform}] Matched file: ${import_path2.default.basename(task.file)}`);
638
+ return this.uploadToPlatform(task.platform, task.file, config, metadata);
624
639
  });
625
640
  const results = await Promise.all(uploadPromises);
626
- const report = this.aggregateResults(results, validPlatforms.length, startTime);
641
+ const report = this.aggregateResults(results, tasks.length, startTime);
627
642
  this.printReport(report);
628
643
  return report;
629
644
  }