ai-yuca 1.2.6 → 1.2.7

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.
Files changed (186) hide show
  1. package/dist/package.json +1 -1
  2. package/package.json +1 -1
  3. package/.cdn.cache.json +0 -96
  4. package/bin/cli.js +0 -85
  5. package/bin/cli.ts +0 -417
  6. package/debug-upload.js +0 -206
  7. package/docs/deploy.md +0 -286
  8. package/docs/usage.md +0 -223
  9. package/examples/sample.txt +0 -7
  10. package/examples/upload-example.js +0 -53
  11. package/i18n/de-de.json +0 -1211
  12. package/i18n/en-us.json +0 -1211
  13. package/i18n/es-es.json +0 -1211
  14. package/i18n/fr-fr.json +0 -1211
  15. package/i18n/it-it.json +0 -1211
  16. package/i18n/keys/aiAgent.json +0 -259
  17. package/i18n/keys/dev_20250102.json +0 -14
  18. package/i18n/keys/h5.json +0 -37
  19. package/i18n/keys/main.json +0 -436
  20. package/i18n/keys/newsite.json +0 -473
  21. package/i18n/lang/de-de/aiAgent.json +0 -259
  22. package/i18n/lang/de-de/dev_20250102.json +0 -14
  23. package/i18n/lang/de-de/h5.json +0 -37
  24. package/i18n/lang/de-de/main.json +0 -436
  25. package/i18n/lang/de-de/newsite.json +0 -473
  26. package/i18n/lang/en-us/aiAgent.json +0 -259
  27. package/i18n/lang/en-us/dev_20250102.json +0 -14
  28. package/i18n/lang/en-us/dev_241116.json +0 -49
  29. package/i18n/lang/en-us/h5.json +0 -37
  30. package/i18n/lang/en-us/main.json +0 -436
  31. package/i18n/lang/en-us/newsite.json +0 -473
  32. package/i18n/lang/es-es/aiAgent.json +0 -259
  33. package/i18n/lang/es-es/dev_20250102.json +0 -14
  34. package/i18n/lang/es-es/h5.json +0 -37
  35. package/i18n/lang/es-es/main.json +0 -436
  36. package/i18n/lang/es-es/newsite.json +0 -473
  37. package/i18n/lang/fr-fr/aiAgent.json +0 -259
  38. package/i18n/lang/fr-fr/dev_20250102.json +0 -14
  39. package/i18n/lang/fr-fr/h5.json +0 -37
  40. package/i18n/lang/fr-fr/main.json +0 -436
  41. package/i18n/lang/fr-fr/newsite.json +0 -473
  42. package/i18n/lang/it-it/aiAgent.json +0 -259
  43. package/i18n/lang/it-it/dev_20250102.json +0 -14
  44. package/i18n/lang/it-it/h5.json +0 -37
  45. package/i18n/lang/it-it/main.json +0 -436
  46. package/i18n/lang/it-it/newsite.json +0 -473
  47. package/i18n/lang/pt-pt/aiAgent.json +0 -259
  48. package/i18n/lang/pt-pt/dev_20250102.json +0 -14
  49. package/i18n/lang/pt-pt/h5.json +0 -37
  50. package/i18n/lang/pt-pt/main.json +0 -436
  51. package/i18n/lang/pt-pt/newsite.json +0 -473
  52. package/i18n/lang/ru-ru/aiAgent.json +0 -259
  53. package/i18n/lang/ru-ru/dev_20250102.json +0 -14
  54. package/i18n/lang/ru-ru/h5.json +0 -37
  55. package/i18n/lang/ru-ru/main.json +0 -436
  56. package/i18n/lang/ru-ru/newsite.json +0 -473
  57. package/i18n/lang/zh-cn/aiAgent.json +0 -259
  58. package/i18n/lang/zh-cn/dev_20250102.json +0 -14
  59. package/i18n/lang/zh-cn/dev_241116.json +0 -49
  60. package/i18n/lang/zh-cn/h5.json +0 -37
  61. package/i18n/lang/zh-cn/main.json +0 -436
  62. package/i18n/lang/zh-cn/newsite.json +0 -473
  63. package/i18n/lang/zh-hk/dev_241116.json +0 -49
  64. package/i18n/lang/zh-hk/main.json +0 -128
  65. package/i18n/pt-pt.json +0 -1211
  66. package/i18n/ru-ru.json +0 -1211
  67. package/i18n/zh-cn.json +0 -1211
  68. package/i18n/zh-hk.json +0 -128
  69. package/out/404.html +0 -1
  70. package/out/_next/static/chunks/1328.dd74ae6e3b15ff04.js +0 -1
  71. package/out/_next/static/chunks/1386-ecc75214ecbee698.js +0 -1
  72. package/out/_next/static/chunks/2433-e7a7a662dbf652f6.js +0 -1
  73. package/out/_next/static/chunks/2690-0095f1624d934453.js +0 -1
  74. package/out/_next/static/chunks/275-72255fc3d50dc50c.js +0 -1
  75. package/out/_next/static/chunks/2959.ae3acbd23e5f6cda.js +0 -1
  76. package/out/_next/static/chunks/3225-d85abacd3899a814.js +0 -1
  77. package/out/_next/static/chunks/3675-28b72a3b32730d1c.js +0 -1
  78. package/out/_next/static/chunks/3748.264b42930465e3e2.js +0 -1
  79. package/out/_next/static/chunks/4037-2b7b438dbc62c0d7.js +0 -1
  80. package/out/_next/static/chunks/4398.5d9a05b91ef7245f.js +0 -1
  81. package/out/_next/static/chunks/4622-c0099488d417e118.js +0 -1
  82. package/out/_next/static/chunks/4959-ad724f5ec8938d01.js +0 -1
  83. package/out/_next/static/chunks/5074.36b4aee9d001a900.js +0 -1
  84. package/out/_next/static/chunks/508-ba5053bf494548a6.js +0 -1
  85. package/out/_next/static/chunks/527-e5943a23b7cb1339.js +0 -1
  86. package/out/_next/static/chunks/5364-c39e26834b019bf3.js +0 -1
  87. package/out/_next/static/chunks/5538-bbaa8d71d26838f4.js +0 -1
  88. package/out/_next/static/chunks/5546-9819a4f3addbda7d.js +0 -1
  89. package/out/_next/static/chunks/5646-deba957ab6368360.js +0 -1
  90. package/out/_next/static/chunks/6360-f8ffe176e0fb126a.js +0 -1
  91. package/out/_next/static/chunks/6377.2de8a90471ccb1f2.js +0 -1
  92. package/out/_next/static/chunks/6459-b13d29c55a4ccc17.js +0 -1
  93. package/out/_next/static/chunks/6499-73f4ba916cde84ec.js +0 -1
  94. package/out/_next/static/chunks/6703.87e72c53c45ac649.js +0 -1
  95. package/out/_next/static/chunks/6831-ddb4f2c5325ed9e1.js +0 -1
  96. package/out/_next/static/chunks/6878-413d4147840a9d3f.js +0 -1
  97. package/out/_next/static/chunks/7136-92e74a77d4fe1c09.js +0 -1
  98. package/out/_next/static/chunks/7300-60bd937826e2889a.js +0 -1
  99. package/out/_next/static/chunks/7640-25157b4bebca756f.js +0 -1
  100. package/out/_next/static/chunks/7660-71eef9eb7f0e25f4.js +0 -1
  101. package/out/_next/static/chunks/8141-fc059567bae11835.js +0 -1
  102. package/out/_next/static/chunks/8229-27cb99a1348167ef.js +0 -1
  103. package/out/_next/static/chunks/8482-12ab17377a4689a4.js +0 -1
  104. package/out/_next/static/chunks/8671-531e97f50b7ac7e2.js +0 -1
  105. package/out/_next/static/chunks/8976-517d30d3cb7d450b.js +0 -1
  106. package/out/_next/static/chunks/8990-7bfc97b8a13369db.js +0 -1
  107. package/out/_next/static/chunks/9774-0752c9ec02a672b1.js +0 -1
  108. package/out/_next/static/chunks/framework-4e48f2cc6a39465a.js +0 -1
  109. package/out/_next/static/chunks/main-691aa8a7a04c0676.js +0 -1
  110. package/out/_next/static/chunks/pages/[lang]/help/[docs]-da22f062530993f0.js +0 -1
  111. package/out/_next/static/chunks/pages/[lang]/user/addr-add-66110024b03a0619.js +0 -1
  112. package/out/_next/static/chunks/pages/[lang]/user/address-756133e40329d810.js +0 -1
  113. package/out/_next/static/chunks/pages/[lang]/user/cart-a108662aa517644d.js +0 -1
  114. package/out/_next/static/chunks/pages/[lang]/user/coin-history-a3080e2211a22b4a.js +0 -1
  115. package/out/_next/static/chunks/pages/[lang]/user/coupons-73b673123e7dc947.js +0 -1
  116. package/out/_next/static/chunks/pages/[lang]/user/package-83495f0992231f5d.js +0 -1
  117. package/out/_next/static/chunks/pages/[lang]/user/promotion-669a234cb0b244a3.js +0 -1
  118. package/out/_next/static/chunks/pages/[lang]/user/top-up-54a68d160bc9712d.js +0 -1
  119. package/out/_next/static/chunks/pages/[lang]/user/user-trans-729e81ff7835ecd4.js +0 -1
  120. package/out/_next/static/chunks/pages/[lang]/user-fdd23283e1809971.js +0 -1
  121. package/out/_next/static/chunks/pages/[lang]-4c5942ab30d5820a.js +0 -1
  122. package/out/_next/static/chunks/pages/_app-9e17b6a9fc7f7fd6.js +0 -5
  123. package/out/_next/static/chunks/pages/_error-6df9c3943cfa136b.js +0 -1
  124. package/out/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
  125. package/out/_next/static/chunks/webpack-02d8ee89c01f16cc.js +0 -1
  126. package/out/_next/static/css/0ea4ceb6ceb58b84.css +0 -3
  127. package/out/_next/static/css/5812f5a1673562f2.css +0 -1
  128. package/out/_next/static/css/ebee78a7b84ab4db.css +0 -1
  129. package/out/de-de.html +0 -1
  130. package/out/en-us.html +0 -1
  131. package/out/es-es.html +0 -1
  132. package/out/favicon.ico +0 -0
  133. package/out/file.svg +0 -1
  134. package/out/fr-fr.html +0 -1
  135. package/out/globe.svg +0 -1
  136. package/out/it-it.html +0 -1
  137. package/out/next.svg +0 -1
  138. package/out/pt-pt.html +0 -1
  139. package/out/zh-cn/help/about-us.html +0 -41
  140. package/out/zh-cn/help/beginner-guide.html +0 -123
  141. package/out/zh-cn/help/delivery-agreement.html +0 -153
  142. package/out/zh-cn/help/faq.html +0 -102
  143. package/out/zh-cn/help/incentive-system.html +0 -254
  144. package/out/zh-cn/help/privacy-statement.html +0 -61
  145. package/out/zh-cn/help/promotion.html +0 -132
  146. package/out/zh-cn/help/return-refunds.html +0 -206
  147. package/out/zh-cn/help/service-agreement.html +0 -89
  148. package/out/zh-cn/help/user-guide.html +0 -169
  149. package/out/zh-cn/help/why-us.html +0 -138
  150. package/out/zh-cn/user/addr-add.html +0 -1
  151. package/out/zh-cn/user/address.html +0 -1
  152. package/out/zh-cn/user/cart.html +0 -1
  153. package/out/zh-cn/user/coin-history.html +0 -1
  154. package/out/zh-cn/user/coupons.html +0 -1
  155. package/out/zh-cn/user/package.html +0 -1
  156. package/out/zh-cn/user/promotion.html +0 -1
  157. package/out/zh-cn/user/top-up.html +0 -1
  158. package/out/zh-cn/user/user-trans.html +0 -1
  159. package/out/zh-cn/user.html +0 -1
  160. package/out/zh-cn.html +0 -1
  161. package/src/cache.ts +0 -167
  162. package/src/config.ts +0 -105
  163. package/src/deploy.ts +0 -578
  164. package/src/download.ts +0 -232
  165. package/src/index.js +0 -88
  166. package/src/index.ts +0 -98
  167. package/src/pullCrowdin.ts +0 -482
  168. package/src/types/analyze.ts +0 -37
  169. package/src/types/deploy.ts +0 -77
  170. package/src/types/download.ts +0 -67
  171. package/src/types/index.ts +0 -22
  172. package/src/types/pullCrowdin.ts +0 -164
  173. package/src/types/upload.ts +0 -125
  174. package/src/upload.js +0 -197
  175. package/src/upload.ts +0 -466
  176. package/src/uploadWithConfig.ts +0 -277
  177. package/src/utils/compression.ts +0 -61
  178. package/test/cli-test/test-exclude.js +0 -43
  179. package/test/cli-test/test-queue-upload.js +0 -49
  180. package/test/cli-test/test-retry.js +0 -71
  181. package/test/cli-test/test-upload-queue.js +0 -80
  182. package/test/compression.test.ts +0 -88
  183. package/test/download.test.ts +0 -162
  184. package/test/index.test.js +0 -38
  185. package/test/index.test.ts +0 -39
  186. package/test/upload.test.ts +0 -131
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-yuca",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "一个用AI生成的开发辅助工具",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-yuca",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "一个用AI生成的开发辅助工具",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
package/.cdn.cache.json DELETED
@@ -1,96 +0,0 @@
1
- {
2
- "1a99299c456ebc765167fd52e2001e74": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/404.html",
3
- "lastDeployVersion": "mfp1f60j",
4
- "lastDeployTime": "2025-09-18T06:36:46.855Z",
5
- "9c131577ed5a3ac2c491333d8ef2a9f9": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/1328.dd74ae6e3b15ff04.js",
6
- "cd7b2febfe85ef70a082e26acd4c2db2": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/1386-ecc75214ecbee698.js",
7
- "70a06778dece088aea2f8f4f930eae33": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/2433-e7a7a662dbf652f6.js",
8
- "d7eca074918940b61b0908fc0be75521": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/2690-0095f1624d934453.js",
9
- "ef4731128d2ff9f2e82be9bffca25383": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/275-72255fc3d50dc50c.js",
10
- "661e8d3be44e3ed0eebd21743918f521": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/2959.ae3acbd23e5f6cda.js",
11
- "97c4a3368fdde3e8829526144a022723": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/3225-d85abacd3899a814.js",
12
- "cde63adea346d4c3a729e7a170dac70d": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/3675-28b72a3b32730d1c.js",
13
- "598e1c13bff6c0453593c5267d906222": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/3748.264b42930465e3e2.js",
14
- "2f3e3aa7b2ef4d0e6521bae10ca65795": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/4037-2b7b438dbc62c0d7.js",
15
- "5f1ce6f19ab0aab661153c67a2d25eb1": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/4398.5d9a05b91ef7245f.js",
16
- "a14a0c897c5d6a36e57a7d1dcc846239": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/4622-c0099488d417e118.js",
17
- "339d445e0c8aa350e4a044c6ecafae59": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/4959-ad724f5ec8938d01.js",
18
- "96b9ff2023dd384cede1edb91499c6c7": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/5074.36b4aee9d001a900.js",
19
- "389cd6cd28ff553b246d2770635380c6": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/508-ba5053bf494548a6.js",
20
- "9737af21dde5d88084771cf4f8371970": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/527-e5943a23b7cb1339.js",
21
- "521d5320a5957d1f5ed6f3c8cdb6ffa5": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/5364-c39e26834b019bf3.js",
22
- "a8682c0aaac554adc346c85b75ab87e2": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/5538-bbaa8d71d26838f4.js",
23
- "d2c8f93e74883004f7fa329aa7d3a0d1": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/5546-9819a4f3addbda7d.js",
24
- "e3b206036ff2e9bea610850073a0cca1": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/5646-deba957ab6368360.js",
25
- "b2572f55cc3b2f085fa2cb04e4228f87": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6360-f8ffe176e0fb126a.js",
26
- "bca38d211fb9ce82fea310fec3c235aa": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6377.2de8a90471ccb1f2.js",
27
- "f00a931b54c6999405b2c1b53728cfff": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6459-b13d29c55a4ccc17.js",
28
- "419c2ace7bc6773427caf0efe4789088": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6499-73f4ba916cde84ec.js",
29
- "dc788f0ea4dddee06ac1e16e789044ac": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6703.87e72c53c45ac649.js",
30
- "4c47c356be3d591d8a884e4397c385e1": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6831-ddb4f2c5325ed9e1.js",
31
- "30aba2e3de94764ea8017cd9d67b4c8b": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/6878-413d4147840a9d3f.js",
32
- "e1c2d015d98f3e341f1f05eed4bd547b": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/7136-92e74a77d4fe1c09.js",
33
- "f99928a728c489b96aa29be6f258f523": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/7300-60bd937826e2889a.js",
34
- "fb5b372c29242f4f4a1c2acb4bf71ea8": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/7640-25157b4bebca756f.js",
35
- "c53f331dcba971007e2924dba10e7150": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/7660-71eef9eb7f0e25f4.js",
36
- "75745e551cecdcbeaf4db5a765e229a9": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/8141-fc059567bae11835.js",
37
- "e772116c9a6d2d4e4db0e1e807293c19": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/8229-27cb99a1348167ef.js",
38
- "92e448c243b7445f2a23374691811295": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/8482-12ab17377a4689a4.js",
39
- "76b16cc4e66062c4dfa1bfaa5eb38d63": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/8671-531e97f50b7ac7e2.js",
40
- "9646f36406c8e3ee0ba4f6af5762df91": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/8976-517d30d3cb7d450b.js",
41
- "ef866452f63e4dc6909f46d91c2eada5": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/8990-7bfc97b8a13369db.js",
42
- "069c6fa9a8cb487c5ae76e93e2ac851d": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/9774-0752c9ec02a672b1.js",
43
- "e9b3c6dfd6248d2ed01d5ba82d95f06f": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/framework-4e48f2cc6a39465a.js",
44
- "5d3c6f77ca889d5af44fac717da4b716": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/main-691aa8a7a04c0676.js",
45
- "8af1a6001bc6354a642c926e6756c535": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/help/[docs]-da22f062530993f0.js",
46
- "45c4450d7a5ffc3e5adc8d7e2e230e18": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/addr-add-66110024b03a0619.js",
47
- "8c33fe1ba8f4276ab4c8bb9b7e5ef62a": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/address-756133e40329d810.js",
48
- "a3775486d79c904c16cecf34646b9129": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/cart-a108662aa517644d.js",
49
- "9bfff886052ec4ceca7c25a9025a917a": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/coin-history-a3080e2211a22b4a.js",
50
- "1f722e0721e61b0a1c26b4298c85a9c2": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/coupons-73b673123e7dc947.js",
51
- "be15960af6a3985e89fca971120c9b3e": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/package-83495f0992231f5d.js",
52
- "0e39e5228d49265c53247bd87b35cf70": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/promotion-669a234cb0b244a3.js",
53
- "b9930b02ef701f0dfea3da46a9140b0b": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/top-up-54a68d160bc9712d.js",
54
- "ee5b83742e0de944fb578abaa8025eed": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user/user-trans-729e81ff7835ecd4.js",
55
- "22bc5226914d89cf4556eb04eb7bcae8": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]/user-fdd23283e1809971.js",
56
- "543ead04ce64036b96a0fc9e60a55382": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/[lang]-4c5942ab30d5820a.js",
57
- "143f0aa61af40b8174a22f83efde2a44": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/_app-9e17b6a9fc7f7fd6.js",
58
- "54ac0c128b24bff18dbe7a104144b8ad": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/pages/_error-6df9c3943cfa136b.js",
59
- "846118c33b2c0e922d7b3a7676f81f6f": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/polyfills-42372ed130431b0a.js",
60
- "305732b75ff2b910ffc7b179f78ec2fe": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/chunks/webpack-02d8ee89c01f16cc.js",
61
- "c0d22fa05bb01a979aa16647502841ea": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/css/0ea4ceb6ceb58b84.css",
62
- "50bfbd5d5399c220c9d75e830880ea95": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/css/5812f5a1673562f2.css",
63
- "00cd4b7e37eebd50d7dfbba2ff9250d4": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/_next/static/css/ebee78a7b84ab4db.css",
64
- "ecad0ad0e58696fefbd077cf80ca4eae": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/de-de.html",
65
- "26035c34c9604ef619aee0a0390ad5f2": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/en-us.html",
66
- "b2538becc3efe3c7f6e8baf8b08a8906": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/es-es.html",
67
- "2d6b00c26278a7e0cc36f17ccfd43ae8": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/favicon.ico",
68
- "d09f95206c3fa0bb9bd9fefabfd0ea71": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/file.svg",
69
- "7d4ae5c9a42c8e51a188bffef56afe07": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/fr-fr.html",
70
- "2aaafa6a49b6563925fe440891e32717": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/globe.svg",
71
- "5cd3c04827bbded361356f32bb7200ec": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/it-it.html",
72
- "8e061864f388b47f33a1c3780831193e": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/next.svg",
73
- "b4066bd38debe2fbb5175822ff56aee9": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/pt-pt.html",
74
- "50020dc76264ce4aa9e0bd558dad5fea": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/about-us.html",
75
- "6e502a5b60df5d59419fa299620dd89a": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/beginner-guide.html",
76
- "5631943a8ea8777480c72d3487f957a6": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/delivery-agreement.html",
77
- "75a6c9c5cd467e13d49694f8b4206842": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/faq.html",
78
- "8d90eb64288f45a8731c07b022c9bd48": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/incentive-system.html",
79
- "80eb11e81b584d7f4e7005d8eaeea412": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/privacy-statement.html",
80
- "f2a319665ca938caf61838b5b8fa89d0": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/promotion.html",
81
- "9b9f7877145a2c0294a1a4521c45ddb5": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/return-refunds.html",
82
- "a818ca1181996274a2d74b036bc12d8e": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/service-agreement.html",
83
- "a45b13865e180ad3089654748581dd13": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/user-guide.html",
84
- "dbbe926f7471e8a08b0a29a3ea1d9ddf": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/help/why-us.html",
85
- "456d04b7debe707ee3c6ce48fc693d40": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/addr-add.html",
86
- "6bdbce72ca0a8f4026dbbb07814acfff": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/address.html",
87
- "37f61247fed758955511a5b2587de935": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/cart.html",
88
- "fc445fc0cdd3973f4453feaee70ed6fa": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/coin-history.html",
89
- "b1306845df0ab4a4f6735a92e91d3faa": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/coupons.html",
90
- "b1009da3d328c61806dc469d7fdd5053": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/package.html",
91
- "c9d0f57aa2d6b9b728d3f3169843729e": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/promotion.html",
92
- "89c3fba566fb51d6c8ecc6f5c84a3777": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/top-up.html",
93
- "4a19a2cfea499099e40127cff9cb07e0": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user/user-trans.html",
94
- "6f7294a78724f57e19bf956e71fea29c": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn/user.html",
95
- "12eaa1a82b34e0b7ad027b327f8c7bfc": "https://storage.googleapis.com/decom-cdn-test/fed/static/china2u/zh-cn.html"
96
- }
package/bin/cli.js DELETED
@@ -1,85 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { program } = require('commander');
4
- const pkg = require('../package.json');
5
- const { analyze } = require('../src/index');
6
- const { createStorageClient, uploadFiles } = require('../src/upload');
7
-
8
- // 设置版本和描述
9
- program
10
- .version(pkg.version, '-v, --version')
11
- .description(pkg.description);
12
-
13
- // 添加analyze命令
14
- program
15
- .command('analyze')
16
- .description('分析文本内容')
17
- .option('-f, --file <path>', '指定要分析的文件路径')
18
- .option('-t, --text <text>', '直接分析提供的文本')
19
- .action((options) => {
20
- analyze(options);
21
- });
22
-
23
- // 添加upload命令
24
- program
25
- .command('upload')
26
- .description('上传文件到GCP存储桶')
27
- .option('-s, --source <paths...>', '指定要上传的文件或目录路径(支持多个)')
28
- .option('-b, --bucket <name>', 'GCP存储桶名称')
29
- .option('-d, --destination <path>', '目标路径(存储桶中的路径)')
30
- .option('-k, --key-file <path>', 'GCP服务账号密钥文件路径')
31
- .option('-r, --recursive', '递归上传目录中的文件', false)
32
- .action(async (options) => {
33
- try {
34
- const { source, bucket, destination, keyFile, recursive } = options;
35
-
36
- if (!source || !bucket || !keyFile) {
37
- console.error('错误: 必须提供源文件路径、存储桶名称和密钥文件路径');
38
- process.exit(1);
39
- }
40
-
41
- // 创建存储客户端
42
- const storageClient = createStorageClient({ keyFilename: keyFile });
43
-
44
- console.log('开始上传文件...');
45
-
46
- // 执行上传
47
- const results = await uploadFiles({
48
- bucketName: bucket,
49
- sourcePath: source,
50
- destination,
51
- storageClient,
52
- recursive
53
- });
54
-
55
- // 输出结果
56
- console.log('\n上传完成!');
57
- console.log(`成功: ${results.success.length} 个文件`);
58
- console.log(`失败: ${results.failed.length} 个文件`);
59
-
60
- if (results.success.length > 0) {
61
- console.log('\n成功上传的文件:');
62
- results.success.forEach(file => {
63
- console.log(`- ${file.file} (${file.url})`);
64
- });
65
- }
66
-
67
- if (results.failed.length > 0) {
68
- console.log('\n上传失败的文件:');
69
- results.failed.forEach(file => {
70
- console.log(`- ${file.file}: ${file.error}`);
71
- });
72
- }
73
- } catch (err) {
74
- console.error(`上传错误: ${err.message}`);
75
- process.exit(1);
76
- }
77
- });
78
-
79
- // 解析命令行参数
80
- program.parse(process.argv);
81
-
82
- // 如果没有提供任何命令,显示帮助信息
83
- if (!process.argv.slice(2).length) {
84
- program.outputHelp();
85
- }
package/bin/cli.ts DELETED
@@ -1,417 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { Command } from 'commander';
4
- import * as pkg from '../package.json';
5
- import * as fs from 'fs';
6
- import * as path from 'path';
7
- import { analyze } from '../src/index';
8
- import { createStorageClient, uploadFiles } from '../src/upload';
9
- import { downloadFiles } from '../src/download';
10
- import { uploadFilesWithConfig, getConfigSummary } from '../src/uploadWithConfig';
11
- import { deployFiles } from '../src/deploy';
12
- import { pullCrowdin } from '../src/pullCrowdin';
13
- import { AnalyzeOptions, UploadFilesResult, UploadCommandOptions, DownloadCommandOptions, UploadWithConfigOptions, DeployCommandOptions, PullCrowdinCommandOptions } from '../src/types';
14
-
15
- const program = new Command();
16
-
17
- // 设置版本和描述
18
- program
19
- .version(pkg.version, '-v, --version')
20
- .description(pkg.description);
21
-
22
- // 添加analyze命令
23
- program
24
- .command('analyze')
25
- .description('分析文本内容')
26
- .option('-f, --file <path>', '指定要分析的文件路径')
27
- .option('-t, --text <text>', '直接分析提供的文本')
28
- .action((options: AnalyzeOptions) => {
29
- analyze(options);
30
- });
31
-
32
- // 添加deploy命令
33
- program
34
- .command('deploy')
35
- .description('部署文件到指定环境')
36
- .requiredOption('-e, --env <environment>', '部署环境(如:dev、test、production)')
37
- .option('-c, --config <path>', '指定配置文件路径(默认为项目根目录下的vs.config.json)')
38
- .option('-k, --key-file <path>', 'GCP服务账号密钥文件路径(可选,不提供则使用应用默认凭证)')
39
- .option('-s, --source <path>', '自定义源路径(覆盖配置文件中的uploadPath)')
40
- .option('-d, --destination <path>', '自定义目标路径(覆盖配置文件中的目标路径)')
41
- .option('--no-recursive', '禁用递归上传目录中的文件')
42
- .option('--no-compression', '禁用GZIP压缩')
43
- .option('--no-cache', '禁用文件缓存功能')
44
- .option('--cache-file <path>', '指定缓存文件路径(默认为.cdn.cache.json)')
45
- .option('--show-config', '仅显示配置信息,不执行部署')
46
- .option('-f, --force', '强制执行,跳过交互式确认')
47
- .action(async (options: DeployCommandOptions) => {
48
- try {
49
- const result = await deployFiles(options);
50
-
51
- if (result.success) {
52
- console.log(`\n✅ ${result.message}`);
53
- console.log(`📦 项目名称: ${result.projectName}`);
54
- console.log(`🏷️ 版本号: ${result.cdnKey}`);
55
- console.log(`🌍 环境: ${result.environment}`);
56
- console.log(`📁 上传文件数: ${result.uploadedFiles}`);
57
-
58
- if (result.verificationUrl) {
59
- console.log(`🔗 验证地址: ${result.verificationUrl}`);
60
- }
61
- } else {
62
- console.error(`\n❌ ${result.message}`);
63
- process.exit(1);
64
- }
65
- } catch (err) {
66
- console.error(`部署错误: ${err instanceof Error ? err.message : String(err)}`);
67
- process.exit(1);
68
- }
69
- });
70
-
71
- // 使用从types导入的UploadCommandOptions接口
72
-
73
- // 添加upload命令
74
- program
75
- .command('upload')
76
- .description('上传文件到GCP存储桶')
77
- .option('-s, --source <paths...>', '指定要上传的文件或目录路径(支持多个)')
78
- .option('-b, --bucket <name>', 'GCP存储桶名称')
79
- .option('-d, --destination <path>', '目标路径(存储桶中的路径)')
80
- .option('-k, --key-file <path>', 'GCP服务账号密钥文件路径(可选,不提供则使用应用默认凭证)')
81
- .option('-r, --recursive', '递归上传目录中的文件', false)
82
- .option('-c, --no-compression', '禁用GZIP压缩(默认对js、css、json、html、woff文件启用压缩)')
83
- .action(async (options: UploadCommandOptions) => {
84
- try {
85
- const { source, bucket, destination, keyFile, recursive, compression = true } = options;
86
-
87
- if (!source || !bucket) {
88
- console.error('错误: 必须提供源文件路径和存储桶名称');
89
- process.exit(1);
90
- }
91
-
92
- // 创建存储客户端
93
- const storageClient = keyFile
94
- ? createStorageClient({ keyFilename: keyFile })
95
- : createStorageClient(); // 使用应用默认凭证
96
-
97
- console.log('开始上传文件...');
98
-
99
- // 处理多个源路径
100
- let allResults: UploadFilesResult = { success: [], failed: [], files: [] };
101
-
102
- for (const sourcePath of source) {
103
- console.log(`\n处理路径: ${sourcePath}`);
104
-
105
- // 检查路径是否存在
106
- if (!fs.existsSync(sourcePath)) {
107
- console.error(`错误: 路径不存在: ${sourcePath}`);
108
- allResults.failed.push({
109
- success: false,
110
- file: sourcePath,
111
- error: '路径不存在'
112
- });
113
- continue;
114
- }
115
-
116
- // 检查是文件还是文件夹
117
- const stats = fs.statSync(sourcePath);
118
- if (stats.isDirectory()) {
119
- console.log(`检测到文件夹,将上传文件夹内的所有文件${recursive ? '(递归)' : '(仅当前层级)'}`);
120
- } else {
121
- console.log('检测到文件,将上传该文件');
122
- }
123
-
124
- // 执行上传
125
- const results = await uploadFiles({
126
- bucketName: bucket,
127
- sourcePath: sourcePath,
128
- destination,
129
- storageClient,
130
- recursive,
131
- enableCompression: compression
132
- });
133
-
134
- // 合并结果
135
- allResults.success = allResults.success.concat(results.success);
136
- allResults.failed = allResults.failed.concat(results.failed);
137
- if (results.files) {
138
- allResults.files = allResults.files!.concat(results.files);
139
- }
140
- }
141
-
142
- const results = allResults;
143
-
144
- // 输出结果
145
- console.log('\n上传完成!');
146
- console.log(`成功: ${results.success.length} 个文件`);
147
- console.log(`失败: ${results.failed.length} 个文件`);
148
-
149
- if (results.success.length > 0) {
150
- console.log('\n成功上传的文件:');
151
- results.success.forEach(file => {
152
- console.log(`- ${file.file} (${file.url})`);
153
- });
154
- }
155
-
156
- if (results.failed.length > 0) {
157
- console.log('\n上传失败的文件:');
158
- results.failed.forEach(file => {
159
- console.log(`- ${file.file}: ${file.error}`);
160
- });
161
- }
162
-
163
- // 如果有files字段,显示目录下的所有文件
164
- if (results.files && results.files.length > 0) {
165
- console.log('\n目录下的所有文件:');
166
- results.files.forEach(file => {
167
- console.log(`- ${file}`);
168
- });
169
- }
170
- } catch (err) {
171
- console.error(`上传错误: ${err instanceof Error ? err.message : String(err)}`);
172
- process.exit(1);
173
- }
174
- });
175
-
176
- // 添加download命令
177
- program
178
- .command('download')
179
- .description('从GCP存储桶下载文件或文件夹')
180
- .option('-s, --source <path>', '指定要下载的GCP存储桶中的文件或目录路径')
181
- .option('-b, --bucket <name>', 'GCP存储桶名称')
182
- .option('-d, --destination <path>', '本地目标路径(下载到本地的路径)')
183
- .option('-k, --key-file <path>', 'GCP服务账号密钥文件路径(可选,不提供则使用应用默认凭证)')
184
- .option('-r, --recursive', '递归下载目录中的文件', false)
185
- .action(async (options: DownloadCommandOptions) => {
186
- try {
187
- const { source, bucket, destination, keyFile, recursive } = options;
188
-
189
- if (!source || !bucket || !destination) {
190
- console.error('错误: 必须提供源路径、存储桶名称和目标路径');
191
- process.exit(1);
192
- }
193
-
194
- // 创建存储客户端
195
- const storageClient = keyFile
196
- ? createStorageClient({ keyFilename: keyFile })
197
- : createStorageClient(); // 使用应用默认凭证
198
-
199
- console.log('开始下载文件...');
200
-
201
- // 执行下载
202
- const results = await downloadFiles({
203
- bucketName: bucket,
204
- sourcePath: source,
205
- destinationPath: destination,
206
- storageClient,
207
- recursive
208
- });
209
-
210
- // 输出结果
211
- console.log('\n下载完成!');
212
- console.log(`成功: ${results.success.length} 个文件`);
213
- console.log(`失败: ${results.failed.length} 个文件`);
214
-
215
- if (results.success.length > 0) {
216
- console.log('\n成功下载的文件:');
217
- results.success.forEach(file => {
218
- console.log(`- ${file.file} -> ${file.localPath}`);
219
- });
220
- }
221
-
222
- if (results.failed.length > 0) {
223
- console.log('\n下载失败的文件:');
224
- results.failed.forEach(file => {
225
- console.log(`- ${file.file}: ${file.error}`);
226
- });
227
- }
228
- } catch (err) {
229
- console.error(`下载错误: ${err instanceof Error ? err.message : String(err)}`);
230
- process.exit(1);
231
- }
232
- });
233
-
234
- // 添加基于配置文件的上传命令
235
- program
236
- .command('upload-config')
237
- .description('基于vs.config.json配置文件上传文件到GCP存储桶')
238
- .option('-c, --config <path>', '指定配置文件路径(默认为项目根目录下的vs.config.json)')
239
- .option('-k, --key-file <path>', 'GCP服务账号密钥文件路径(可选,不提供则使用应用默认凭证)')
240
- .option('-s, --source <path>', '自定义源路径(覆盖配置文件中的uploadPath)')
241
- .option('-d, --destination <path>', '自定义目标路径(覆盖配置文件中的目标路径)')
242
- .option('--no-recursive', '禁用递归上传目录中的文件')
243
- .option('--no-compression', '禁用GZIP压缩')
244
- .option('--no-cache', '禁用文件缓存功能')
245
- .option('--cache-file <path>', '指定缓存文件路径(默认为.cdn.cache.json)')
246
- .option('--show-config', '仅显示配置信息,不执行上传')
247
- .action(async (options: any) => {
248
- try {
249
- const {
250
- config: configPath,
251
- keyFile,
252
- source: customSourcePath,
253
- destination: customDestination,
254
- recursive = true,
255
- compression = true,
256
- cache = true,
257
- cacheFile,
258
- showConfig = false
259
- } = options;
260
-
261
- // 如果只是显示配置信息
262
- if (showConfig) {
263
- try {
264
- const configSummary = getConfigSummary(configPath);
265
- console.log('配置信息:');
266
- console.log(` 桶名称: ${configSummary.bucketName}`);
267
- console.log(` 源路径: ${configSummary.sourcePath}`);
268
- console.log(` 目标路径: ${configSummary.destination}`);
269
- return;
270
- } catch (err) {
271
- console.error(`读取配置失败: ${err instanceof Error ? err.message : String(err)}`);
272
- process.exit(1);
273
- }
274
- }
275
-
276
- // 执行上传
277
- const uploadOptions: UploadWithConfigOptions = {
278
- configPath,
279
- storageClientOptions: keyFile ? { keyFilename: keyFile } : {},
280
- customSourcePath,
281
- customDestination,
282
- recursive,
283
- enableCompression: compression,
284
- enableCache: cache,
285
- cacheFilePath: cacheFile
286
- };
287
-
288
- const result = await uploadFilesWithConfig(uploadOptions);
289
-
290
- if (result.success.length > 0) {
291
- console.log('\n上传成功的文件:');
292
- result.success.forEach((file) => {
293
- console.log(` ✓ ${file.file} -> ${file.url}`);
294
- });
295
- }
296
-
297
- if (result.failed.length > 0) {
298
- console.log('\n上传失败的文件:');
299
- result.failed.forEach((file) => {
300
- console.log(` ✗ ${file.file}: ${file.error}`);
301
- });
302
- }
303
-
304
- // 显示目录下的所有文件
305
- if (result.files && result.files.length > 0) {
306
- console.log('\n目录下的所有文件:');
307
- result.files.forEach((file) => {
308
- console.log(`- ${file}`);
309
- });
310
- }
311
-
312
- } catch (err) {
313
- console.error(`上传错误: ${err instanceof Error ? err.message : String(err)}`);
314
- process.exit(1);
315
- }
316
- });
317
-
318
- // 添加init命令
319
- program
320
- .command('init')
321
- .description('在当前目录生成vs.config.json配置文件')
322
- .option('-f, --force', '强制覆盖已存在的配置文件')
323
- .action(async (options: any) => {
324
- try {
325
- const configPath = path.join(process.cwd(), 'vs.config.json');
326
-
327
- // 检查文件是否已存在
328
- if (fs.existsSync(configPath) && !options.force) {
329
- console.log('vs.config.json 文件已存在。使用 --force 选项强制覆盖。');
330
- return;
331
- }
332
-
333
- // 默认配置内容
334
- const defaultConfig = {
335
- "upload": {
336
- "uploadPath": "out",
337
- "s3Static": "static/projectName"
338
- },
339
- "deploy": {
340
- "baseUrlExample": "baseUrl: ['/', 'en-us/', 'zh-hk/', 'test/']",
341
- "baseUrl": [
342
- "/",
343
- "en-us/",
344
- ],
345
- "host": "",
346
- "testHost": ""
347
- },
348
- "aws": {
349
- "Bucket": "cdn",
350
- "prefix": "fed",
351
- "Region": "us-east-1",
352
- "HostName": ""
353
- },
354
- "crowdin": {
355
- "project": "fed-project-name",
356
- "langMap": ["zh-cn","en-us", "de-de", "pt-pt", "fr-fr", "es-es", "it-it", "ru-ru"],
357
- "workDir": "src",
358
- "reg": "{#(.+?)#}",
359
- "keysDir": "src/_i18n",
360
- "prefix": "fed",
361
- "Region": "us-east-1",
362
- "FromIni": "mall",
363
- "HostName": ""
364
- }
365
- };
366
-
367
- // 写入配置文件
368
- fs.writeFileSync(configPath, JSON.stringify(defaultConfig, null, 2), 'utf8');
369
-
370
- console.log('✓ vs.config.json 配置文件已生成');
371
- console.log('请根据您的项目需求修改配置文件中的相关参数。');
372
-
373
- } catch (err) {
374
- console.error(`生成配置文件失败: ${err instanceof Error ? err.message : String(err)}`);
375
- process.exit(1);
376
- }
377
- });
378
-
379
- // 添加pull-crowdin命令
380
- program
381
- .command('pull-crowdin')
382
- .description('从GCP下载Crowdin相关的JSON资源文件')
383
- .option('-c, --config <path>', '指定配置文件路径(默认为项目根目录下的vs.config.json)')
384
- .option('-k, --key-file <path>', 'GCP服务账号密钥文件路径(可选,不提供则使用应用默认凭证)')
385
- .option('-r, --region <region>', 'GCP区域(默认为ap-southeast-1)')
386
- .option('--exclude <pattern>', '排除包含指定模式的文件')
387
- .option('--aws', '使用AWS凭证而非GCP凭证')
388
- .action(async (options: PullCrowdinCommandOptions) => {
389
- try {
390
- const {
391
- config: configPath,
392
- keyFile,
393
- region,
394
- exclude,
395
- aws = false
396
- } = options;
397
-
398
- // 执行pull-crowdin操作
399
- await pullCrowdin({
400
- config: configPath,
401
- keyFile,
402
- region,
403
- exclude,
404
- aws
405
- });
406
-
407
- } catch (err) {
408
- console.error(`Pull Crowdin 操作失败: ${err instanceof Error ? err.message : String(err)}`);
409
- process.exit(1);
410
- }
411
- });
412
-
413
- program.parse(process.argv);
414
-
415
- if (!process.argv.slice(2).length) {
416
- program.outputHelp();
417
- }