@baic/yolk-cli 2.1.0-alpha.72 → 2.1.0-alpha.74

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 (380) hide show
  1. package/compiled/commander/package.json +1 -1
  2. package/compiled/glob/package.json +1 -1
  3. package/compiled/minimatch/index.js +16 -15
  4. package/compiled/minimatch/package.json +1 -1
  5. package/compiled/mkdirp/package.json +1 -1
  6. package/compiled/mustache/index.d.ts +1 -1
  7. package/compiled/mustache/package.json +1 -1
  8. package/compiled/prettier/index.d.ts +13 -1
  9. package/compiled/prettier/index.js +1222 -578
  10. package/compiled/prettier/package.json +1 -1
  11. package/compiled/rimraf/package.json +1 -1
  12. package/compiled/staged-git-files/package.json +1 -1
  13. package/es/.prettierrc.js +13 -11
  14. package/es/yolk.js +1 -1
  15. package/lib/.prettierrc.js +13 -11
  16. package/lib/yolk.js +1 -1
  17. package/package.json +4 -3
  18. package/templates/ice-mobile/.eslintrc +0 -6
  19. package/templates/ice-mobile/.gitignore.tpl +0 -37
  20. package/templates/ice-mobile/.icerc.ts +0 -3
  21. package/templates/ice-mobile/.npmrc.tpl +0 -2
  22. package/templates/ice-mobile/.prettierignore +0 -8
  23. package/templates/ice-mobile/.prettierrc.js +0 -1
  24. package/templates/ice-mobile/.stylelintrc +0 -3
  25. package/templates/ice-mobile/README.md.tpl +0 -34
  26. package/templates/ice-mobile/package.json.tpl +0 -16
  27. package/templates/ice-mobile/public/favicon.ico +0 -0
  28. package/templates/ice-mobile/public/index.html +0 -15
  29. package/templates/ice-mobile/src/app.tsx +0 -5
  30. package/templates/ice-mobile/src/common/request.ts +0 -3
  31. package/templates/ice-mobile/src/common/util.ts +0 -7
  32. package/templates/ice-mobile/src/components/index.ts +0 -0
  33. package/templates/ice-mobile/src/global.less +0 -3
  34. package/templates/ice-mobile/src/layouts/index.tsx +0 -5
  35. package/templates/ice-mobile/src/pages/404.tsx +0 -10
  36. package/templates/ice-mobile/src/pages/demo/examples/BarCode.tsx +0 -4
  37. package/templates/ice-mobile/src/pages/demo/examples/Iconfont.tsx +0 -18
  38. package/templates/ice-mobile/src/pages/demo/examples/Input.tsx +0 -16
  39. package/templates/ice-mobile/src/pages/demo/examples/List/1.tsx +0 -12
  40. package/templates/ice-mobile/src/pages/demo/examples/List/2.tsx +0 -29
  41. package/templates/ice-mobile/src/pages/demo/examples/List/3.tsx +0 -29
  42. package/templates/ice-mobile/src/pages/demo/examples/List/4.tsx +0 -55
  43. package/templates/ice-mobile/src/pages/demo/examples/List/mock.ts +0 -30
  44. package/templates/ice-mobile/src/pages/demo/examples/Loading.tsx +0 -12
  45. package/templates/ice-mobile/src/pages/demo/examples/NumberInput/1.tsx +0 -16
  46. package/templates/ice-mobile/src/pages/demo/examples/NumberInput/2.tsx +0 -16
  47. package/templates/ice-mobile/src/pages/demo/examples/NumberInput/3.tsx +0 -16
  48. package/templates/ice-mobile/src/pages/demo/examples/NumberInput/4.tsx +0 -16
  49. package/templates/ice-mobile/src/pages/demo/examples/PagingList/1.tsx +0 -6
  50. package/templates/ice-mobile/src/pages/demo/examples/QrCode.tsx +0 -4
  51. package/templates/ice-mobile/src/pages/demo/examples/Required.tsx +0 -4
  52. package/templates/ice-mobile/src/pages/demo/examples/TimerButton.tsx +0 -4
  53. package/templates/ice-mobile/src/pages/demo/examples/usePreload.tsx +0 -9
  54. package/templates/ice-mobile/src/pages/demo/index.tsx +0 -87
  55. package/templates/ice-mobile/src/pages/index.tsx +0 -3
  56. package/templates/ice-mobile/src/routes.ts +0 -29
  57. package/templates/ice-mobile/src/types/user.d.ts +0 -3
  58. package/templates/ice-mobile/tsconfig.json +0 -3
  59. package/templates/ice-mobile/typings.d.ts +0 -1
  60. package/templates/ice-mobile-h5+app/.eslintrc +0 -6
  61. package/templates/ice-mobile-h5+app/.gitignore.tpl +0 -37
  62. package/templates/ice-mobile-h5+app/.icerc.ts +0 -6
  63. package/templates/ice-mobile-h5+app/.npmrc.tpl +0 -2
  64. package/templates/ice-mobile-h5+app/.prettierignore +0 -8
  65. package/templates/ice-mobile-h5+app/.prettierrc.js +0 -1
  66. package/templates/ice-mobile-h5+app/.stylelintrc +0 -3
  67. package/templates/ice-mobile-h5+app/README.md.tpl +0 -34
  68. package/templates/ice-mobile-h5+app/h5+app/manifest.json +0 -87
  69. package/templates/ice-mobile-h5+app/package.json.tpl +0 -16
  70. package/templates/ice-mobile-h5+app/public/favicon.ico +0 -0
  71. package/templates/ice-mobile-h5+app/public/index.html +0 -15
  72. package/templates/ice-mobile-h5+app/src/app.tsx +0 -5
  73. package/templates/ice-mobile-h5+app/src/common/request.ts +0 -3
  74. package/templates/ice-mobile-h5+app/src/common/util.ts +0 -7
  75. package/templates/ice-mobile-h5+app/src/components/index.ts +0 -0
  76. package/templates/ice-mobile-h5+app/src/global.less +0 -3
  77. package/templates/ice-mobile-h5+app/src/layouts/index.tsx +0 -5
  78. package/templates/ice-mobile-h5+app/src/pages/404.tsx +0 -10
  79. package/templates/ice-mobile-h5+app/src/pages/demo/examples/BarCode.tsx +0 -4
  80. package/templates/ice-mobile-h5+app/src/pages/demo/examples/Iconfont.tsx +0 -18
  81. package/templates/ice-mobile-h5+app/src/pages/demo/examples/Input.tsx +0 -16
  82. package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/1.tsx +0 -12
  83. package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/2.tsx +0 -29
  84. package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/3.tsx +0 -29
  85. package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/4.tsx +0 -55
  86. package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/mock.ts +0 -30
  87. package/templates/ice-mobile-h5+app/src/pages/demo/examples/Loading.tsx +0 -12
  88. package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/1.tsx +0 -16
  89. package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/2.tsx +0 -16
  90. package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/3.tsx +0 -16
  91. package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/4.tsx +0 -16
  92. package/templates/ice-mobile-h5+app/src/pages/demo/examples/PagingList/1.tsx +0 -6
  93. package/templates/ice-mobile-h5+app/src/pages/demo/examples/QrCode.tsx +0 -4
  94. package/templates/ice-mobile-h5+app/src/pages/demo/examples/Required.tsx +0 -4
  95. package/templates/ice-mobile-h5+app/src/pages/demo/examples/TimerButton.tsx +0 -4
  96. package/templates/ice-mobile-h5+app/src/pages/demo/examples/usePreload.tsx +0 -9
  97. package/templates/ice-mobile-h5+app/src/pages/demo/index.tsx +0 -87
  98. package/templates/ice-mobile-h5+app/src/pages/index.tsx +0 -3
  99. package/templates/ice-mobile-h5+app/src/routes.ts +0 -29
  100. package/templates/ice-mobile-h5+app/src/types/user.d.ts +0 -3
  101. package/templates/ice-mobile-h5+app/tsconfig.json +0 -3
  102. package/templates/ice-mobile-h5+app/typings.d.ts +0 -1
  103. package/templates/ice-mobile-native/.eslintrc +0 -6
  104. package/templates/ice-mobile-native/.gitignore.tpl +0 -42
  105. package/templates/ice-mobile-native/.icerc.ts +0 -8
  106. package/templates/ice-mobile-native/.npmrc.tpl +0 -2
  107. package/templates/ice-mobile-native/.prettierignore +0 -8
  108. package/templates/ice-mobile-native/.prettierrc.js +0 -1
  109. package/templates/ice-mobile-native/.stylelintrc +0 -3
  110. package/templates/ice-mobile-native/README.md.tpl +0 -34
  111. package/templates/ice-mobile-native/android/app/6209ba977ffec7d62675a4e254ebc209.keystore +0 -0
  112. package/templates/ice-mobile-native/android/app/build.gradle +0 -66
  113. package/templates/ice-mobile-native/android/app/libs/Bluetooth-release.aar +0 -0
  114. package/templates/ice-mobile-native/android/app/libs/PosPrinterSDK.jar +0 -0
  115. package/templates/ice-mobile-native/android/app/libs/android-gif-drawable-release@1.2.23.aar +0 -0
  116. package/templates/ice-mobile-native/android/app/libs/lib.5plus.base-release.aar +0 -0
  117. package/templates/ice-mobile-native/android/app/libs/oaid_sdk_1.0.25.aar +0 -0
  118. package/templates/ice-mobile-native/android/app/libs/webview-x5-release.aar +0 -0
  119. package/templates/ice-mobile-native/android/app/proguard-rules.pro +0 -303
  120. package/templates/ice-mobile-native/android/app/src/main/AndroidManifest.xml +0 -98
  121. package/templates/ice-mobile-native/android/app/src/main/assets/apps/H5ECA1DEE/www/manifest.json +0 -89
  122. package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_control.xml +0 -6
  123. package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_error.html +0 -92
  124. package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_properties.xml +0 -19
  125. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/JSBridge/FunctionCreator.java +0 -119
  126. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/MPandoraEntryActivity.java +0 -17
  127. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/FunctionFactory/Creator.java +0 -17
  128. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/FunctionFactory/Error.java +0 -26
  129. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/JSPlugin.java +0 -265
  130. package/templates/ice-mobile-native/android/app/src/main/res/drawable/icon.png +0 -0
  131. package/templates/ice-mobile-native/android/app/src/main/res/values/colors.xml +0 -5
  132. package/templates/ice-mobile-native/android/app/src/main/res/values/strings.xml +0 -3
  133. package/templates/ice-mobile-native/android/build.gradle +0 -9
  134. package/templates/ice-mobile-native/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  135. package/templates/ice-mobile-native/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  136. package/templates/ice-mobile-native/android/gradle.properties +0 -22
  137. package/templates/ice-mobile-native/android/gradlew +0 -185
  138. package/templates/ice-mobile-native/android/gradlew.bat +0 -89
  139. package/templates/ice-mobile-native/android/settings.gradle +0 -16
  140. package/templates/ice-mobile-native/ios/HBuilder/HBuilder.entitlements +0 -5
  141. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/1024x1024.png +0 -0
  142. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/120x120-1.png +0 -0
  143. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/120x120.png +0 -0
  144. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/180x180.png +0 -0
  145. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/40x40.png +0 -0
  146. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/58x58.png +0 -0
  147. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/60x60.png +0 -0
  148. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/80x80.png +0 -0
  149. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/87x87.png +0 -0
  150. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/Contents.json +0 -62
  151. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/Contents.json +0 -6
  152. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/Image.imageset/Contents.json +0 -20
  153. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/120x120.png +0 -0
  154. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/180x180.png +0 -0
  155. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/60x60.png +0 -0
  156. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/Contents.json +0 -26
  157. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/control_brightness.imageset/Contents.json +0 -21
  158. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/control_brightness.imageset/brightness@2x.png +0 -0
  159. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/Contents.json +0 -22
  160. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/shrinkscreen@2x.png +0 -0
  161. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/shrinkscreen@3x.png +0 -0
  162. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset/Contents.json +0 -22
  163. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset//346/233/235/345/205/211-1.png +0 -0
  164. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset//346/233/235/345/205/211.png +0 -0
  165. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset/Contents.json +0 -22
  166. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset//345/257/271/347/204/246/346/241/206-1.png +0 -0
  167. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset//345/257/271/347/204/246/346/241/206.png +0 -0
  168. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_line.imageset/Contents.json +0 -21
  169. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_line.imageset//345/257/271/347/204/246/347/272/277.png +0 -0
  170. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_thumb.imageset/Contents.json +0 -22
  171. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_thumb.imageset//345/257/271/347/204/246/345/272/225-1.png +0 -0
  172. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_thumb.imageset//345/257/271/347/204/246/345/272/225.png +0 -0
  173. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/Contents.json +0 -22
  174. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/fullscreen@2x.png +0 -0
  175. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/fullscreen@3x.png +0 -0
  176. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/Contents.json +0 -23
  177. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play.png +0 -0
  178. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play@2x.png +0 -0
  179. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play@3x.png +0 -0
  180. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/Contents.json +0 -23
  181. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back.png +0 -0
  182. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back@2x.png +0 -0
  183. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back@3x.png +0 -0
  184. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/Contents.json +0 -23
  185. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play.png +0 -0
  186. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play@2x.png +0 -0
  187. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play@3x.png +0 -0
  188. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/Contents.json +0 -23
  189. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop.png +0 -0
  190. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop@2x.png +0 -0
  191. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop@3x.png +0 -0
  192. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/Contents.json +0 -22
  193. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/video_ic_muteoff@2x.png +0 -0
  194. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/video_ic_muteoff@3x.png +0 -0
  195. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/Contents.json +0 -22
  196. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/video_ic_muteon@2x.png +0 -0
  197. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/video_ic_muteon@3x.png +0 -0
  198. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/Contents.json +0 -22
  199. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/video_volume@2x.png +0 -0
  200. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/video_volume@3x.png +0 -0
  201. package/templates/ice-mobile-native/ios/HBuilder-Hello/120x120.png +0 -0
  202. package/templates/ice-mobile-native/ios/HBuilder-Hello/180x180.png +0 -0
  203. package/templates/ice-mobile-native/ios/HBuilder-Hello/AppDelegate.h +0 -16
  204. package/templates/ice-mobile-native/ios/HBuilder-Hello/AppDelegate.m +0 -225
  205. package/templates/ice-mobile-native/ios/HBuilder-Hello/Base.lproj/LaunchScreen.storyboard +0 -65
  206. package/templates/ice-mobile-native/ios/HBuilder-Hello/English.lproj/Localizable.strings +0 -13
  207. package/templates/ice-mobile-native/ios/HBuilder-Hello/HBuilder-Hello-Info.plist +0 -486
  208. package/templates/ice-mobile-native/ios/HBuilder-Hello/HBuilder-Hello-Prefix.pch +0 -16
  209. package/templates/ice-mobile-native/ios/HBuilder-Hello/LaunchScreen.storyboard +0 -67
  210. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/manifest.json +0 -79
  211. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/1024x1024.png +0 -0
  212. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/120x120.png +0 -0
  213. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/144x144.png +0 -0
  214. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/152x152.png +0 -0
  215. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/167x167.png +0 -0
  216. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/180x180.png +0 -0
  217. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/192x192.png +0 -0
  218. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/20x20.png +0 -0
  219. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/29x29.png +0 -0
  220. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/40x40.png +0 -0
  221. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/58x58.png +0 -0
  222. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/60x60.png +0 -0
  223. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/72x72.png +0 -0
  224. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/76x76.png +0 -0
  225. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/80x80.png +0 -0
  226. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/87x87.png +0 -0
  227. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/96x96.png +0 -0
  228. package/templates/ice-mobile-native/ios/HBuilder-Hello/ViewController.h +0 -19
  229. package/templates/ice-mobile-native/ios/HBuilder-Hello/ViewController.m +0 -161
  230. package/templates/ice-mobile-native/ios/HBuilder-Hello/Xprinter.h +0 -19
  231. package/templates/ice-mobile-native/ios/HBuilder-Hello/Xprinter.m +0 -235
  232. package/templates/ice-mobile-native/ios/HBuilder-Hello/control.xml +0 -107
  233. package/templates/ice-mobile-native/ios/HBuilder-Hello/en.lproj/InfoPlist.strings +0 -4
  234. package/templates/ice-mobile-native/ios/HBuilder-Hello/en.lproj/Localizable.strings +0 -12
  235. package/templates/ice-mobile-native/ios/HBuilder-Hello/main.m +0 -18
  236. package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/InfoPlist.strings +0 -4
  237. package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/LaunchScreen.strings +0 -3
  238. package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/Localizable.strings +0 -13
  239. package/templates/ice-mobile-native/ios/HBuilder-Hello.xcodeproj/project.pbxproj +0 -1607
  240. package/templates/ice-mobile-native/package.json.tpl +0 -16
  241. package/templates/ice-mobile-native/public/favicon.ico +0 -0
  242. package/templates/ice-mobile-native/public/index.html +0 -15
  243. package/templates/ice-mobile-native/src/app.tsx +0 -5
  244. package/templates/ice-mobile-native/src/common/Xprinter.ts +0 -58
  245. package/templates/ice-mobile-native/src/common/bluetooth.ts +0 -354
  246. package/templates/ice-mobile-native/src/common/bridge.ts +0 -59
  247. package/templates/ice-mobile-native/src/common/request.ts +0 -3
  248. package/templates/ice-mobile-native/src/common/util.ts +0 -7
  249. package/templates/ice-mobile-native/src/components/index.ts +0 -0
  250. package/templates/ice-mobile-native/src/global.less +0 -3
  251. package/templates/ice-mobile-native/src/layouts/index.tsx +0 -5
  252. package/templates/ice-mobile-native/src/pages/404.tsx +0 -10
  253. package/templates/ice-mobile-native/src/pages/demo/examples/BarCode.tsx +0 -4
  254. package/templates/ice-mobile-native/src/pages/demo/examples/Iconfont.tsx +0 -18
  255. package/templates/ice-mobile-native/src/pages/demo/examples/Input.tsx +0 -16
  256. package/templates/ice-mobile-native/src/pages/demo/examples/List/1.tsx +0 -12
  257. package/templates/ice-mobile-native/src/pages/demo/examples/List/2.tsx +0 -29
  258. package/templates/ice-mobile-native/src/pages/demo/examples/List/3.tsx +0 -29
  259. package/templates/ice-mobile-native/src/pages/demo/examples/List/4.tsx +0 -55
  260. package/templates/ice-mobile-native/src/pages/demo/examples/List/mock.ts +0 -30
  261. package/templates/ice-mobile-native/src/pages/demo/examples/Loading.tsx +0 -12
  262. package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/1.tsx +0 -16
  263. package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/2.tsx +0 -16
  264. package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/3.tsx +0 -16
  265. package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/4.tsx +0 -16
  266. package/templates/ice-mobile-native/src/pages/demo/examples/PagingList/1.tsx +0 -6
  267. package/templates/ice-mobile-native/src/pages/demo/examples/QrCode.tsx +0 -4
  268. package/templates/ice-mobile-native/src/pages/demo/examples/Required.tsx +0 -4
  269. package/templates/ice-mobile-native/src/pages/demo/examples/TimerButton.tsx +0 -4
  270. package/templates/ice-mobile-native/src/pages/demo/examples/Xprinter/index.tsx +0 -64
  271. package/templates/ice-mobile-native/src/pages/demo/examples/Xprinter/style.less +0 -16
  272. package/templates/ice-mobile-native/src/pages/demo/examples/usePreload.tsx +0 -9
  273. package/templates/ice-mobile-native/src/pages/demo/index.tsx +0 -89
  274. package/templates/ice-mobile-native/src/pages/index.tsx +0 -3
  275. package/templates/ice-mobile-native/src/routes.ts +0 -29
  276. package/templates/ice-mobile-native/src/types/user.d.ts +0 -3
  277. package/templates/ice-mobile-native/tsconfig.json +0 -3
  278. package/templates/ice-mobile-native/typings.d.ts +0 -1
  279. package/templates/ice-web/.eslintrc +0 -6
  280. package/templates/ice-web/.gitignore.tpl +0 -37
  281. package/templates/ice-web/.icerc.ts +0 -3
  282. package/templates/ice-web/.npmrc.tpl +0 -2
  283. package/templates/ice-web/.prettierignore +0 -8
  284. package/templates/ice-web/.prettierrc.js +0 -1
  285. package/templates/ice-web/.stylelintrc +0 -3
  286. package/templates/ice-web/README.md.tpl +0 -34
  287. package/templates/ice-web/package.json.tpl +0 -16
  288. package/templates/ice-web/public/favicon.ico +0 -0
  289. package/templates/ice-web/public/index.html +0 -15
  290. package/templates/ice-web/src/app.tsx +0 -5
  291. package/templates/ice-web/src/common/request.ts +0 -3
  292. package/templates/ice-web/src/common/util.ts +0 -7
  293. package/templates/ice-web/src/components/index.ts +0 -0
  294. package/templates/ice-web/src/global.less +0 -5
  295. package/templates/ice-web/src/layouts/index.tsx +0 -5
  296. package/templates/ice-web/src/pages/404.tsx +0 -17
  297. package/templates/ice-web/src/pages/demo/examples/BankInput.tsx +0 -12
  298. package/templates/ice-web/src/pages/demo/examples/BarCode.tsx +0 -4
  299. package/templates/ice-web/src/pages/demo/examples/Collapse.tsx +0 -4
  300. package/templates/ice-web/src/pages/demo/examples/DatePicker.tsx +0 -4
  301. package/templates/ice-web/src/pages/demo/examples/Flex.tsx +0 -10
  302. package/templates/ice-web/src/pages/demo/examples/Grid/1.tsx +0 -25
  303. package/templates/ice-web/src/pages/demo/examples/Grid/2.tsx +0 -26
  304. package/templates/ice-web/src/pages/demo/examples/Grid/3.tsx +0 -37
  305. package/templates/ice-web/src/pages/demo/examples/Grid/4.tsx +0 -43
  306. package/templates/ice-web/src/pages/demo/examples/Grid/5.tsx +0 -35
  307. package/templates/ice-web/src/pages/demo/examples/Grid/6.tsx +0 -28
  308. package/templates/ice-web/src/pages/demo/examples/Iconfont.tsx +0 -18
  309. package/templates/ice-web/src/pages/demo/examples/ImagePreview.tsx +0 -20
  310. package/templates/ice-web/src/pages/demo/examples/Input/1.tsx +0 -4
  311. package/templates/ice-web/src/pages/demo/examples/Input/2.tsx +0 -81
  312. package/templates/ice-web/src/pages/demo/examples/LinkButton/1.tsx +0 -4
  313. package/templates/ice-web/src/pages/demo/examples/LinkButton/2.tsx +0 -9
  314. package/templates/ice-web/src/pages/demo/examples/LinkButton/3.tsx +0 -12
  315. package/templates/ice-web/src/pages/demo/examples/Loading.tsx +0 -12
  316. package/templates/ice-web/src/pages/demo/examples/MobileInput.tsx +0 -4
  317. package/templates/ice-web/src/pages/demo/examples/NumberInput.tsx +0 -4
  318. package/templates/ice-web/src/pages/demo/examples/PagingTable.tsx +0 -21
  319. package/templates/ice-web/src/pages/demo/examples/QrCode.tsx +0 -4
  320. package/templates/ice-web/src/pages/demo/examples/RangeNumber/1.tsx +0 -4
  321. package/templates/ice-web/src/pages/demo/examples/RangeNumber/2.tsx +0 -14
  322. package/templates/ice-web/src/pages/demo/examples/Required.tsx +0 -4
  323. package/templates/ice-web/src/pages/demo/examples/SearchLayout.tsx +0 -46
  324. package/templates/ice-web/src/pages/demo/examples/Table/1.tsx +0 -64
  325. package/templates/ice-web/src/pages/demo/examples/Table/2.tsx +0 -29
  326. package/templates/ice-web/src/pages/demo/examples/Table/3.tsx +0 -39
  327. package/templates/ice-web/src/pages/demo/examples/Table/4.tsx +0 -42
  328. package/templates/ice-web/src/pages/demo/examples/TimerButton.tsx +0 -4
  329. package/templates/ice-web/src/pages/demo/examples/Title/1.tsx +0 -4
  330. package/templates/ice-web/src/pages/demo/examples/Title/2.tsx +0 -5
  331. package/templates/ice-web/src/pages/demo/examples/WaterMark.tsx +0 -8
  332. package/templates/ice-web/src/pages/demo/examples/Wrapper.tsx +0 -40
  333. package/templates/ice-web/src/pages/demo/examples/usePreload.tsx +0 -9
  334. package/templates/ice-web/src/pages/demo/index.tsx +0 -135
  335. package/templates/ice-web/src/pages/index.tsx +0 -3
  336. package/templates/ice-web/src/routes.ts +0 -29
  337. package/templates/ice-web/src/types/user.d.ts +0 -3
  338. package/templates/ice-web/tsconfig.json +0 -3
  339. package/templates/ice-web/typings.d.ts +0 -1
  340. package/templates/ice-web-screen/.eslintrc +0 -6
  341. package/templates/ice-web-screen/.gitignore.tpl +0 -37
  342. package/templates/ice-web-screen/.icerc.ts +0 -3
  343. package/templates/ice-web-screen/.npmrc.tpl +0 -2
  344. package/templates/ice-web-screen/.prettierignore +0 -8
  345. package/templates/ice-web-screen/.prettierrc.js +0 -1
  346. package/templates/ice-web-screen/.stylelintrc +0 -3
  347. package/templates/ice-web-screen/README.md.tpl +0 -34
  348. package/templates/ice-web-screen/package.json.tpl +0 -17
  349. package/templates/ice-web-screen/public/favicon.ico +0 -0
  350. package/templates/ice-web-screen/public/index.html +0 -15
  351. package/templates/ice-web-screen/src/app.tsx +0 -5
  352. package/templates/ice-web-screen/src/common/request.ts +0 -3
  353. package/templates/ice-web-screen/src/common/util.ts +0 -15
  354. package/templates/ice-web-screen/src/components/index.ts +0 -1
  355. package/templates/ice-web-screen/src/components/resize-container/index.tsx +0 -95
  356. package/templates/ice-web-screen/src/components/resize-container/style.module.less +0 -3
  357. package/templates/ice-web-screen/src/constants.ts +0 -7
  358. package/templates/ice-web-screen/src/global.less +0 -31
  359. package/templates/ice-web-screen/src/hooks/use-size.ts +0 -18
  360. package/templates/ice-web-screen/src/layouts/16_9/fixed.less +0 -18
  361. package/templates/ice-web-screen/src/layouts/16_9/index.tsx +0 -34
  362. package/templates/ice-web-screen/src/layouts/16_9/style.module.less +0 -19
  363. package/templates/ice-web-screen/src/layouts/components/index.ts +0 -0
  364. package/templates/ice-web-screen/src/layouts/controller/index.tsx +0 -79
  365. package/templates/ice-web-screen/src/layouts/index.tsx +0 -11
  366. package/templates/ice-web-screen/src/pages/404.tsx +0 -17
  367. package/templates/ice-web-screen/src/pages/index.tsx +0 -3
  368. package/templates/ice-web-screen/src/pages/template/16_9/index.tsx +0 -13
  369. package/templates/ice-web-screen/src/pages/template/16_9/style.module.less +0 -7
  370. package/templates/ice-web-screen/src/pages/template/components/charts/demo-line/index.tsx +0 -274
  371. package/templates/ice-web-screen/src/pages/template/components/charts/index.ts +0 -1
  372. package/templates/ice-web-screen/src/pages/template/components/index.ts +0 -1
  373. package/templates/ice-web-screen/src/pages/template/controller/index.tsx +0 -85
  374. package/templates/ice-web-screen/src/pages/template/index.tsx +0 -15
  375. package/templates/ice-web-screen/src/pages/template/style.module.less +0 -3
  376. package/templates/ice-web-screen/src/routes.ts +0 -29
  377. package/templates/ice-web-screen/src/styles/vars.less +0 -5
  378. package/templates/ice-web-screen/src/types/user.d.ts +0 -3
  379. package/templates/ice-web-screen/tsconfig.json +0 -3
  380. package/templates/ice-web-screen/typings.d.ts +0 -1
