flu-cli-core 1.0.3 → 1.0.4

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/README.md CHANGED
@@ -67,10 +67,10 @@ ProjectGenerator
67
67
 
68
68
  ## 📦 三种使用方式
69
69
 
70
- | 方式 | 工具 | 用途 |
71
- | ---------- | ------------ | ----------------- |
72
- | **命令行** | flu-cli (v2) | CI/CD、自动化发版 |
73
- | **可视化** | VSCode 插件 | IDE 内点击操作 |
70
+ | 方式 | 工具 | 用途 |
71
+ | ---------- | ------------------- | ----------------- |
72
+ | **命令行** | flu-cli (v2) | CI/CD、自动化发版 |
73
+ | **可视化** | VSCode 插件 | IDE 内点击操作 |
74
74
  | **编程** | @huoye/app-ship npm | 自建发布系统 |
75
75
 
76
76
  ## 🔗 相关资源
package/dist/index.cjs CHANGED
@@ -5586,23 +5586,38 @@ var UploadManager = class {
5586
5586
  };
5587
5587
  }
5588
5588
  const files = Array.isArray(filePaths) ? filePaths : [filePaths];
5589
- logger2.info(`Processing ${files.length} file(s) for ${validPlatforms.length} platform(s)`);
5590
- const uploadPromises = validPlatforms.map((platform) => {
5589
+ const tasks = [];
5590
+ validPlatforms.forEach((platform) => {
5591
5591
  const uploader = this.uploaders.get(platform);
5592
- const targetFile = files.find((f) => uploader.canHandle(f));
5593
- if (!targetFile) {
5592
+ const matchedFiles = files.filter((f) => uploader.canHandle(f));
5593
+ if (matchedFiles.length === 0) {
5594
5594
  logger2.warn(`[${platform}] No compatible file found in provided files`);
5595
- return Promise.resolve({
5596
- platform,
5597
- success: false,
5598
- message: `No compatible file found for ${platform}`
5595
+ } else {
5596
+ matchedFiles.forEach((file) => {
5597
+ tasks.push({ platform, file });
5599
5598
  });
5600
5599
  }
5601
- logger2.info(`[${platform}] Matched file: ${import_path37.default.basename(targetFile)}`);
5602
- return this.uploadToPlatform(platform, targetFile, config, metadata);
5600
+ });
5601
+ if (tasks.length === 0) {
5602
+ logger2.error("No valid platform-file matches found");
5603
+ return {
5604
+ totalUploads: validPlatforms.length,
5605
+ successCount: 0,
5606
+ failureCount: validPlatforms.length,
5607
+ successPlatforms: [],
5608
+ failurePlatforms: validPlatforms,
5609
+ results: [],
5610
+ totalDurationMs: Date.now() - startTime,
5611
+ summary: "No compatible files found for any of the selected platforms"
5612
+ };
5613
+ }
5614
+ logger2.info(`Scheduled ${tasks.length} upload task(s) for ${validPlatforms.length} platform(s)`);
5615
+ const uploadPromises = tasks.map((task) => {
5616
+ logger2.info(`[${task.platform}] Matched file: ${import_path37.default.basename(task.file)}`);
5617
+ return this.uploadToPlatform(task.platform, task.file, config, metadata);
5603
5618
  });
5604
5619
  const results = await Promise.all(uploadPromises);
5605
- const report = this.aggregateResults(results, validPlatforms.length, startTime);
5620
+ const report = this.aggregateResults(results, tasks.length, startTime);
5606
5621
  this.printReport(report);
5607
5622
  return report;
5608
5623
  }
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { UploadConfig, BuildResult } from 'app-ship';
1
+ import { UploadConfig, BuildResult } from '@huoye/app-ship';
2
2
  export * from '@huoye/app-ship';
3
3
 
4
4
  interface Logger {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { UploadConfig, BuildResult } from 'app-ship';
1
+ import { UploadConfig, BuildResult } from '@huoye/app-ship';
2
2
  export * from '@huoye/app-ship';
3
3
 
4
4
  interface Logger {
package/dist/index.js CHANGED
@@ -4920,23 +4920,38 @@ var UploadManager = class {
4920
4920
  };
4921
4921
  }
4922
4922
  const files = Array.isArray(filePaths) ? filePaths : [filePaths];
4923
- logger2.info(`Processing ${files.length} file(s) for ${validPlatforms.length} platform(s)`);
4924
- const uploadPromises = validPlatforms.map((platform) => {
4923
+ const tasks = [];
4924
+ validPlatforms.forEach((platform) => {
4925
4925
  const uploader = this.uploaders.get(platform);
4926
- const targetFile = files.find((f) => uploader.canHandle(f));
4927
- if (!targetFile) {
4926
+ const matchedFiles = files.filter((f) => uploader.canHandle(f));
4927
+ if (matchedFiles.length === 0) {
4928
4928
  logger2.warn(`[${platform}] No compatible file found in provided files`);
4929
- return Promise.resolve({
4930
- platform,
4931
- success: false,
4932
- message: `No compatible file found for ${platform}`
4929
+ } else {
4930
+ matchedFiles.forEach((file) => {
4931
+ tasks.push({ platform, file });
4933
4932
  });
4934
4933
  }
4935
- logger2.info(`[${platform}] Matched file: ${path22.basename(targetFile)}`);
4936
- return this.uploadToPlatform(platform, targetFile, config, metadata);
4934
+ });
4935
+ if (tasks.length === 0) {
4936
+ logger2.error("No valid platform-file matches found");
4937
+ return {
4938
+ totalUploads: validPlatforms.length,
4939
+ successCount: 0,
4940
+ failureCount: validPlatforms.length,
4941
+ successPlatforms: [],
4942
+ failurePlatforms: validPlatforms,
4943
+ results: [],
4944
+ totalDurationMs: Date.now() - startTime,
4945
+ summary: "No compatible files found for any of the selected platforms"
4946
+ };
4947
+ }
4948
+ logger2.info(`Scheduled ${tasks.length} upload task(s) for ${validPlatforms.length} platform(s)`);
4949
+ const uploadPromises = tasks.map((task) => {
4950
+ logger2.info(`[${task.platform}] Matched file: ${path22.basename(task.file)}`);
4951
+ return this.uploadToPlatform(task.platform, task.file, config, metadata);
4937
4952
  });
4938
4953
  const results = await Promise.all(uploadPromises);
4939
- const report = this.aggregateResults(results, validPlatforms.length, startTime);
4954
+ const report = this.aggregateResults(results, tasks.length, startTime);
4940
4955
  this.printReport(report);
4941
4956
  return report;
4942
4957
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flu-cli-core",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Core logic for flu-cli",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -36,7 +36,7 @@
36
36
  "author": "火叶工作室",
37
37
  "license": "MIT",
38
38
  "dependencies": {
39
- "@huoye/app-ship": "^0.1.0",
39
+ "@huoye/app-ship": "^0.1.1",
40
40
  "axios": "^1.13.2",
41
41
  "chalk": "^4.1.2",
42
42
  "form-data": "^4.0.5",