@@ -1 +1 @@
1
- {"name":"prettier","author":"James Long","license":"MIT"}
1
+ {"name":"prettier","version":"2.8.1","author":"James Long","license":"MIT","_lastModified":"2023-01-10T02:20:32.751Z"}
@@ -1 +1 @@
1
- {"name":"rimraf","author":"Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)","license":"ISC"}
1
+ {"name":"rimraf","version":"3.0.2","author":"Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)","license":"ISC","_lastModified":"2023-01-10T02:20:32.800Z"}
@@ -1 +1 @@
1
- {"name":"staged-git-files","author":"Matthew Chase Whittemore <mcwhittemore@gmail.com>","license":"BSD-2-Clause"}
1
+ {"name":"staged-git-files","version":"1.3.0","author":"Matthew Chase Whittemore <mcwhittemore@gmail.com>","license":"BSD-2-Clause","_lastModified":"2023-01-10T02:20:32.845Z"}
package/es/.prettierrc.js CHANGED
@@ -1,13 +1,15 @@
1
1
  module.exports = {
2
- "printWidth": 80,
3
- "singleQuote": true,
4
- "trailingComma": "all",
5
- "proseWrap": "never",
6
- "overrides": [{
7
- "files": ".prettierrc",
8
- "options": {
9
- "parser": "json"
10
- }
11
- }],
2
+ printWidth: 80,
3
+ singleQuote: true,
4
+ trailingComma: 'all',
5
+ proseWrap: 'never',
6
+ overrides: [
7
+ {
8
+ files: '.prettierrc',
9
+ options: {
10
+ parser: 'json',
11
+ },
12
+ },
13
+ ],
12
14
  // "plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
13
- }
15
+ };
package/es/yolk.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #! /usr/bin/env node
2
- function e(e){return n(e)||i(e)||c(e)||t()}function t(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(e){if(Array.isArray(e))return e}function r(e){return a(e)||i(e)||c(e)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){if(e){if("string"===typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function i(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e){if(Array.isArray(e))return s(e)}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}import{execSync as p,spawn as f}from"child_process";import d from"fs";import y from"os";import g from"path";import v from"inquirer";import h from"lodash";import*as b from"miniprogram-ci";import j from"ora";import S from"../compiled/commander";import x from"../compiled/glob";import w from"../compiled/minimatch";import k from"../compiled/mkdirp";import O from"../compiled/mustache";import{format as P}from"../compiled/prettier";import E from"../compiled/rimraf";import F from"../package.json";var I=require("../compiled/staged-git-files"),B=process.cwd(),A="##### CREATED BY YOLK #####",D={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},q="utf-8",$=20,T=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/.ice/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],N=j(),Q=function(e){return e&&N.warn(Buffer.from(e,q).toString())},R=function(e){return e&&N.fail(Buffer.from(e,q).toString())},_=function(e){return e&&N.succeed(Buffer.from(e,q).toString())},K=function(e){return e&&N.info(Buffer.from(e,q).toString())},L=function(e){return"win32"===process.platform?"".concat(e,".cmd"):e},C=function(){_("yolk complete!"),process.exit(0)},J=function(){Q("yolk break!"),process.exit(0)},U=function(e){var t=e.command,n=e.args,r=e.complete,o=e.close,c=e.exit,i=void 0===c||c,a=f(L(t),n||[],{stdio:"inherit"}).on("close",(function(e){e?(o&&o(),R("yolk close!"),process.exit(e)):(r&&r(),i&&C())}));process.on("SIGINT",(function(){S.runningCommand&&S.runningCommand.kill("SIGKILL"),a.kill(),J()}))},H=function(e,t,n){v.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"web big screen template(umi framework)",value:"umi-web-screen"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"mobile HBuilderX h5+app template(umi framework)",value:"umi-mobile-h5+app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"web template(ice framework)",value:"ice-web"},{name:"web big screen template(ice framework)",value:"ice-web-screen"},{name:"mobile template(ice framework)",value:"ice-mobile"},{name:"mobile HBuilderX h5+app template(ice framework)",value:"ice-mobile-h5+app"},{name:"mobile native template(ice framework)",value:"ice-mobile-native"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:g.basename(g.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:"default",choices:[{name:"\u9ed8\u8ba4\u5b89\u88c5",value:"default"},{name:"\u8df3\u8fc7\u5b89\u88c5",value:!1},{name:"pnpm install",value:"pnpm"},{name:"yarn install",value:"yarn"},{name:"npm install",value:"npm"}]}]).then((function(r){var o={projectName:r.projectName,dependenciesInstallType:r.dependenciesInstallType,yolkVersion:F.version};t||(t=g.join(__dirname,"../templates/".concat(r.type))),_("\u590d\u5236\u6a21\u7248 ".concat(g.basename(t)));var c=x.sync("**/*",{cwd:t,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(c.forEach((function(n){if(t){var r=g.join(t,n);if(!d.statSync(r).isDirectory())if(n.endsWith(".tpl")){var c=d.readFileSync(r,q),i=g.join(e,n.replace(/\.tpl$/,"")),a=O.render(c,o);k.sync(g.dirname(i)),_("\u521b\u5efa ".concat(g.relative(e,i))),d.writeFileSync(i,a,q)}else{_("\u521b\u5efa ".concat(n));var s=g.join(e,n);k.sync(g.dirname(s)),d.copyFileSync(r,s)}}})),_("\u590d\u5236\u6a21\u7248 success!"),n&&d.existsSync(t)&&E(t,(function(){_("\u7f13\u5b58\u5220\u9664 success! ".concat(g.basename(t||"")))})),r.dependenciesInstallType)switch(_("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),r.dependenciesInstallType){case"default":case"pnpm":U({command:"pnpm",args:["install"]});break;case"yarn":U({command:"yarn",args:["install"]});break;case"npm":U({command:"npm",args:["install"]});break;default:}_("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},M=function(e,t){return H(e,t,!0)},V=function(){var e=x.sync("*.yolkrc*",{cwd:B,dot:!0});if(!e.length)return{};var t=g.join(B,e[0]);if(!d.existsSync(t))return{};try{return JSON.parse(d.readFileSync(t,q))||{}}catch(n){return R(n.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},G=function(){var e=g.join(B,".prettierrc");if(d.existsSync(e))try{return JSON.parse(d.readFileSync(e,q))||{}}catch(t){return R(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return require("./.prettierrc")},X=function(){var e=g.join(B,"project.config.json");if(!d.existsSync(e))return{};try{return JSON.parse(d.readFileSync(e,q))||{}}catch(t){return R(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},Y=function(){var e=g.join(B,"package.json");if(!d.existsSync(e))return{};try{return JSON.parse(d.readFileSync(e,q))||{}}catch(t){return R(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},W=function(){return d.existsSync(g.join(B,"project.config.json"))},z=function(){return d.existsSync(g.join(B,".icerc.ts"))||d.existsSync(g.join(B,".icerc.js"))||d.existsSync(g.join(B,".ice.ts"))||d.existsSync(g.join(B,".ice.js"))},Z=function(){var e=d.existsSync(g.join(B,"node_modules/.bin/max"));if(!e)try{e=d.existsSync(require.resolve("@umijs/max"))}catch(r){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test(p("umi -v").toString())}catch(r){}if(!e){var t=g.join(B,"node_modules","umi","package.json");if(d.existsSync(t))try{var n=JSON.parse(d.readFileSync(t,q))||{};e=n.version&&+n.version.split(".")[0]>3}catch(r){}}return e},ee=function(){return d.existsSync(g.join(B,".icerc.ts"))?".icerc.ts":d.existsSync(g.join(B,".icerc.js"))?".icerc.js":d.existsSync(g.join(B,".ice.ts"))?".ice.ts":".ice.js"},te=function(){var e=g.join(B,"project.config.json");if(d.existsSync(e)){var t=require(e);return t.appid}return""},ne=function(){return d.existsSync(g.join(B,"project.tt.json"))&&0===te().indexOf("tt")},re=function(){return 0===te().indexOf("20")},oe=function(){var e=V(),t="";try{t=require.resolve("@baic/eslint-config-yolk")}catch(o){}var n=x.sync("*.eslintrc*",{cwd:B,dot:!0}),r=n[0];return!1===e.strict&&r&&d.existsSync(r)?r:d.existsSync(t)?t:r},ce=function(){var e=V(),t="";try{t=require.resolve("@baic/stylelint-config-yolk")}catch(o){}var n=x.sync("*.stylelintrc*",{cwd:B,dot:!0}),r=n[0];return!1===e.strict&&r&&d.existsSync(r)?r:d.existsSync(t)?t:r},ie=function(){var e=g.join(B,".git/"),t=g.join(B,".git/hooks"),n=g.join(t,"pre-commit"),r=d.existsSync(e),o=d.existsSync(n),c=o&&d.readFileSync(n,q).includes(A);if(r&&(!o||!c)){k.sync(t),d.writeFileSync(n,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",A].join(y.EOL),q);try{d.chmodSync(n,"777")}catch(i){R("chmod ".concat(n," failed: ").concat(i.message))}_("Create pre-commit hook")}},ae=function(){var e=V(),t=!1!==e.strict,n=e.eslintIgnore,o=e.stylelintIgnore;I().then((function(e){var c=function(n){return new Promise((function(c,i){var a=ce();if(a){var s=e.map((function(e){return e.filename})).filter((function(e){return/^(src|tests)/i.test(e)})).filter((function(e){return{css:/\.cs{2}$/i,less:/\.les{2}$/i,sass:/\.sas{2}$/i,scss:/\.scs{2}$/i}[n].test(e)})).filter((function(e){var t=g.join(B,e);return d.existsSync(t)})).filter((function(e){return T.every((function(t){return!w(e,t,{matchBase:!0})}))})).filter((function(e){return"string"===typeof o?!w(e,o,{matchBase:!0}):o instanceof RegExp?!o.test(e):!Array.isArray(o)||o.every((function(t){return"string"===typeof t?!w(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)}))}));if(s.length)if(s.forEach((function(e){if(e&&d.existsSync(e)){var t=g.extname(e).replace(/^\./,""),n=d.readFileSync(e,q),r=P(n,l({parser:D[t]},G()));d.writeFileSync(e,r,q)}})),_("".concat(n," - ").concat(s.length," files prettier success!")),s.length>=$){var m=[];h.chunk(s,$).forEach((function(e){m.push(new Promise((function(o,c){U({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax","postcss-".concat(n),"--config",a].concat(r(e)),complete:o,close:c,exit:!1})})))}));var u=0,p=function e(){u<m.length?m[u].then((function(){u++,e()})).catch(i):(_("".concat(n," - ").concat(s.length," files stylelint success!")),c())};p()}else s.length&&U({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax","postcss-".concat(n),"--config",a].concat(r(s)),complete:function(){_("".concat(n," - ").concat(s.length," files stylelint success!")),c()},close:i,exit:!1});else c()}else R("\u6ca1\u6709 stylelintrc \u6587\u4ef6\uff0c".concat(n," files prettier fail!")),c()}))},i=function(o){return new Promise((function(c,i){var a=oe();if(a){var s=e.map((function(e){return e.filename})).filter((function(e){return/^(src|tests)/i.test(e)})).filter((function(e){return{js:/\.js$/i,jsx:/\.jsx$/i,ts:/\.ts$/i,tsx:/\.tsx$/i}[o].test(e)})).filter((function(e){var t=g.join(B,e);return d.existsSync(t)})).filter((function(e){return T.every((function(t){return!w(e,t,{matchBase:!0})}))})).filter((function(e){return"string"===typeof n?!w(e,n,{matchBase:!0}):n instanceof RegExp?!n.test(e):!Array.isArray(n)||n.every((function(t){return"string"===typeof t?!w(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)}))}));if(s.length)if(s.forEach((function(e){if(e&&d.existsSync(e)){var t=g.extname(e).replace(/^\./,""),n=d.readFileSync(e,q),r=P(n,l({parser:D[t]},G()));d.writeFileSync(e,r,q)}})),_("".concat(o," - ").concat(s.length," files prettier success!")),s.length>=$){var m=[];h.chunk(s,$).forEach((function(e){m.push(new Promise((function(n,o){U({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",a].concat(r(e)),complete:n,close:o,exit:!1})})))}));var u=0,p=function e(){u<m.length?m[u].then((function(){u++,e()})).catch(i):(_("".concat(o," - ").concat(s.length," files eslint success!")),c())};p()}else s.length&&U({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",a].concat(r(s)),complete:function(){_("".concat(o," - ").concat(s.length," files eslint success!")),c()},close:i,exit:!1});else c()}else R("\u6ca1\u6709 eslintrc \u6587\u4ef6\uff0c".concat(o," files eslint fail!")),c()}))};Q("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),t&&(Q("git commit \u7981\u6b62 lint \u7684 ignore \u884c\u4e3a"),o&&Q("\u901a\u8fc7 .yolkrc \u914d\u7f6e stylelintIgnore: ".concat(o,"\u3002")),n&&Q("\u901a\u8fc7 .yolkrc \u914d\u7f6e eslintIgnore: ".concat(n,"\u3002"))),c("css").then((function(){return c("less")})).then((function(){return c("sass")})).then((function(){return c("scss")})).then((function(){return i("js")})).then((function(){return i("jsx")})).then((function(){return i("ts")})).then((function(){return i("tsx")})).then(C).catch(C)}))},se=function(e){var t=e.mProject,n=e.mPrivateKeyPath,r=e.mVersion,o=e.mDesc,c=e.mRobot,i=e.mQrcodeFormat,a=e.mQrcodeOutputDest,s=e.mPagePath,m=e.mSearchQuery,l=d.existsSync(g.join(B,".git"))?p("git log -1 --pretty=format:%H").toString():"",u=X(),f=u.appid,y=t||g.join(B,"dist"),v=n||g.join(B,"private.".concat(f,".key"));if(d.existsSync(y)){if(d.existsSync(v)){var h=Y(),j=r||h.version||u.version||"1.0.0",S=o||h.description||u.description,x="version: ".concat(j,";").concat(l?" commit: ".concat(l,";"):"").concat(S?" description: ".concat(S,";"):"");l&&K("commit: ".concat(l)),K("dist: ".concat(y)),K("key: ".concat(v)),K("appid: ".concat(f)),K("version: ".concat(j)),K("desc: ".concat(x));var w=new b.Project({appid:f,type:"miniProgram",projectPath:y,privateKeyPath:v,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:f,options:{project:w,version:j,desc:x,setting:u.setting,robot:c,qrcodeFormat:i,qrcodeOutputDest:a,pagePath:s,searchQuery:m}}}throw Error("\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(".concat(v,")"))}throw Error("\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(".concat(y,")"))},me=function(){ie(),process.argv.length>2?S.version(F.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]").option("--clone","\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248").option("--template <template>","\u6a21\u7248\u540d\u79f0\u6216\u8005clone\u6a21\u5f0f\u7684git\u5730\u5740").option("--docs","\u542f\u52a8\u6587\u6863\u6a21\u5f0f").option("--mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6").option("--mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--mQrcodeFormat <qrcodeFormat>",'\u5c0f\u7a0b\u5e8f\u9884\u89c8\u8fd4\u56de\u4e8c\u7ef4\u7801\u6587\u4ef6\u7684\u683c\u5f0f "image" \u6216 "base64"\uff0c \u9ed8\u8ba4\u503c "terminal" \u4f9b\u8c03\u8bd5\u7528').option("--mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570").action((function(t,n){var r=e(n),o=r[0],c=r.slice(1),i=t.clone,a=t.template,s=t.docs;if(o)switch(K("yolk version: ".concat(F.version)),K("node version: ".concat(process.version)),K("platform: ".concat(y.platform())),K("memory: ".concat(h.floor(y.freemem()/1024/1024)," MB(").concat(h.floor(y.totalmem()/1024/1024)," MB)")),o){case"init":if(_("yolk ".concat(o," \u5f00\u59cb")),i)if(a){var m=".yolk",u=g.join(B,m);d.existsSync(u)&&E(u,(function(){_("\u7f13\u5b58\u5220\u9664 success! ".concat(u))})),U({command:"git",args:["clone","-b","master","--depth","1",a,m].concat(c)}),M(B,u)}else R("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else H(B);break;case"start":W()?ne()?U({command:"taro",args:["build","--type","tt","--watch"].concat(c)}):re()?U({command:"taro",args:["build","--type","alipay","--watch"].concat(c)}):U({command:"taro",args:["build","--type","weapp","--watch"].concat(c)}):s?U({command:"dumi",args:["dev"].concat(c)}):z()?U({command:"icejs",args:["start","--config",ee()].concat(c)}):Z()?U({command:"max",args:["dev"].concat(c)}):U({command:"umi",args:["dev"].concat(c)});break;case"build":W()?ne()?U({command:"taro",args:["build","--type","tt"].concat(c)}):re()?U({command:"taro",args:["build","--type","alipay"].concat(c)}):U({command:"taro",args:["build","--type","weapp"].concat(c)}):s?U({command:"dumi",args:["build"].concat(c)}):z()?U({command:"icejs",args:["build","--config",ee()].concat(c)}):Z()?U({command:"max",args:["setup"].concat(c),complete:function(){return U({command:"max",args:["build"].concat(c)})},exit:!1}):U({command:"umi",args:["build"].concat(c)});break;case"pre-commit":ae();break;case"test":U({command:"umi-test",args:["--no-cache","--update-snapshot","--runInBand","--detectOpenHandles"].concat(c)});break;case"miniapp-upload":case"miniprogram-upload":if(W())if(ne());else if(re());else{var p=se(t),f=p.appid,v=p.options;K("".concat(f,"\u4e0a\u4f20\u5f00\u59cb")),b.upload(l(l({},h.pick(v,["project","version","desc","setting","robot"])),{},{onProgressUpdate:function(e){if(h.isString(e))K("task: ".concat(e));else{var t=e.status,n=e.message;K("task(".concat(t,"): ").concat(n))}}})).then((function(){_("".concat(f,"\u4e0a\u4f20\u5b8c\u6210"))}))}break;case"miniapp-preview":case"miniprogram-preview":if(W())if(ne());else if(re());else{var j=se(t),S=j.appid,x=j.options;K("".concat(S,"\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb")),b.preview(l(l({},h.pick(x,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"])),{},{onProgressUpdate:function(e){if(h.isString(e))K("task: ".concat(e));else{var t=e.status,n=e.message;K("task(".concat(t,"): ").concat(n))}}})).then((function(){_("".concat(S,"\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210"))}))}break;default:J()}})).parse(process.argv):J()};me();
2
+ import e from"@babel/runtime/helpers/esm/toArray";import t from"@babel/runtime/helpers/esm/toConsumableArray";import n from"@babel/runtime/helpers/esm/defineProperty";import r from"lodash/isString";import o from"lodash/pick";import c from"lodash/floor";import i from"lodash/chunk";function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}import{execSync as m,spawn as l}from"child_process";import p from"fs";import u from"os";import f from"path";import d from"inquirer";import*as y from"miniprogram-ci";import g from"ora";import h from"../compiled/commander";import v from"../compiled/glob";import b from"../compiled/minimatch";import j from"../compiled/mkdirp";import S from"../compiled/mustache";import{format as x}from"../compiled/prettier";import k from"../compiled/rimraf";import w from"../package.json";var P=require("../compiled/staged-git-files"),O=process.cwd(),F="##### CREATED BY YOLK #####",E={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},B="utf-8",D=20,I=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],q=g(),$=function(e){return e&&q.warn(Buffer.from(e,B).toString())},N=function(e){return e&&q.fail(Buffer.from(e,B).toString())},Q=function(e){return e&&q.succeed(Buffer.from(e,B).toString())},R=function(e){return e&&q.info(Buffer.from(e,B).toString())},T=function(e){return"win32"===process.platform?"".concat(e,".cmd"):e},_=function(){Q("yolk complete!"),process.exit(0)},A=function(){$("yolk break!"),process.exit(0)},K=function(e){var t=e.command,n=e.args,r=e.complete,o=e.close,c=e.exit,i=void 0===c||c,s=l(T(t),n||[],{stdio:"inherit"}).on("close",(function(e){e?(o&&o(),N("yolk close!"),process.exit(e)):(r&&r(),i&&_())}));process.on("SIGINT",(function(){h.runningCommand&&h.runningCommand.kill("SIGKILL"),s.kill(),A()}))},L=function(e,t,n){d.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"web big screen template(umi framework)",value:"umi-web-screen"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"mobile HBuilderX h5+app template(umi framework)",value:"umi-mobile-h5+app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:f.basename(f.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:"default",choices:[{name:"\u9ed8\u8ba4\u5b89\u88c5",value:"default"},{name:"\u8df3\u8fc7\u5b89\u88c5",value:!1},{name:"pnpm install",value:"pnpm"},{name:"yarn install",value:"yarn"},{name:"npm install",value:"npm"}]}]).then((function(r){var o={projectName:r.projectName,dependenciesInstallType:r.dependenciesInstallType,yolkVersion:w.version},c=t||f.join(__dirname,"../templates/".concat(r.type));Q("\u590d\u5236\u6a21\u7248 ".concat(f.basename(c)));var i=v.sync("**/*",{cwd:c,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(i.forEach((function(t){if(c){var n=f.join(c,t);if(!p.statSync(n).isDirectory())if(t.endsWith(".tpl")){var r=p.readFileSync(n,B),i=f.join(e,t.replace(/\.tpl$/,"")),s=S.render(r,o);j.sync(f.dirname(i)),Q("\u521b\u5efa ".concat(f.relative(e,i))),p.writeFileSync(i,s,B)}else{Q("\u521b\u5efa ".concat(t));var a=f.join(e,t);j.sync(f.dirname(a)),p.copyFileSync(n,a)}}})),Q("\u590d\u5236\u6a21\u7248 success!"),n&&p.existsSync(c)&&k(c,(function(){Q("\u7f13\u5b58\u5220\u9664 success! ".concat(f.basename(c||"")))})),r.dependenciesInstallType)switch(Q("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),r.dependenciesInstallType){case"default":case"pnpm":K({command:"pnpm",args:["install"]});break;case"yarn":K({command:"yarn",args:["install"]});break;case"npm":K({command:"npm",args:["install"]});break;default:}Q("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},C=function(e,t){return L(e,t,!0)},J=function(){var e=v.sync("*.yolkrc*",{cwd:O,dot:!0});if(!e.length)return{};var t=f.join(O,e[0]);if(!p.existsSync(t))return{};try{return JSON.parse(p.readFileSync(t,B))||{}}catch(n){return N(n.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},U=function(){var e=f.join(O,".prettierrc");if(p.existsSync(e))try{return JSON.parse(p.readFileSync(e,B))||{}}catch(t){return N(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return require("./.prettierrc")},H=function(){var e=f.join(O,"project.config.json");if(!p.existsSync(e))return{};try{return JSON.parse(p.readFileSync(e,B))||{}}catch(t){return N(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},V=function(){var e=f.join(O,"package.json");if(!p.existsSync(e))return{};try{return JSON.parse(p.readFileSync(e,B))||{}}catch(t){return N(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},G=function(){return p.existsSync(f.join(O,"project.config.json"))},M=function(){var e=p.existsSync(f.join(O,"node_modules/.bin/max"));if(!e)try{e=p.existsSync(require.resolve("@umijs/max"))}catch(r){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test(m("umi -v").toString())}catch(r){}if(!e){var t=f.join(O,"node_modules","umi","package.json");if(p.existsSync(t))try{var n=JSON.parse(p.readFileSync(t,B))||{};e=n.version&&+n.version.split(".")[0]>3}catch(r){}}return e},Y=function(){var e=f.join(O,"project.config.json");if(p.existsSync(e)){var t=require(e);return t.appid}return""},W=function(){return p.existsSync(f.join(O,"project.tt.json"))&&0===Y().indexOf("tt")},X=function(){return 0===Y().indexOf("20")},z=function(){var e=J(),t="";try{t=require.resolve("@baic/eslint-config-yolk")}catch(o){}var n=v.sync("*.eslintrc*",{cwd:O,dot:!0}),r=n[0];return!1===e.strict&&r&&p.existsSync(r)?r:p.existsSync(t)?t:r},Z=function(){var e=J(),t="";try{t=require.resolve("@baic/stylelint-config-yolk")}catch(o){}var n=v.sync("*.stylelintrc*",{cwd:O,dot:!0}),r=n[0];return!1===e.strict&&r&&p.existsSync(r)?r:p.existsSync(t)?t:r},ee=function(){var e=f.join(O,".git/"),t=f.join(O,".git/hooks"),n=f.join(t,"pre-commit"),r=p.existsSync(e),o=p.existsSync(n),c=o&&p.readFileSync(n,B).includes(F);if(r&&(!o||!c)){j.sync(t),p.writeFileSync(n,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",F].join(u.EOL),B);try{p.chmodSync(n,"777")}catch(i){N("chmod ".concat(n," failed: ").concat(i.message))}Q("Create pre-commit hook")}},te=function(){var e=J(),n=!1!==e.strict,r=e.eslintIgnore,o=e.stylelintIgnore;P().then((function(e){var c=function(r){return new Promise((function(c,s){var m=Z();if(m){var l=e.map((function(e){return e.filename})).filter((function(e){return/^(src|tests)/i.test(e)})).filter((function(e){return{css:/\.cs{2}$/i,less:/\.les{2}$/i,sass:/\.sas{2}$/i,scss:/\.scs{2}$/i}[r].test(e)})).filter((function(e){var t=f.join(O,e);return p.existsSync(t)})).filter((function(e){return I.every((function(t){return!b(e,t,{matchBase:!0})}))})).filter((function(e){return"string"===typeof o?!b(e,o,{matchBase:!0}):o instanceof RegExp?!o.test(e):!Array.isArray(o)||o.every((function(t){return"string"===typeof t?!b(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)}))}));if(l.length)if(l.forEach((function(e){if(e&&p.existsSync(e)){var t=f.extname(e).replace(/^\./,""),n=p.readFileSync(e,B),r=x(n,a({parser:E[t]},U()));p.writeFileSync(e,r,B)}})),Q("".concat(r," - ").concat(l.length," files prettier success!")),l.length>=D){var u=[];i(l,D).forEach((function(e){u.push(new Promise((function(o,c){K({command:"stylelint",args:[n?"--ignore-disables":"","--allow-empty-input","--custom-syntax","postcss-".concat(r),"--config",m].concat(t(e)),complete:o,close:c,exit:!1})})))}));var d=0,y=function e(){d<u.length?u[d].then((function(){d++,e()})).catch(s):(Q("".concat(r," - ").concat(l.length," files stylelint success!")),c())};y()}else l.length&&K({command:"stylelint",args:[n?"--ignore-disables":"","--allow-empty-input","--custom-syntax","postcss-".concat(r),"--config",m].concat(t(l)),complete:function(){Q("".concat(r," - ").concat(l.length," files stylelint success!")),c()},close:s,exit:!1});else c()}else N("\u6ca1\u6709 stylelintrc \u6587\u4ef6\uff0c".concat(r," files prettier fail!")),c()}))},s=function(o){return new Promise((function(c,s){var m=z();if(m){var l=e.map((function(e){return e.filename})).filter((function(e){return/^(src|tests)/i.test(e)})).filter((function(e){return{js:/\.js$/i,jsx:/\.jsx$/i,ts:/\.ts$/i,tsx:/\.tsx$/i}[o].test(e)})).filter((function(e){var t=f.join(O,e);return p.existsSync(t)})).filter((function(e){return I.every((function(t){return!b(e,t,{matchBase:!0})}))})).filter((function(e){return"string"===typeof r?!b(e,r,{matchBase:!0}):r instanceof RegExp?!r.test(e):!Array.isArray(r)||r.every((function(t){return"string"===typeof t?!b(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)}))}));if(l.length)if(l.forEach((function(e){if(e&&p.existsSync(e)){var t=f.extname(e).replace(/^\./,""),n=p.readFileSync(e,B),r=x(n,a({parser:E[t]},U()));p.writeFileSync(e,r,B)}})),Q("".concat(o," - ").concat(l.length," files prettier success!")),l.length>=D){var u=[];i(l,D).forEach((function(e){u.push(new Promise((function(r,o){K({command:"eslint",args:[n?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",m].concat(t(e)),complete:r,close:o,exit:!1})})))}));var d=0,y=function e(){d<u.length?u[d].then((function(){d++,e()})).catch(s):(Q("".concat(o," - ").concat(l.length," files eslint success!")),c())};y()}else l.length&&K({command:"eslint",args:[n?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",m].concat(t(l)),complete:function(){Q("".concat(o," - ").concat(l.length," files eslint success!")),c()},close:s,exit:!1});else c()}else N("\u6ca1\u6709 eslintrc \u6587\u4ef6\uff0c".concat(o," files eslint fail!")),c()}))};$("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),n&&($("git commit \u7981\u6b62 lint \u7684 ignore \u884c\u4e3a"),o&&$("\u901a\u8fc7 .yolkrc \u914d\u7f6e stylelintIgnore: ".concat(o,"\u3002")),r&&$("\u901a\u8fc7 .yolkrc \u914d\u7f6e eslintIgnore: ".concat(r,"\u3002"))),c("css").then((function(){return c("less")})).then((function(){return c("sass")})).then((function(){return c("scss")})).then((function(){return s("js")})).then((function(){return s("jsx")})).then((function(){return s("ts")})).then((function(){return s("tsx")})).then(_).catch(_)}))},ne=function(e){var t=e.mProject,n=e.mPrivateKeyPath,r=e.mVersion,o=e.mDesc,c=e.mRobot,i=e.mQrcodeFormat,s=e.mQrcodeOutputDest,a=e.mPagePath,l=e.mSearchQuery,u=p.existsSync(f.join(O,".git"))?m("git log -1 --pretty=format:%H").toString():"",d=H(),g=d.appid,h=t||f.join(O,"dist"),v=n||f.join(O,"private.".concat(g,".key"));if(p.existsSync(h)){if(p.existsSync(v)){var b=V(),j=r||b.version||d.version||"1.0.0",S=o||b.description||d.description,x="version: ".concat(j,";").concat(u?" commit: ".concat(u,";"):"").concat(S?" description: ".concat(S,";"):"");u&&R("commit: ".concat(u)),R("dist: ".concat(h)),R("key: ".concat(v)),R("appid: ".concat(g)),R("version: ".concat(j)),R("desc: ".concat(x));var k=new y.Project({appid:g,type:"miniProgram",projectPath:h,privateKeyPath:v,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:g,options:{project:k,version:j,desc:x,setting:d.setting,robot:c,qrcodeFormat:i,qrcodeOutputDest:s,pagePath:a,searchQuery:l}}}throw Error("\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(".concat(v,")"))}throw Error("\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(".concat(h,")"))},re=function(){ee(),process.argv.length>2?h.version(w.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]").option("--clone","\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248").option("--template <template>","\u6a21\u7248\u540d\u79f0\u6216\u8005clone\u6a21\u5f0f\u7684git\u5730\u5740").option("--docs","\u542f\u52a8\u6587\u6863\u6a21\u5f0f").option("--mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6").option("--mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--mQrcodeFormat <qrcodeFormat>",'\u5c0f\u7a0b\u5e8f\u9884\u89c8\u8fd4\u56de\u4e8c\u7ef4\u7801\u6587\u4ef6\u7684\u683c\u5f0f "image" \u6216 "base64"\uff0c \u9ed8\u8ba4\u503c "terminal" \u4f9b\u8c03\u8bd5\u7528').option("--mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570").action((function(t,n){var i=e(n),s=i[0],m=i.slice(1),l=t.clone,d=t.template,g=t.docs;if(s)switch(R("yolk version: ".concat(w.version)),R("node version: ".concat(process.version)),R("platform: ".concat(u.platform())),R("memory: ".concat(c(u.freemem()/1024/1024)," MB(").concat(c(u.totalmem()/1024/1024)," MB)")),s){case"init":if(Q("yolk ".concat(s," \u5f00\u59cb")),l)if(d){var h=".yolk",v=f.join(O,h);p.existsSync(v)&&k(v,(function(){Q("\u7f13\u5b58\u5220\u9664 success! ".concat(v))})),K({command:"git",args:["clone","-b","master","--depth","1",d,h].concat(m)}),C(O,v)}else N("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else L(O);break;case"start":G()?W()?K({command:"taro",args:["build","--type","tt","--watch"].concat(m)}):X()?K({command:"taro",args:["build","--type","alipay","--watch"].concat(m)}):K({command:"taro",args:["build","--type","weapp","--watch"].concat(m)}):g?K({command:"dumi",args:["dev"].concat(m)}):M()?K({command:"max",args:["dev"].concat(m)}):K({command:"umi",args:["dev"].concat(m)});break;case"build":G()?W()?K({command:"taro",args:["build","--type","tt"].concat(m)}):X()?K({command:"taro",args:["build","--type","alipay"].concat(m)}):K({command:"taro",args:["build","--type","weapp"].concat(m)}):g?K({command:"dumi",args:["build"].concat(m)}):M()?K({command:"max",args:["setup"].concat(m),complete:function(){return K({command:"max",args:["build"].concat(m)})},exit:!1}):K({command:"umi",args:["build"].concat(m)});break;case"pre-commit":te();break;case"test":K({command:"umi-test",args:["--no-cache","--update-snapshot","--runInBand","--detectOpenHandles"].concat(m)});break;case"miniapp-upload":case"miniprogram-upload":if(G())if(W());else if(X());else{var b=ne(t),j=b.appid,S=b.options;R("".concat(j,"\u4e0a\u4f20\u5f00\u59cb")),y.upload(a(a({},o(S,["project","version","desc","setting","robot"])),{},{onProgressUpdate:function(e){if(r(e))R("task: ".concat(e));else{var t=e.status,n=e.message;R("task(".concat(t,"): ").concat(n))}}})).then((function(){Q("".concat(j,"\u4e0a\u4f20\u5b8c\u6210"))}))}break;case"miniapp-preview":case"miniprogram-preview":if(G())if(W());else if(X());else{var x=ne(t),P=x.appid,F=x.options;R("".concat(P,"\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb")),y.preview(a(a({},o(F,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"])),{},{onProgressUpdate:function(e){if(r(e))R("task: ".concat(e));else{var t=e.status,n=e.message;R("task(".concat(t,"): ").concat(n))}}})).then((function(){Q("".concat(P,"\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210"))}))}break;default:A()}})).parse(process.argv):A()};re();
@@ -1,13 +1,15 @@
1
1
  module.exports = {
2
- "printWidth": 80,
3
- "singleQuote": true,
4
- "trailingComma": "all",
5
- "proseWrap": "never",
6
- "overrides": [{
7
- "files": ".prettierrc",
8
- "options": {
9
- "parser": "json"
10
- }
11
- }],
2
+ printWidth: 80,
3
+ singleQuote: true,
4
+ trailingComma: 'all',
5
+ proseWrap: 'never',
6
+ overrides: [
7
+ {
8
+ files: '.prettierrc',
9
+ options: {
10
+ parser: 'json',
11
+ },
12
+ },
13
+ ],
12
14
  // "plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
13
- }
15
+ };
package/lib/yolk.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #! /usr/bin/env node
2
- var e=Object.create,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.getPrototypeOf,n=Object.prototype.hasOwnProperty,r=(e,i,r,o)=>{if(i&&"object"===typeof i||"function"===typeof i)for(let c of a(i))n.call(e,c)||c===r||t(e,c,{get:()=>i[c],enumerable:!(o=s(i,c))||o.enumerable});return e},o=(s,a,n)=>(n=null!=s?e(i(s)):{},r(!a&&s&&s.__esModule?n:t(n,"default",{value:s,enumerable:!0}),s)),c=require("child_process"),l=o(require("fs")),d=o(require("os")),u=o(require("path")),m=o(require("inquirer")),f=o(require("lodash")),p=o(require("miniprogram-ci")),y=o(require("ora")),g=o(require("../compiled/commander")),h=o(require("../compiled/glob")),b=o(require("../compiled/minimatch")),j=o(require("../compiled/mkdirp")),x=o(require("../compiled/mustache")),S=require("../compiled/prettier"),$=o(require("../compiled/rimraf")),v=o(require("../package.json")),k=require("../compiled/staged-git-files"),w=process.cwd(),q="##### CREATED BY YOLK #####",P={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},O="utf-8",F=20,B=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/.ice/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],E=(0,y.default)(),I=e=>e&&E.warn(Buffer.from(e,O).toString()),D=e=>e&&E.fail(Buffer.from(e,O).toString()),_=e=>e&&E.succeed(Buffer.from(e,O).toString()),N=e=>e&&E.info(Buffer.from(e,O).toString()),Q=e=>"win32"===process.platform?`${e}.cmd`:e,R=()=>{_("yolk complete!"),process.exit(0)},T=()=>{I("yolk break!"),process.exit(0)},K=({command:e,args:t,complete:s,close:a,exit:i=!0})=>{const n=(0,c.spawn)(Q(e),t||[],{stdio:"inherit"}).on("close",(e=>{e?(a&&a(),D("yolk close!"),process.exit(e)):(s&&s(),i&&R())}));process.on("SIGINT",(()=>{g.default.runningCommand&&g.default.runningCommand.kill("SIGKILL"),n.kill(),T()}))},L=(e,t,s)=>{m.default.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"web big screen template(umi framework)",value:"umi-web-screen"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"mobile HBuilderX h5+app template(umi framework)",value:"umi-mobile-h5+app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"web template(ice framework)",value:"ice-web"},{name:"web big screen template(ice framework)",value:"ice-web-screen"},{name:"mobile template(ice framework)",value:"ice-mobile"},{name:"mobile HBuilderX h5+app template(ice framework)",value:"ice-mobile-h5+app"},{name:"mobile native template(ice framework)",value:"ice-mobile-native"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:u.default.basename(u.default.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:"default",choices:[{name:"\u9ed8\u8ba4\u5b89\u88c5",value:"default"},{name:"\u8df3\u8fc7\u5b89\u88c5",value:!1},{name:"pnpm install",value:"pnpm"},{name:"yarn install",value:"yarn"},{name:"npm install",value:"npm"}]}]).then((a=>{const i={projectName:a.projectName,dependenciesInstallType:a.dependenciesInstallType,yolkVersion:v.default.version};t||(t=u.default.join(__dirname,`../templates/${a.type}`)),_(`\u590d\u5236\u6a21\u7248 ${u.default.basename(t)}`);const n=h.default.sync("**/*",{cwd:t,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(n.forEach((s=>{if(!t)return;const a=u.default.join(t,s);if(!l.default.statSync(a).isDirectory())if(s.endsWith(".tpl")){const t=l.default.readFileSync(a,O),n=u.default.join(e,s.replace(/\.tpl$/,"")),r=x.default.render(t,i);j.default.sync(u.default.dirname(n)),_(`\u521b\u5efa ${u.default.relative(e,n)}`),l.default.writeFileSync(n,r,O)}else{_(`\u521b\u5efa ${s}`);const t=u.default.join(e,s);j.default.sync(u.default.dirname(t)),l.default.copyFileSync(a,t)}})),_("\u590d\u5236\u6a21\u7248 success!"),s&&l.default.existsSync(t)&&(0,$.default)(t,(()=>{_(`\u7f13\u5b58\u5220\u9664 success! ${u.default.basename(t||"")}`)})),a.dependenciesInstallType)switch(_("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),a.dependenciesInstallType){case"default":case"pnpm":K({command:"pnpm",args:["install"]});break;case"yarn":K({command:"yarn",args:["install"]});break;case"npm":K({command:"npm",args:["install"]});break;default:}_("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},A=(e,t)=>L(e,t,!0),J=()=>{const e=h.default.sync("*.yolkrc*",{cwd:w,dot:!0});if(!e.length)return{};const t=u.default.join(w,e[0]);if(!l.default.existsSync(t))return{};try{return JSON.parse(l.default.readFileSync(t,O))||{}}catch(s){return D(s.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},C=()=>{const e=u.default.join(w,".prettierrc");if(l.default.existsSync(e))try{return JSON.parse(l.default.readFileSync(e,O))||{}}catch(t){return D(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return require("./.prettierrc")},H=()=>{const e=u.default.join(w,"project.config.json");if(!l.default.existsSync(e))return{};try{return JSON.parse(l.default.readFileSync(e,O))||{}}catch(t){return D(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},U=()=>{const e=u.default.join(w,"package.json");if(!l.default.existsSync(e))return{};try{return JSON.parse(l.default.readFileSync(e,O))||{}}catch(t){return D(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},M=()=>l.default.existsSync(u.default.join(w,"project.config.json")),V=()=>l.default.existsSync(u.default.join(w,".icerc.ts"))||l.default.existsSync(u.default.join(w,".icerc.js"))||l.default.existsSync(u.default.join(w,".ice.ts"))||l.default.existsSync(u.default.join(w,".ice.js")),G=()=>{let e=l.default.existsSync(u.default.join(w,"node_modules/.bin/max"));if(!e)try{e=l.default.existsSync(require.resolve("@umijs/max"))}catch(t){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test((0,c.execSync)("umi -v").toString())}catch(t){}if(!e){const s=u.default.join(w,"node_modules","umi","package.json");if(l.default.existsSync(s))try{const t=JSON.parse(l.default.readFileSync(s,O))||{};e=t.version&&+t.version.split(".")[0]>3}catch(t){}}return e},X=()=>l.default.existsSync(u.default.join(w,".icerc.ts"))?".icerc.ts":l.default.existsSync(u.default.join(w,".icerc.js"))?".icerc.js":l.default.existsSync(u.default.join(w,".ice.ts"))?".ice.ts":".ice.js",Y=()=>{const e=u.default.join(w,"project.config.json");if(l.default.existsSync(e)){const t=require(e);return t.appid}return""},W=()=>l.default.existsSync(u.default.join(w,"project.tt.json"))&&0===Y().indexOf("tt"),z=()=>0===Y().indexOf("20"),Z=()=>{const e=J();let t="";try{t=require.resolve("@baic/eslint-config-yolk")}catch(i){}const s=h.default.sync("*.eslintrc*",{cwd:w,dot:!0}),a=s[0];return!1===e.strict&&a&&l.default.existsSync(a)?a:l.default.existsSync(t)?t:a},ee=()=>{const e=J();let t="";try{t=require.resolve("@baic/stylelint-config-yolk")}catch(i){}const s=h.default.sync("*.stylelintrc*",{cwd:w,dot:!0}),a=s[0];return!1===e.strict&&a&&l.default.existsSync(a)?a:l.default.existsSync(t)?t:a},te=()=>{const e=u.default.join(w,".git/"),t=u.default.join(w,".git/hooks"),s=u.default.join(t,"pre-commit"),a=l.default.existsSync(e),i=l.default.existsSync(s),n=i&&l.default.readFileSync(s,O).includes(q);if(a&&(!i||!n)){j.default.sync(t),l.default.writeFileSync(s,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",q].join(d.default.EOL),O);try{l.default.chmodSync(s,"777")}catch(r){D(`chmod ${s} failed: ${r.message}`)}_("Create pre-commit hook")}},se=()=>{const e=J(),t=!1!==e.strict,s=e.eslintIgnore,a=e.stylelintIgnore;k().then((e=>{const i=s=>new Promise(((i,n)=>{const r=ee();if(r){const o=e.map((e=>e.filename)).filter((e=>/^(src|tests)/i.test(e))).filter((e=>({css:/\.cs{2}$/i,less:/\.les{2}$/i,sass:/\.sas{2}$/i,scss:/\.scs{2}$/i}[s].test(e)))).filter((e=>{const t=u.default.join(w,e);return l.default.existsSync(t)})).filter((e=>B.every((t=>!(0,b.default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof a?!(0,b.default)(e,a,{matchBase:!0}):a instanceof RegExp?!a.test(e):!Array.isArray(a)||a.every((t=>"string"===typeof t?!(0,b.default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(o.length)if(o.forEach((e=>{if(e&&l.default.existsSync(e)){const t=u.default.extname(e).replace(/^\./,""),s=l.default.readFileSync(e,O),a=(0,S.format)(s,{parser:P[t],...C()});l.default.writeFileSync(e,a,O)}})),_(`${s} - ${o.length} files prettier success!`),o.length>=F){const e=[];f.default.chunk(o,F).forEach((a=>{e.push(new Promise(((e,i)=>{K({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax",`postcss-${s}`,"--config",r,...a],complete:e,close:i,exit:!1})})))}));let a=0;const c=()=>{a<e.length?e[a].then((()=>{a++,c()})).catch(n):(_(`${s} - ${o.length} files stylelint success!`),i())};c()}else o.length&&K({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax",`postcss-${s}`,"--config",r,...o],complete:()=>{_(`${s} - ${o.length} files stylelint success!`),i()},close:n,exit:!1});else i()}else D(`\u6ca1\u6709 stylelintrc \u6587\u4ef6\uff0c${s} files prettier fail!`),i()})),n=a=>new Promise(((i,n)=>{const r=Z();if(r){const o=e.map((e=>e.filename)).filter((e=>/^(src|tests)/i.test(e))).filter((e=>({js:/\.js$/i,jsx:/\.jsx$/i,ts:/\.ts$/i,tsx:/\.tsx$/i}[a].test(e)))).filter((e=>{const t=u.default.join(w,e);return l.default.existsSync(t)})).filter((e=>B.every((t=>!(0,b.default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof s?!(0,b.default)(e,s,{matchBase:!0}):s instanceof RegExp?!s.test(e):!Array.isArray(s)||s.every((t=>"string"===typeof t?!(0,b.default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(o.length)if(o.forEach((e=>{if(e&&l.default.existsSync(e)){const t=u.default.extname(e).replace(/^\./,""),s=l.default.readFileSync(e,O),a=(0,S.format)(s,{parser:P[t],...C()});l.default.writeFileSync(e,a,O)}})),_(`${a} - ${o.length} files prettier success!`),o.length>=F){const e=[];f.default.chunk(o,F).forEach((s=>{e.push(new Promise(((e,a)=>{K({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",r,...s],complete:e,close:a,exit:!1})})))}));let s=0;const c=()=>{s<e.length?e[s].then((()=>{s++,c()})).catch(n):(_(`${a} - ${o.length} files eslint success!`),i())};c()}else o.length&&K({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",r,...o],complete:()=>{_(`${a} - ${o.length} files eslint success!`),i()},close:n,exit:!1});else i()}else D(`\u6ca1\u6709 eslintrc \u6587\u4ef6\uff0c${a} files eslint fail!`),i()}));I("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),t&&(I("git commit \u7981\u6b62 lint \u7684 ignore \u884c\u4e3a"),a&&I(`\u901a\u8fc7 .yolkrc \u914d\u7f6e stylelintIgnore: ${a}\u3002`),s&&I(`\u901a\u8fc7 .yolkrc \u914d\u7f6e eslintIgnore: ${s}\u3002`)),i("css").then((()=>i("less"))).then((()=>i("sass"))).then((()=>i("scss"))).then((()=>n("js"))).then((()=>n("jsx"))).then((()=>n("ts"))).then((()=>n("tsx"))).then(R).catch(R)}))},ae=({mProject:e,mPrivateKeyPath:t,mVersion:s,mDesc:a,mRobot:i,mQrcodeFormat:n,mQrcodeOutputDest:r,mPagePath:o,mSearchQuery:d})=>{const m=l.default.existsSync(u.default.join(w,".git"))?(0,c.execSync)("git log -1 --pretty=format:%H").toString():"",f=H(),y=f.appid,g=e||u.default.join(w,"dist"),h=t||u.default.join(w,`private.${y}.key`);if(l.default.existsSync(g)){if(l.default.existsSync(h)){const e=U(),t=s||e.version||f.version||"1.0.0",c=a||e.description||f.description,l=`version: ${t};${m?` commit: ${m};`:""}${c?` description: ${c};`:""}`;m&&N(`commit: ${m}`),N(`dist: ${g}`),N(`key: ${h}`),N(`appid: ${y}`),N(`version: ${t}`),N(`desc: ${l}`);const u=new p.Project({appid:y,type:"miniProgram",projectPath:g,privateKeyPath:h,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:y,options:{project:u,version:t,desc:l,setting:f.setting,robot:i,qrcodeFormat:n,qrcodeOutputDest:r,pagePath:o,searchQuery:d}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${h})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${g})`)},ie=()=>{te(),process.argv.length>2?g.default.version(v.default.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]").option("--clone","\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248").option("--template <template>","\u6a21\u7248\u540d\u79f0\u6216\u8005clone\u6a21\u5f0f\u7684git\u5730\u5740").option("--docs","\u542f\u52a8\u6587\u6863\u6a21\u5f0f").option("--mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6").option("--mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--mQrcodeFormat <qrcodeFormat>",'\u5c0f\u7a0b\u5e8f\u9884\u89c8\u8fd4\u56de\u4e8c\u7ef4\u7801\u6587\u4ef6\u7684\u683c\u5f0f "image" \u6216 "base64"\uff0c \u9ed8\u8ba4\u503c "terminal" \u4f9b\u8c03\u8bd5\u7528').option("--mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570").action(((e,t)=>{const[s,...a]=t,{clone:i,template:n,docs:r}=e;if(s)switch(N(`yolk version: ${v.default.version}`),N(`node version: ${process.version}`),N(`platform: ${d.default.platform()}`),N(`memory: ${f.default.floor(d.default.freemem()/1024/1024)} MB(${f.default.floor(d.default.totalmem()/1024/1024)} MB)`),s){case"init":if(_(`yolk ${s} \u5f00\u59cb`),i)if(n){const e=".yolk",t=u.default.join(w,e);l.default.existsSync(t)&&(0,$.default)(t,(()=>{_(`\u7f13\u5b58\u5220\u9664 success! ${t}`)})),K({command:"git",args:["clone","-b","master","--depth","1",n,e].concat(a)}),A(w,t)}else D("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else L(w);break;case"start":M()?W()?K({command:"taro",args:["build","--type","tt","--watch"].concat(a)}):z()?K({command:"taro",args:["build","--type","alipay","--watch"].concat(a)}):K({command:"taro",args:["build","--type","weapp","--watch"].concat(a)}):r?K({command:"dumi",args:["dev"].concat(a)}):V()?K({command:"icejs",args:["start","--config",X()].concat(a)}):G()?K({command:"max",args:["dev"].concat(a)}):K({command:"umi",args:["dev"].concat(a)});break;case"build":M()?W()?K({command:"taro",args:["build","--type","tt"].concat(a)}):z()?K({command:"taro",args:["build","--type","alipay"].concat(a)}):K({command:"taro",args:["build","--type","weapp"].concat(a)}):r?K({command:"dumi",args:["build"].concat(a)}):V()?K({command:"icejs",args:["build","--config",X()].concat(a)}):G()?K({command:"max",args:["setup"].concat(a),complete:()=>K({command:"max",args:["build"].concat(a)}),exit:!1}):K({command:"umi",args:["build"].concat(a)});break;case"pre-commit":se();break;case"test":K({command:"umi-test",args:["--no-cache","--update-snapshot","--runInBand","--detectOpenHandles"].concat(a)});break;case"miniapp-upload":case"miniprogram-upload":if(M())if(W());else if(z());else{const{appid:t,options:s}=ae(e);N(`${t}\u4e0a\u4f20\u5f00\u59cb`),p.upload({...f.default.pick(s,["project","version","desc","setting","robot"]),onProgressUpdate:e=>{if(f.default.isString(e))N(`task: ${e}`);else{const{status:t,message:s}=e;N(`task(${t}): ${s}`)}}}).then((()=>{_(`${t}\u4e0a\u4f20\u5b8c\u6210`)}))}break;case"miniapp-preview":case"miniprogram-preview":if(M())if(W());else if(z());else{const{appid:t,options:s}=ae(e);N(`${t}\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),p.preview({...f.default.pick(s,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"]),onProgressUpdate:e=>{if(f.default.isString(e))N(`task: ${e}`);else{const{status:t,message:s}=e;N(`task(${t}): ${s}`)}}}).then((()=>{_(`${t}\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}break;default:T()}})).parse(process.argv):T()};ie();
2
+ var e=Object.create,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,n=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,r=(e,n,r,o)=>{if(n&&"object"===typeof n||"function"===typeof n)for(let c of a(n))i.call(e,c)||c===r||t(e,c,{get:()=>n[c],enumerable:!(o=s(n,c))||o.enumerable});return e},o=(s,a,i)=>(i=null!=s?e(n(s)):{},r(!a&&s&&s.__esModule?i:t(i,"default",{value:s,enumerable:!0}),s)),c=require("child_process"),l=o(require("fs")),d=o(require("os")),u=o(require("path")),m=o(require("inquirer")),f=o(require("lodash")),p=o(require("miniprogram-ci")),y=o(require("ora")),g=o(require("../compiled/commander")),h=o(require("../compiled/glob")),$=o(require("../compiled/minimatch")),b=o(require("../compiled/mkdirp")),x=o(require("../compiled/mustache")),S=require("../compiled/prettier"),j=o(require("../compiled/rimraf")),v=o(require("../package.json")),k=require("../compiled/staged-git-files"),w=process.cwd(),q="##### CREATED BY YOLK #####",P={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},O="utf-8",F=20,E=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],B=(0,y.default)(),I=e=>e&&B.warn(Buffer.from(e,O).toString()),D=e=>e&&B.fail(Buffer.from(e,O).toString()),_=e=>e&&B.succeed(Buffer.from(e,O).toString()),N=e=>e&&B.info(Buffer.from(e,O).toString()),Q=e=>"win32"===process.platform?`${e}.cmd`:e,R=()=>{_("yolk complete!"),process.exit(0)},T=()=>{I("yolk break!"),process.exit(0)},K=({command:e,args:t,complete:s,close:a,exit:n=!0})=>{const i=(0,c.spawn)(Q(e),t||[],{stdio:"inherit"}).on("close",(e=>{e?(a&&a(),D("yolk close!"),process.exit(e)):(s&&s(),n&&R())}));process.on("SIGINT",(()=>{g.default.runningCommand&&g.default.runningCommand.kill("SIGKILL"),i.kill(),T()}))},L=(e,t,s)=>{m.default.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"web big screen template(umi framework)",value:"umi-web-screen"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"mobile HBuilderX h5+app template(umi framework)",value:"umi-mobile-h5+app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:u.default.basename(u.default.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:"default",choices:[{name:"\u9ed8\u8ba4\u5b89\u88c5",value:"default"},{name:"\u8df3\u8fc7\u5b89\u88c5",value:!1},{name:"pnpm install",value:"pnpm"},{name:"yarn install",value:"yarn"},{name:"npm install",value:"npm"}]}]).then((a=>{const n={projectName:a.projectName,dependenciesInstallType:a.dependenciesInstallType,yolkVersion:v.default.version},i=t||u.default.join(__dirname,`../templates/${a.type}`);_(`\u590d\u5236\u6a21\u7248 ${u.default.basename(i)}`);const r=h.default.sync("**/*",{cwd:i,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(r.forEach((t=>{if(!i)return;const s=u.default.join(i,t);if(!l.default.statSync(s).isDirectory())if(t.endsWith(".tpl")){const a=l.default.readFileSync(s,O),i=u.default.join(e,t.replace(/\.tpl$/,"")),r=x.default.render(a,n);b.default.sync(u.default.dirname(i)),_(`\u521b\u5efa ${u.default.relative(e,i)}`),l.default.writeFileSync(i,r,O)}else{_(`\u521b\u5efa ${t}`);const a=u.default.join(e,t);b.default.sync(u.default.dirname(a)),l.default.copyFileSync(s,a)}})),_("\u590d\u5236\u6a21\u7248 success!"),s&&l.default.existsSync(i)&&(0,j.default)(i,(()=>{_(`\u7f13\u5b58\u5220\u9664 success! ${u.default.basename(i||"")}`)})),a.dependenciesInstallType)switch(_("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),a.dependenciesInstallType){case"default":case"pnpm":K({command:"pnpm",args:["install"]});break;case"yarn":K({command:"yarn",args:["install"]});break;case"npm":K({command:"npm",args:["install"]});break;default:}_("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},A=(e,t)=>L(e,t,!0),J=()=>{const e=h.default.sync("*.yolkrc*",{cwd:w,dot:!0});if(!e.length)return{};const t=u.default.join(w,e[0]);if(!l.default.existsSync(t))return{};try{return JSON.parse(l.default.readFileSync(t,O))||{}}catch(s){return D(s.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},C=()=>{const e=u.default.join(w,".prettierrc");if(l.default.existsSync(e))try{return JSON.parse(l.default.readFileSync(e,O))||{}}catch(t){return D(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return require("./.prettierrc")},U=()=>{const e=u.default.join(w,"project.config.json");if(!l.default.existsSync(e))return{};try{return JSON.parse(l.default.readFileSync(e,O))||{}}catch(t){return D(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},H=()=>{const e=u.default.join(w,"package.json");if(!l.default.existsSync(e))return{};try{return JSON.parse(l.default.readFileSync(e,O))||{}}catch(t){return D(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},M=()=>l.default.existsSync(u.default.join(w,"project.config.json")),V=()=>{let e=l.default.existsSync(u.default.join(w,"node_modules/.bin/max"));if(!e)try{e=l.default.existsSync(require.resolve("@umijs/max"))}catch(t){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test((0,c.execSync)("umi -v").toString())}catch(t){}if(!e){const s=u.default.join(w,"node_modules","umi","package.json");if(l.default.existsSync(s))try{const t=JSON.parse(l.default.readFileSync(s,O))||{};e=t.version&&+t.version.split(".")[0]>3}catch(t){}}return e},G=()=>{const e=u.default.join(w,"project.config.json");if(l.default.existsSync(e)){const t=require(e);return t.appid}return""},Y=()=>l.default.existsSync(u.default.join(w,"project.tt.json"))&&0===G().indexOf("tt"),W=()=>0===G().indexOf("20"),X=()=>{const e=J();let t="";try{t=require.resolve("@baic/eslint-config-yolk")}catch(n){}const s=h.default.sync("*.eslintrc*",{cwd:w,dot:!0}),a=s[0];return!1===e.strict&&a&&l.default.existsSync(a)?a:l.default.existsSync(t)?t:a},z=()=>{const e=J();let t="";try{t=require.resolve("@baic/stylelint-config-yolk")}catch(n){}const s=h.default.sync("*.stylelintrc*",{cwd:w,dot:!0}),a=s[0];return!1===e.strict&&a&&l.default.existsSync(a)?a:l.default.existsSync(t)?t:a},Z=()=>{const e=u.default.join(w,".git/"),t=u.default.join(w,".git/hooks"),s=u.default.join(t,"pre-commit"),a=l.default.existsSync(e),n=l.default.existsSync(s),i=n&&l.default.readFileSync(s,O).includes(q);if(a&&(!n||!i)){b.default.sync(t),l.default.writeFileSync(s,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",q].join(d.default.EOL),O);try{l.default.chmodSync(s,"777")}catch(r){D(`chmod ${s} failed: ${r.message}`)}_("Create pre-commit hook")}},ee=()=>{const e=J(),t=!1!==e.strict,s=e.eslintIgnore,a=e.stylelintIgnore;k().then((e=>{const n=s=>new Promise(((n,i)=>{const r=z();if(r){const o=e.map((e=>e.filename)).filter((e=>/^(src|tests)/i.test(e))).filter((e=>({css:/\.cs{2}$/i,less:/\.les{2}$/i,sass:/\.sas{2}$/i,scss:/\.scs{2}$/i}[s].test(e)))).filter((e=>{const t=u.default.join(w,e);return l.default.existsSync(t)})).filter((e=>E.every((t=>!(0,$.default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof a?!(0,$.default)(e,a,{matchBase:!0}):a instanceof RegExp?!a.test(e):!Array.isArray(a)||a.every((t=>"string"===typeof t?!(0,$.default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(o.length)if(o.forEach((e=>{if(e&&l.default.existsSync(e)){const t=u.default.extname(e).replace(/^\./,""),s=l.default.readFileSync(e,O),a=(0,S.format)(s,{parser:P[t],...C()});l.default.writeFileSync(e,a,O)}})),_(`${s} - ${o.length} files prettier success!`),o.length>=F){const e=[];f.default.chunk(o,F).forEach((a=>{e.push(new Promise(((e,n)=>{K({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax",`postcss-${s}`,"--config",r,...a],complete:e,close:n,exit:!1})})))}));let a=0;const c=()=>{a<e.length?e[a].then((()=>{a++,c()})).catch(i):(_(`${s} - ${o.length} files stylelint success!`),n())};c()}else o.length&&K({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax",`postcss-${s}`,"--config",r,...o],complete:()=>{_(`${s} - ${o.length} files stylelint success!`),n()},close:i,exit:!1});else n()}else D(`\u6ca1\u6709 stylelintrc \u6587\u4ef6\uff0c${s} files prettier fail!`),n()})),i=a=>new Promise(((n,i)=>{const r=X();if(r){const o=e.map((e=>e.filename)).filter((e=>/^(src|tests)/i.test(e))).filter((e=>({js:/\.js$/i,jsx:/\.jsx$/i,ts:/\.ts$/i,tsx:/\.tsx$/i}[a].test(e)))).filter((e=>{const t=u.default.join(w,e);return l.default.existsSync(t)})).filter((e=>E.every((t=>!(0,$.default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof s?!(0,$.default)(e,s,{matchBase:!0}):s instanceof RegExp?!s.test(e):!Array.isArray(s)||s.every((t=>"string"===typeof t?!(0,$.default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(o.length)if(o.forEach((e=>{if(e&&l.default.existsSync(e)){const t=u.default.extname(e).replace(/^\./,""),s=l.default.readFileSync(e,O),a=(0,S.format)(s,{parser:P[t],...C()});l.default.writeFileSync(e,a,O)}})),_(`${a} - ${o.length} files prettier success!`),o.length>=F){const e=[];f.default.chunk(o,F).forEach((s=>{e.push(new Promise(((e,a)=>{K({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",r,...s],complete:e,close:a,exit:!1})})))}));let s=0;const c=()=>{s<e.length?e[s].then((()=>{s++,c()})).catch(i):(_(`${a} - ${o.length} files eslint success!`),n())};c()}else o.length&&K({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",r,...o],complete:()=>{_(`${a} - ${o.length} files eslint success!`),n()},close:i,exit:!1});else n()}else D(`\u6ca1\u6709 eslintrc \u6587\u4ef6\uff0c${a} files eslint fail!`),n()}));I("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),t&&(I("git commit \u7981\u6b62 lint \u7684 ignore \u884c\u4e3a"),a&&I(`\u901a\u8fc7 .yolkrc \u914d\u7f6e stylelintIgnore: ${a}\u3002`),s&&I(`\u901a\u8fc7 .yolkrc \u914d\u7f6e eslintIgnore: ${s}\u3002`)),n("css").then((()=>n("less"))).then((()=>n("sass"))).then((()=>n("scss"))).then((()=>i("js"))).then((()=>i("jsx"))).then((()=>i("ts"))).then((()=>i("tsx"))).then(R).catch(R)}))},te=({mProject:e,mPrivateKeyPath:t,mVersion:s,mDesc:a,mRobot:n,mQrcodeFormat:i,mQrcodeOutputDest:r,mPagePath:o,mSearchQuery:d})=>{const m=l.default.existsSync(u.default.join(w,".git"))?(0,c.execSync)("git log -1 --pretty=format:%H").toString():"",f=U(),y=f.appid,g=e||u.default.join(w,"dist"),h=t||u.default.join(w,`private.${y}.key`);if(l.default.existsSync(g)){if(l.default.existsSync(h)){const e=H(),t=s||e.version||f.version||"1.0.0",c=a||e.description||f.description,l=`version: ${t};${m?` commit: ${m};`:""}${c?` description: ${c};`:""}`;m&&N(`commit: ${m}`),N(`dist: ${g}`),N(`key: ${h}`),N(`appid: ${y}`),N(`version: ${t}`),N(`desc: ${l}`);const u=new p.Project({appid:y,type:"miniProgram",projectPath:g,privateKeyPath:h,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:y,options:{project:u,version:t,desc:l,setting:f.setting,robot:n,qrcodeFormat:i,qrcodeOutputDest:r,pagePath:o,searchQuery:d}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${h})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${g})`)},se=()=>{Z(),process.argv.length>2?g.default.version(v.default.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]").option("--clone","\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248").option("--template <template>","\u6a21\u7248\u540d\u79f0\u6216\u8005clone\u6a21\u5f0f\u7684git\u5730\u5740").option("--docs","\u542f\u52a8\u6587\u6863\u6a21\u5f0f").option("--mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6").option("--mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--mQrcodeFormat <qrcodeFormat>",'\u5c0f\u7a0b\u5e8f\u9884\u89c8\u8fd4\u56de\u4e8c\u7ef4\u7801\u6587\u4ef6\u7684\u683c\u5f0f "image" \u6216 "base64"\uff0c \u9ed8\u8ba4\u503c "terminal" \u4f9b\u8c03\u8bd5\u7528').option("--mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570").action(((e,t)=>{const[s,...a]=t,{clone:n,template:i,docs:r}=e;if(s)switch(N(`yolk version: ${v.default.version}`),N(`node version: ${process.version}`),N(`platform: ${d.default.platform()}`),N(`memory: ${f.default.floor(d.default.freemem()/1024/1024)} MB(${f.default.floor(d.default.totalmem()/1024/1024)} MB)`),s){case"init":if(_(`yolk ${s} \u5f00\u59cb`),n)if(i){const e=".yolk",t=u.default.join(w,e);l.default.existsSync(t)&&(0,j.default)(t,(()=>{_(`\u7f13\u5b58\u5220\u9664 success! ${t}`)})),K({command:"git",args:["clone","-b","master","--depth","1",i,e].concat(a)}),A(w,t)}else D("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else L(w);break;case"start":M()?Y()?K({command:"taro",args:["build","--type","tt","--watch"].concat(a)}):W()?K({command:"taro",args:["build","--type","alipay","--watch"].concat(a)}):K({command:"taro",args:["build","--type","weapp","--watch"].concat(a)}):r?K({command:"dumi",args:["dev"].concat(a)}):V()?K({command:"max",args:["dev"].concat(a)}):K({command:"umi",args:["dev"].concat(a)});break;case"build":M()?Y()?K({command:"taro",args:["build","--type","tt"].concat(a)}):W()?K({command:"taro",args:["build","--type","alipay"].concat(a)}):K({command:"taro",args:["build","--type","weapp"].concat(a)}):r?K({command:"dumi",args:["build"].concat(a)}):V()?K({command:"max",args:["setup"].concat(a),complete:()=>K({command:"max",args:["build"].concat(a)}),exit:!1}):K({command:"umi",args:["build"].concat(a)});break;case"pre-commit":ee();break;case"test":K({command:"umi-test",args:["--no-cache","--update-snapshot","--runInBand","--detectOpenHandles"].concat(a)});break;case"miniapp-upload":case"miniprogram-upload":if(M())if(Y());else if(W());else{const{appid:t,options:s}=te(e);N(`${t}\u4e0a\u4f20\u5f00\u59cb`),p.upload({...f.default.pick(s,["project","version","desc","setting","robot"]),onProgressUpdate:e=>{if(f.default.isString(e))N(`task: ${e}`);else{const{status:t,message:s}=e;N(`task(${t}): ${s}`)}}}).then((()=>{_(`${t}\u4e0a\u4f20\u5b8c\u6210`)}))}break;case"miniapp-preview":case"miniprogram-preview":if(M())if(Y());else if(W());else{const{appid:t,options:s}=te(e);N(`${t}\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),p.preview({...f.default.pick(s,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"]),onProgressUpdate:e=>{if(f.default.isString(e))N(`task: ${e}`);else{const{status:t,message:s}=e;N(`task(${t}): ${s}`)}}}).then((()=>{_(`${t}\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}break;default:T()}})).parse(process.argv):T()};se();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baic/yolk-cli",
3
- "version": "2.1.0-alpha.72",
3
+ "version": "2.1.0-alpha.74",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/303394539/yolk.git"
@@ -25,12 +25,13 @@
25
25
  "prebundle": "father prebundle"
26
26
  },
27
27
  "dependencies": {
28
+ "@babel/runtime": "~7.x",
28
29
  "@types/inquirer": "~8.x",
29
30
  "@types/lodash": "~4.x",
30
31
  "@types/prettier": "~2.x",
31
32
  "inquirer": "~8.x",
32
33
  "lodash": "~4.x",
33
- "miniprogram-ci": "~1.8.x",
34
+ "miniprogram-ci": "~1.9.x",
34
35
  "ora": "5.4.1",
35
36
  "prettier": "~2.x",
36
37
  "v8-compile-cache": "~2.3.x"
@@ -52,5 +53,5 @@
52
53
  "publishConfig": {
53
54
  "access": "public"
54
55
  },
55
- "gitHead": "94e28925e66e2c627afff61be481ca6d2e9e326b"
56
+ "gitHead": "e83a62397af18b4e68e1026c5cf7dba8d502fc2f"
56
57
  }
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "@baic/eslint-config-yolk",
3
- "parserOptions": {
4
- "project": "./tsconfig.json"
5
- }
6
- }
@@ -1,37 +0,0 @@
1
- # See https://help.github.com/ignore-files/ for more about ignoring files.
2
-
3
- # dependencies
4
- node_modules/
5
- npm-debug.log*
6
- npm-error.log*
7
- package-lock.json
8
- yarn.lock
9
- yarn-debug.log*
10
- yarn-error.log*
11
- pnpm-lock.yaml
12
-
13
- # production
14
- build/
15
- dist/
16
- tmp/
17
- lib/
18
-
19
- # misc
20
- .idea/
21
- .happypack
22
- .DS_Store
23
- *.swp
24
- *.dia~
25
- .ice
26
-
27
- # ide
28
- .vscode
29
-
30
- *less.d.ts*
31
- *scss.d.ts*
32
- .eslintcache
33
- .stylelintcache
34
-
35
- # h5+app
36
- /h5+app/unpackage/cache
37
- /h5+app/unpackage/release
@@ -1,3 +0,0 @@
1
- import { defineConfig } from '@baic/yolk-ice';
2
-
3
- export default defineConfig({ hd: {} });
@@ -1,2 +0,0 @@
1
- strict-peer-dependencies=false
2
- shamefully-hoist=true
@@ -1,8 +0,0 @@
1
- build/
2
- .ice/
3
- coverage/
4
- package-lock.json
5
- yarn.lock
6
- yarn-debug.log
7
- yarn-error.log
8
- pnpm-lock.yaml
@@ -1 +0,0 @@
1
- module.exports = require('@baic/yolk-cli/lib/.prettierrc');
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "@baic/stylelint-config-yolk"
3
- }
@@ -1,34 +0,0 @@
1
- # web
2
-
3
- ## Getting Started
4
-
5
- Install dependencies,
6
-
7
- {{ #dependenciesInstallType }}
8
-
9
- ```bash
10
- $ {{ dependenciesInstallType }} install
11
- ```
12
-
13
- {{ /dependenciesInstallType }}
14
- {{ ^dependenciesInstallType }}
15
-
16
- ```bash
17
- $ pnpm install
18
- ```
19
-
20
- {{ /dependenciesInstallType }}
21
-
22
- Start the dev server,
23
-
24
- ```bash
25
- $ npm start
26
- ```
27
-
28
- Build,
29
-
30
- ```bash
31
- $ npm run build
32
- ```
33
-
34
- [查阅文档](https://303394539.github.io/yolk-docs/)
@@ -1,16 +0,0 @@
1
- {
2
- "private": true,
3
- "name": "{{ projectName }}",
4
- "scripts": {
5
- "start": "yolk start",
6
- "build": "yolk build"
7
- },
8
- "dependencies": {
9
- "@baic/preset-yolk-ice-mobile": "~{{ yolkVersion }}"
10
- },
11
- "pnpm": {
12
- "peerDependencyRules": {
13
- "ignoreMissing": "*"
14
- }
15
- }
16
- }
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="x-ua-compatible" content="IE=edge,chrome=1" />
6
- <meta name="renderer" content="webkit" />
7
- <meta name="format-detection" content="telephone=no" />
8
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
9
- <title></title>
10
- </head>
11
-
12
- <body>
13
- <div id="yolk-app"></div>
14
- </body>
15
- </html>
@@ -1,5 +0,0 @@
1
- import { runApp } from 'ice';
2
-
3
- import '@baic/yolk-mobile/es/style/index.less';
4
-
5
- runApp();
@@ -1,3 +0,0 @@
1
- import { Request } from '@baic/yolk-mobile';
2
-
3
- export default new Request();
@@ -1,7 +0,0 @@
1
- import { Util } from '@baic/yolk-mobile';
2
-
3
- const util = {
4
- ...Util,
5
- };
6
-
7
- export default util;
File without changes
@@ -1,3 +0,0 @@
1
- #yolk-app {
2
- height: 100%;
3
- }
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
-
3
- export default ({ children }: { children?: React.ReactNode }) => (
4
- <>{children}</>
5
- );
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- import { Result } from 'antd-mobile';
3
-
4
- export default () => (
5
- <Result
6
- title="404"
7
- description="对不起,您访问的页面不存在。"
8
- status="warning"
9
- />
10
- );
@@ -1,4 +0,0 @@
1
- import * as React from 'react';
2
- import { BarCode } from '@baic/yolk-mobile';
3
-
4
- export default () => <BarCode value="https://www.baidu.com" />;
@@ -1,18 +0,0 @@
1
- import * as React from 'react';
2
- import { Provider, Iconfont } from '@baic/yolk-mobile';
3
-
4
- export default () => {
5
- return (
6
- <Provider
7
- iconfontScriptUrl={[
8
- '//at.alicdn.com/t/font_1788044_0dwu4guekcwr.js',
9
- '//at.alicdn.com/t/font_1788592_a5xf2bdic3u.js',
10
- ]}
11
- >
12
- <Iconfont type="icon-javascript" />
13
- <Iconfont type="icon-java" />
14
- <Iconfont type="icon-shoppingcart" />
15
- <Iconfont type="icon-python" />
16
- </Provider>
17
- );
18
- };
@@ -1,16 +0,0 @@
1
- import * as React from 'react';
2
- import { Form, Input, useForm } from '@baic/yolk-mobile';
3
-
4
- export default () => {
5
- const [form] = useForm();
6
- const { createFormItem } = form;
7
- return (
8
- <Form form={form}>
9
- {createFormItem({
10
- label: 'Input',
11
- name: 'Input',
12
- rules: 'required',
13
- })(<Input maxLength={5} />)}
14
- </Form>
15
- );
16
- };
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import { List } from '@baic/yolk-mobile';
3
-
4
- export default () => {
5
- return (
6
- <List header='基础用法'>
7
- <List.Item>1</List.Item>
8
- <List.Item>2</List.Item>
9
- <List.Item>3</List.Item>
10
- </List>
11
- );
12
- };
@@ -1,29 +0,0 @@
1
- import * as React from 'react';
2
- import { Image } from 'antd-mobile';
3
- import { List } from '@baic/yolk-mobile';
4
-
5
- import mock from './mock';
6
-
7
- export default () => {
8
- return (
9
- <List header="函数渲染" data={mock}>
10
- {({ name, avatar, description }) => (
11
- <List.Item
12
- key={name}
13
- prefix={
14
- <Image
15
- src={avatar}
16
- style={{ borderRadius: 20 }}
17
- fit="cover"
18
- width={40}
19
- height={40}
20
- />
21
- }
22
- description={description}
23
- >
24
- {name}
25
- </List.Item>
26
- )}
27
- </List>
28
- );
29
- };
@@ -1,29 +0,0 @@
1
- import * as React from 'react';
2
- import { Image } from 'antd-mobile';
3
- import { List } from '@baic/yolk-mobile';
4
-
5
- import mock from './mock';
6
-
7
- export default () => {
8
- return (
9
- <List header="拖拽" drag data={mock}>
10
- {({ name, avatar, description }) => (
11
- <List.Item
12
- key={name}
13
- prefix={
14
- <Image
15
- src={avatar}
16
- style={{ borderRadius: 20 }}
17
- fit="cover"
18
- width={40}
19
- height={40}
20
- />
21
- }
22
- description={description}
23
- >
24
- {name}
25
- </List.Item>
26
- )}
27
- </List>
28
- );
29
- };