@baic/yolk-cli 2.1.0-alpha.25 → 2.1.0-alpha.250

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 (618) hide show
  1. package/LICENSE +18 -17
  2. package/README.md +1 -1
  3. package/compiled/commander/index.d.ts +898 -0
  4. package/compiled/commander/index.js +1 -0
  5. package/compiled/commander/package.json +1 -0
  6. package/compiled/mustache/index.d.ts +431 -0
  7. package/compiled/mustache/index.js +5 -0
  8. package/compiled/mustache/package.json +1 -0
  9. package/es/_util.d.ts +31 -0
  10. package/es/_util.js +1 -0
  11. package/es/lintstagedrc.js +1 -0
  12. package/es/yolk.js +1 -1
  13. package/lib/_util.d.ts +31 -0
  14. package/lib/_util.js +1 -0
  15. package/lib/lintstagedrc.js +1 -0
  16. package/lib/yolk.js +1 -1
  17. package/package.json +48 -27
  18. package/templates/taro-miniprogram/.eslintignore +4 -0
  19. package/templates/taro-miniprogram/.eslintrc.js +8 -0
  20. package/templates/{miniprogram → taro-miniprogram}/.gitignore.tpl +7 -6
  21. package/templates/taro-miniprogram/.prettierignore +9 -0
  22. package/templates/taro-miniprogram/.prettierrc.js +2 -0
  23. package/templates/taro-miniprogram/.stylelintignore +4 -0
  24. package/templates/taro-miniprogram/.stylelintrc.js +4 -0
  25. package/templates/taro-miniprogram/LICENSE +22 -0
  26. package/templates/{ice-mobile-h5+app → taro-miniprogram}/README.md.tpl +5 -5
  27. package/templates/taro-miniprogram/biome.json +3 -0
  28. package/templates/{miniprogram → taro-miniprogram}/config/index.ts.tpl +1 -1
  29. package/templates/taro-miniprogram/global.d.ts +1 -0
  30. package/templates/{miniprogram → taro-miniprogram}/package.json.tpl +4 -0
  31. package/templates/{miniprogram → taro-miniprogram}/project.config.json.tpl +4 -2
  32. package/templates/{miniprogram → taro-miniprogram}/src/app.config.ts +1 -1
  33. package/templates/taro-miniprogram/src/app.scss +1 -0
  34. package/templates/{miniprogram → taro-miniprogram}/src/app.tsx +4 -6
  35. package/templates/taro-miniprogram/src/constants.ts +1 -0
  36. package/templates/taro-miniprogram/src/pages/demo/examples/Input.tsx +11 -0
  37. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/examples/MobileInput.tsx +0 -1
  38. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/examples/MoneyInput.tsx +0 -1
  39. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/examples/NumberInput.tsx +0 -1
  40. package/templates/taro-miniprogram/src/pages/demo/examples/Textarea.tsx +12 -0
  41. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/examples/TimerButton.tsx +0 -1
  42. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/examples/usePreload.tsx +0 -1
  43. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/index.config.ts +1 -1
  44. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/index.tsx +6 -5
  45. package/templates/{miniprogram → taro-miniprogram}/src/pages/index/index.config.ts +1 -1
  46. package/templates/{miniprogram → taro-miniprogram}/src/pages/index/index.tsx +1 -1
  47. package/templates/taro-miniprogram/src/types/user.d.ts +5 -0
  48. package/templates/taro-miniprogram/tsconfig.json +11 -0
  49. package/templates/umi-mobile/.eslintignore +6 -0
  50. package/templates/umi-mobile/.eslintrc.js +8 -0
  51. package/templates/umi-mobile/.gitignore.tpl +4 -7
  52. package/templates/umi-mobile/.prettierignore +6 -2
  53. package/templates/umi-mobile/.prettierrc.js +2 -0
  54. package/templates/umi-mobile/.stylelintignore +6 -0
  55. package/templates/umi-mobile/.stylelintrc.js +4 -0
  56. package/templates/umi-mobile/.umirc.ts.tpl +0 -1
  57. package/templates/umi-mobile/LICENSE +18 -17
  58. package/templates/umi-mobile/README.md.tpl +5 -5
  59. package/templates/umi-mobile/biome.json +3 -0
  60. package/templates/umi-mobile/package.json.tpl +6 -0
  61. package/templates/umi-mobile/src/app.tsx +2 -3
  62. package/templates/umi-mobile/src/pages/404.tsx +0 -1
  63. package/templates/umi-mobile/src/pages/demo/examples/BarCode.tsx +0 -1
  64. package/templates/umi-mobile/src/pages/demo/examples/Iconfont.tsx +1 -2
  65. package/templates/umi-mobile/src/pages/demo/examples/Input.tsx +1 -3
  66. package/templates/umi-mobile/src/pages/demo/examples/List/1.tsx +1 -2
  67. package/templates/umi-mobile/src/pages/demo/examples/List/2.tsx +1 -1
  68. package/templates/umi-mobile/src/pages/demo/examples/List/3.tsx +1 -1
  69. package/templates/umi-mobile/src/pages/demo/examples/List/4.tsx +12 -13
  70. package/templates/umi-mobile/src/pages/demo/examples/Loading.tsx +0 -1
  71. package/templates/umi-mobile/src/pages/demo/examples/NumberInput/1.tsx +1 -3
  72. package/templates/umi-mobile/src/pages/demo/examples/NumberInput/2.tsx +1 -3
  73. package/templates/umi-mobile/src/pages/demo/examples/NumberInput/3.tsx +1 -3
  74. package/templates/umi-mobile/src/pages/demo/examples/NumberInput/4.tsx +1 -3
  75. package/templates/umi-mobile/src/pages/demo/examples/PagingList/1.tsx +1 -2
  76. package/templates/umi-mobile/src/pages/demo/examples/QrCode.tsx +0 -1
  77. package/templates/umi-mobile/src/pages/demo/examples/Required.tsx +0 -1
  78. package/templates/umi-mobile/src/pages/demo/examples/TimerButton.tsx +0 -1
  79. package/templates/umi-mobile/src/pages/demo/examples/usePreload.tsx +1 -1
  80. package/templates/umi-mobile/src/pages/demo/index.tsx +10 -10
  81. package/templates/umi-mobile/src/pages/index.tsx +0 -2
  82. package/templates/umi-mobile/src/types/user.d.ts +2 -2
  83. package/templates/umi-mobile/tsconfig.json +4 -1
  84. package/templates/umi-mobile-h5+app/.eslintignore +6 -0
  85. package/templates/umi-mobile-h5+app/.eslintrc.js +8 -0
  86. package/templates/umi-mobile-h5+app/.gitignore.tpl +4 -7
  87. package/templates/umi-mobile-h5+app/.prettierignore +6 -2
  88. package/templates/umi-mobile-h5+app/.prettierrc.js +2 -0
  89. package/templates/umi-mobile-h5+app/.stylelintignore +6 -0
  90. package/templates/umi-mobile-h5+app/.stylelintrc.js +4 -0
  91. package/templates/umi-mobile-h5+app/.umirc.ts.tpl +0 -1
  92. package/templates/umi-mobile-h5+app/LICENSE +18 -17
  93. package/templates/umi-mobile-h5+app/README.md.tpl +5 -5
  94. package/templates/umi-mobile-h5+app/biome.json +3 -0
  95. package/templates/umi-mobile-h5+app/package.json.tpl +6 -0
  96. package/templates/umi-mobile-h5+app/src/app.tsx +2 -3
  97. package/templates/umi-mobile-h5+app/src/pages/404.tsx +0 -1
  98. package/templates/umi-mobile-h5+app/src/pages/demo/examples/Input.tsx +1 -2
  99. package/templates/umi-mobile-h5+app/src/pages/demo/examples/List/4.tsx +7 -7
  100. package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/1.tsx +1 -2
  101. package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/2.tsx +1 -2
  102. package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/3.tsx +1 -2
  103. package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/4.tsx +1 -2
  104. package/templates/umi-mobile-h5+app/src/pages/demo/index.tsx +8 -7
  105. package/templates/umi-mobile-h5+app/src/pages/index.tsx +0 -2
  106. package/templates/umi-mobile-h5+app/src/types/user.d.ts +2 -2
  107. package/templates/umi-mobile-h5+app/tsconfig.json +4 -1
  108. package/templates/umi-mobile-native/.eslintignore +6 -0
  109. package/templates/umi-mobile-native/.eslintrc.js +8 -0
  110. package/templates/umi-mobile-native/.gitignore.tpl +4 -7
  111. package/templates/umi-mobile-native/.prettierignore +6 -2
  112. package/templates/umi-mobile-native/.prettierrc.js +2 -0
  113. package/templates/umi-mobile-native/.stylelintignore +6 -0
  114. package/templates/umi-mobile-native/.stylelintrc.js +4 -0
  115. package/templates/umi-mobile-native/.umirc.ts.tpl +0 -1
  116. package/templates/umi-mobile-native/LICENSE +18 -17
  117. package/templates/umi-mobile-native/README.md.tpl +5 -5
  118. package/templates/umi-mobile-native/android/app/build.gradle +19 -4
  119. package/templates/umi-mobile-native/android/app/libs/Bluetooth-release.aar +0 -0
  120. package/templates/umi-mobile-native/android/gradle.properties +1 -1
  121. package/templates/umi-mobile-native/biome.json +3 -0
  122. package/templates/umi-mobile-native/package.json.tpl +6 -0
  123. package/templates/umi-mobile-native/src/app.tsx +2 -3
  124. package/templates/umi-mobile-native/src/common/Xprinter.ts +4 -4
  125. package/templates/umi-mobile-native/src/common/bluetooth.ts +14 -14
  126. package/templates/umi-mobile-native/src/common/bridge.ts +6 -6
  127. package/templates/umi-mobile-native/src/pages/404.tsx +0 -1
  128. package/templates/umi-mobile-native/src/pages/demo/examples/Input.tsx +1 -2
  129. package/templates/umi-mobile-native/src/pages/demo/examples/List/4.tsx +7 -7
  130. package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/1.tsx +1 -2
  131. package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/2.tsx +1 -2
  132. package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/3.tsx +1 -2
  133. package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/4.tsx +1 -2
  134. package/templates/umi-mobile-native/src/pages/demo/index.tsx +8 -7
  135. package/templates/umi-mobile-native/src/types/user.d.ts +2 -2
  136. package/templates/umi-mobile-native/tsconfig.json +4 -1
  137. package/templates/umi-mobile-uni-app/.eslintignore +6 -0
  138. package/templates/umi-mobile-uni-app/.eslintrc.js +8 -0
  139. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/.gitignore.tpl +15 -15
  140. package/templates/umi-mobile-uni-app/.prettierignore +12 -0
  141. package/templates/umi-mobile-uni-app/.prettierrc.js +2 -0
  142. package/templates/umi-mobile-uni-app/.stylelintignore +6 -0
  143. package/templates/umi-mobile-uni-app/.stylelintrc.js +4 -0
  144. package/templates/umi-mobile-uni-app/.umirc.ts.tpl +7 -0
  145. package/templates/umi-mobile-uni-app/LICENSE +22 -0
  146. package/templates/{ice-web-screen → umi-mobile-uni-app}/README.md.tpl +5 -5
  147. package/templates/umi-mobile-uni-app/biome.json +3 -0
  148. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/package.json.tpl +7 -1
  149. package/templates/umi-mobile-uni-app/src/app.tsx +18 -0
  150. package/templates/umi-mobile-uni-app/src/layouts/index.tsx +3 -0
  151. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/404.tsx +0 -1
  152. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/BarCode.tsx +0 -1
  153. package/templates/{ice-web → umi-mobile-uni-app}/src/pages/demo/examples/Iconfont.tsx +1 -2
  154. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/Input.tsx +1 -3
  155. package/templates/{ice-mobile-native → umi-mobile-uni-app}/src/pages/demo/examples/List/1.tsx +1 -2
  156. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/List/2.tsx +1 -1
  157. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/List/3.tsx +1 -1
  158. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/List/4.tsx +12 -13
  159. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/Loading.tsx +0 -1
  160. package/templates/{ice-mobile-native → umi-mobile-uni-app}/src/pages/demo/examples/NumberInput/1.tsx +1 -3
  161. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/NumberInput/2.tsx +1 -3
  162. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/NumberInput/3.tsx +1 -3
  163. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/NumberInput/4.tsx +1 -3
  164. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/PagingList/1.tsx +1 -2
  165. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/QrCode.tsx +0 -1
  166. package/templates/{ice-mobile-native → umi-mobile-uni-app}/src/pages/demo/examples/Required.tsx +0 -1
  167. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/TimerButton.tsx +0 -1
  168. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/usePreload.tsx +1 -1
  169. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/index.tsx +10 -10
  170. package/templates/{ice-mobile-native → umi-mobile-uni-app}/src/pages/index.tsx +0 -2
  171. package/templates/umi-mobile-uni-app/src/types/user.d.ts +3 -0
  172. package/templates/umi-mobile-uni-app/tsconfig.json +6 -0
  173. package/templates/umi-mobile-uni-app/typings.d.ts +1 -0
  174. package/templates/umi-mobile-uni-app/uni-app/AndroidManifest.xml +8 -0
  175. package/templates/umi-mobile-uni-app/uni-app/App.vue +28 -0
  176. package/templates/umi-mobile-uni-app/uni-app/androidPrivacy.json +22 -0
  177. package/templates/umi-mobile-uni-app/uni-app/assets/apple-app-site-association +11 -0
  178. package/templates/umi-mobile-uni-app/uni-app/common/constants.ts +5 -0
  179. package/templates/umi-mobile-uni-app/uni-app/common/request.ts +118 -0
  180. package/templates/umi-mobile-uni-app/uni-app/common/util.ts +27 -0
  181. package/templates/umi-mobile-uni-app/uni-app/components/webview/webview.vue +61 -0
  182. package/templates/umi-mobile-uni-app/uni-app/hybrid/html/error.html +24 -0
  183. package/templates/umi-mobile-uni-app/uni-app/images/index.ts +2 -0
  184. package/templates/umi-mobile-uni-app/uni-app/index.html +20 -0
  185. package/templates/{ice-mobile-native/ios/HBuilder/HBuilder.entitlements → umi-mobile-uni-app/uni-app/info.plist} +3 -2
  186. package/templates/umi-mobile-uni-app/uni-app/main.js +22 -0
  187. package/templates/umi-mobile-uni-app/uni-app/manifest.json +207 -0
  188. package/templates/umi-mobile-uni-app/uni-app/pages/index/index.vue +17 -0
  189. package/templates/umi-mobile-uni-app/uni-app/pages/webview/index.vue +19 -0
  190. package/templates/umi-mobile-uni-app/uni-app/pages.json +22 -0
  191. package/templates/umi-mobile-uni-app/uni-app/uni.promisify.adaptor.js +16 -0
  192. package/templates/umi-mobile-uni-app/uni-app/uni.scss +76 -0
  193. package/templates/umi-web/.eslintignore +6 -0
  194. package/templates/umi-web/.eslintrc.js +8 -0
  195. package/templates/umi-web/.gitignore.tpl +4 -7
  196. package/templates/umi-web/.prettierignore +6 -2
  197. package/templates/umi-web/.prettierrc.js +2 -0
  198. package/templates/umi-web/.stylelintignore +6 -0
  199. package/templates/umi-web/.stylelintrc.js +4 -0
  200. package/templates/umi-web/.umirc.ts.tpl +1 -1
  201. package/templates/umi-web/LICENSE +18 -17
  202. package/templates/umi-web/README.md.tpl +5 -5
  203. package/templates/umi-web/biome.json +3 -0
  204. package/templates/umi-web/package.json.tpl +6 -0
  205. package/templates/umi-web/src/app.tsx +2 -3
  206. package/templates/umi-web/src/pages/404.tsx +2 -3
  207. package/templates/umi-web/src/pages/demo/examples/BankInput.tsx +1 -2
  208. package/templates/umi-web/src/pages/demo/examples/Grid/5.tsx +1 -2
  209. package/templates/umi-web/src/pages/demo/examples/Input/2.tsx +2 -1
  210. package/templates/umi-web/src/pages/demo/examples/RangeNumber/2.tsx +1 -2
  211. package/templates/umi-web/src/pages/demo/examples/SearchLayout.tsx +2 -2
  212. package/templates/umi-web/src/pages/demo/index.tsx +11 -9
  213. package/templates/umi-web/src/pages/index.tsx +0 -2
  214. package/templates/umi-web/src/types/user.d.ts +2 -2
  215. package/templates/umi-web/tsconfig.json +4 -1
  216. package/templates/umi-web-screen/.eslintignore +6 -0
  217. package/templates/umi-web-screen/.eslintrc.js +8 -0
  218. package/templates/umi-web-screen/.gitignore.tpl +4 -7
  219. package/templates/umi-web-screen/.prettierignore +6 -2
  220. package/templates/umi-web-screen/.prettierrc.js +2 -0
  221. package/templates/umi-web-screen/.stylelintignore +6 -0
  222. package/templates/umi-web-screen/.stylelintrc.js +4 -0
  223. package/templates/umi-web-screen/.umirc.ts.tpl +2 -2
  224. package/templates/umi-web-screen/LICENSE +18 -17
  225. package/templates/umi-web-screen/README.md.tpl +5 -5
  226. package/templates/umi-web-screen/biome.json +3 -0
  227. package/templates/umi-web-screen/package.json.tpl +6 -0
  228. package/templates/umi-web-screen/src/app.tsx +2 -3
  229. package/templates/umi-web-screen/src/components/resize-container/index.tsx +18 -18
  230. package/templates/umi-web-screen/src/constants.ts +4 -4
  231. package/templates/umi-web-screen/src/layouts/controller/index.tsx +6 -10
  232. package/templates/umi-web-screen/src/pages/404.tsx +2 -3
  233. package/templates/umi-web-screen/src/pages/index.tsx +0 -2
  234. package/templates/umi-web-screen/src/pages/template/components/charts/demo-line/index.tsx +2 -3
  235. package/templates/umi-web-screen/src/pages/template/controller/index.tsx +11 -12
  236. package/templates/umi-web-screen/src/types/user.d.ts +2 -2
  237. package/templates/umi-web-screen/tsconfig.json +4 -1
  238. package/templates/ice-mobile/.eslintrc +0 -6
  239. package/templates/ice-mobile/.gitignore.tpl +0 -34
  240. package/templates/ice-mobile/.icerc.ts +0 -3
  241. package/templates/ice-mobile/.npmrc.tpl +0 -2
  242. package/templates/ice-mobile/.prettierignore +0 -9
  243. package/templates/ice-mobile/.prettierrc +0 -11
  244. package/templates/ice-mobile/.stylelintrc +0 -3
  245. package/templates/ice-mobile/README.md.tpl +0 -34
  246. package/templates/ice-mobile/package.json.tpl +0 -16
  247. package/templates/ice-mobile/public/favicon.ico +0 -0
  248. package/templates/ice-mobile/public/index.html +0 -15
  249. package/templates/ice-mobile/src/app.tsx +0 -5
  250. package/templates/ice-mobile/src/common/request.ts +0 -3
  251. package/templates/ice-mobile/src/common/util.ts +0 -7
  252. package/templates/ice-mobile/src/global.less +0 -3
  253. package/templates/ice-mobile/src/layouts/index.tsx +0 -5
  254. package/templates/ice-mobile/src/pages/404.tsx +0 -10
  255. package/templates/ice-mobile/src/pages/demo/examples/BarCode.tsx +0 -4
  256. package/templates/ice-mobile/src/pages/demo/examples/Iconfont.tsx +0 -18
  257. package/templates/ice-mobile/src/pages/demo/examples/List/1.tsx +0 -12
  258. package/templates/ice-mobile/src/pages/demo/examples/List/2.tsx +0 -29
  259. package/templates/ice-mobile/src/pages/demo/examples/List/4.tsx +0 -55
  260. package/templates/ice-mobile/src/pages/demo/examples/List/mock.ts +0 -30
  261. package/templates/ice-mobile/src/pages/demo/examples/NumberInput/1.tsx +0 -17
  262. package/templates/ice-mobile/src/pages/demo/examples/NumberInput/3.tsx +0 -17
  263. package/templates/ice-mobile/src/pages/demo/examples/QrCode.tsx +0 -4
  264. package/templates/ice-mobile/src/pages/demo/examples/Required.tsx +0 -4
  265. package/templates/ice-mobile/src/pages/demo/examples/TimerButton.tsx +0 -4
  266. package/templates/ice-mobile/src/pages/index.tsx +0 -3
  267. package/templates/ice-mobile/src/routes.ts +0 -29
  268. package/templates/ice-mobile/src/types/user.d.ts +0 -3
  269. package/templates/ice-mobile/tsconfig.json +0 -3
  270. package/templates/ice-mobile/typings.d.ts +0 -1
  271. package/templates/ice-mobile-h5+app/.eslintrc +0 -6
  272. package/templates/ice-mobile-h5+app/.icerc.ts +0 -6
  273. package/templates/ice-mobile-h5+app/.prettierignore +0 -9
  274. package/templates/ice-mobile-h5+app/.prettierrc +0 -11
  275. package/templates/ice-mobile-h5+app/.stylelintrc +0 -3
  276. package/templates/ice-mobile-h5+app/h5+app/manifest.json +0 -87
  277. package/templates/ice-mobile-h5+app/public/index.html +0 -15
  278. package/templates/ice-mobile-h5+app/src/app.tsx +0 -5
  279. package/templates/ice-mobile-h5+app/src/layouts/index.tsx +0 -5
  280. package/templates/ice-mobile-h5+app/src/pages/demo/examples/Iconfont.tsx +0 -18
  281. package/templates/ice-mobile-h5+app/src/pages/demo/examples/Input.tsx +0 -17
  282. package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/1.tsx +0 -12
  283. package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/3.tsx +0 -29
  284. package/templates/ice-mobile-h5+app/src/pages/demo/examples/Loading.tsx +0 -12
  285. package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/1.tsx +0 -17
  286. package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/2.tsx +0 -17
  287. package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/4.tsx +0 -17
  288. package/templates/ice-mobile-h5+app/src/pages/demo/examples/PagingList/1.tsx +0 -6
  289. package/templates/ice-mobile-h5+app/src/pages/demo/examples/Required.tsx +0 -4
  290. package/templates/ice-mobile-h5+app/src/pages/demo/examples/usePreload.tsx +0 -9
  291. package/templates/ice-mobile-h5+app/src/pages/demo/index.tsx +0 -87
  292. package/templates/ice-mobile-h5+app/src/pages/index.tsx +0 -3
  293. package/templates/ice-mobile-h5+app/src/routes.ts +0 -29
  294. package/templates/ice-mobile-h5+app/src/types/user.d.ts +0 -3
  295. package/templates/ice-mobile-h5+app/tsconfig.json +0 -3
  296. package/templates/ice-mobile-h5+app/typings.d.ts +0 -1
  297. package/templates/ice-mobile-native/.eslintrc +0 -6
  298. package/templates/ice-mobile-native/.gitignore.tpl +0 -39
  299. package/templates/ice-mobile-native/.icerc.ts +0 -8
  300. package/templates/ice-mobile-native/.prettierignore +0 -9
  301. package/templates/ice-mobile-native/.prettierrc +0 -11
  302. package/templates/ice-mobile-native/.stylelintrc +0 -3
  303. package/templates/ice-mobile-native/README.md.tpl +0 -34
  304. package/templates/ice-mobile-native/android/app/6209ba977ffec7d62675a4e254ebc209.keystore +0 -0
  305. package/templates/ice-mobile-native/android/app/build.gradle +0 -66
  306. package/templates/ice-mobile-native/android/app/libs/Bluetooth-release.aar +0 -0
  307. package/templates/ice-mobile-native/android/app/libs/PosPrinterSDK.jar +0 -0
  308. package/templates/ice-mobile-native/android/app/libs/android-gif-drawable-release@1.2.23.aar +0 -0
  309. package/templates/ice-mobile-native/android/app/libs/lib.5plus.base-release.aar +0 -0
  310. package/templates/ice-mobile-native/android/app/libs/oaid_sdk_1.0.25.aar +0 -0
  311. package/templates/ice-mobile-native/android/app/libs/webview-x5-release.aar +0 -0
  312. package/templates/ice-mobile-native/android/app/proguard-rules.pro +0 -303
  313. package/templates/ice-mobile-native/android/app/src/main/AndroidManifest.xml +0 -98
  314. package/templates/ice-mobile-native/android/app/src/main/assets/apps/H5ECA1DEE/www/manifest.json +0 -89
  315. package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_control.xml +0 -6
  316. package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_error.html +0 -92
  317. package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_properties.xml +0 -19
  318. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/JSBridge/FunctionCreator.java +0 -119
  319. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/MPandoraEntryActivity.java +0 -17
  320. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/FunctionFactory/Creator.java +0 -17
  321. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/FunctionFactory/Error.java +0 -26
  322. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/JSPlugin.java +0 -265
  323. package/templates/ice-mobile-native/android/app/src/main/res/drawable/icon.png +0 -0
  324. package/templates/ice-mobile-native/android/app/src/main/res/values/colors.xml +0 -5
  325. package/templates/ice-mobile-native/android/app/src/main/res/values/strings.xml +0 -3
  326. package/templates/ice-mobile-native/android/build.gradle +0 -9
  327. package/templates/ice-mobile-native/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  328. package/templates/ice-mobile-native/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  329. package/templates/ice-mobile-native/android/gradle.properties +0 -22
  330. package/templates/ice-mobile-native/android/gradlew +0 -185
  331. package/templates/ice-mobile-native/android/gradlew.bat +0 -89
  332. package/templates/ice-mobile-native/android/settings.gradle +0 -16
  333. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/1024x1024.png +0 -0
  334. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/120x120-1.png +0 -0
  335. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/120x120.png +0 -0
  336. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/180x180.png +0 -0
  337. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/40x40.png +0 -0
  338. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/58x58.png +0 -0
  339. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/60x60.png +0 -0
  340. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/80x80.png +0 -0
  341. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/87x87.png +0 -0
  342. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/Contents.json +0 -62
  343. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/Contents.json +0 -6
  344. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/Image.imageset/Contents.json +0 -20
  345. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/120x120.png +0 -0
  346. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/180x180.png +0 -0
  347. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/60x60.png +0 -0
  348. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/Contents.json +0 -26
  349. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/control_brightness.imageset/Contents.json +0 -21
  350. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/control_brightness.imageset/brightness@2x.png +0 -0
  351. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/Contents.json +0 -22
  352. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/shrinkscreen@2x.png +0 -0
  353. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/shrinkscreen@3x.png +0 -0
  354. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset/Contents.json +0 -22
  355. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset//346/233/235/345/205/211-1.png +0 -0
  356. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset//346/233/235/345/205/211.png +0 -0
  357. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset/Contents.json +0 -22
  358. 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
  359. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset//345/257/271/347/204/246/346/241/206.png +0 -0
  360. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_line.imageset/Contents.json +0 -21
  361. 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
  362. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_thumb.imageset/Contents.json +0 -22
  363. 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
  364. 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
  365. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/Contents.json +0 -22
  366. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/fullscreen@2x.png +0 -0
  367. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/fullscreen@3x.png +0 -0
  368. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/Contents.json +0 -23
  369. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play.png +0 -0
  370. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play@2x.png +0 -0
  371. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play@3x.png +0 -0
  372. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/Contents.json +0 -23
  373. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back.png +0 -0
  374. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back@2x.png +0 -0
  375. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back@3x.png +0 -0
  376. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/Contents.json +0 -23
  377. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play.png +0 -0
  378. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play@2x.png +0 -0
  379. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play@3x.png +0 -0
  380. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/Contents.json +0 -23
  381. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop.png +0 -0
  382. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop@2x.png +0 -0
  383. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop@3x.png +0 -0
  384. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/Contents.json +0 -22
  385. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/video_ic_muteoff@2x.png +0 -0
  386. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/video_ic_muteoff@3x.png +0 -0
  387. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/Contents.json +0 -22
  388. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/video_ic_muteon@2x.png +0 -0
  389. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/video_ic_muteon@3x.png +0 -0
  390. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/Contents.json +0 -22
  391. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/video_volume@2x.png +0 -0
  392. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/video_volume@3x.png +0 -0
  393. package/templates/ice-mobile-native/ios/HBuilder-Hello/120x120.png +0 -0
  394. package/templates/ice-mobile-native/ios/HBuilder-Hello/180x180.png +0 -0
  395. package/templates/ice-mobile-native/ios/HBuilder-Hello/AppDelegate.h +0 -16
  396. package/templates/ice-mobile-native/ios/HBuilder-Hello/AppDelegate.m +0 -225
  397. package/templates/ice-mobile-native/ios/HBuilder-Hello/Base.lproj/LaunchScreen.storyboard +0 -65
  398. package/templates/ice-mobile-native/ios/HBuilder-Hello/English.lproj/Localizable.strings +0 -13
  399. package/templates/ice-mobile-native/ios/HBuilder-Hello/HBuilder-Hello-Info.plist +0 -486
  400. package/templates/ice-mobile-native/ios/HBuilder-Hello/HBuilder-Hello-Prefix.pch +0 -16
  401. package/templates/ice-mobile-native/ios/HBuilder-Hello/LaunchScreen.storyboard +0 -67
  402. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/manifest.json +0 -79
  403. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/1024x1024.png +0 -0
  404. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/120x120.png +0 -0
  405. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/144x144.png +0 -0
  406. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/152x152.png +0 -0
  407. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/167x167.png +0 -0
  408. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/180x180.png +0 -0
  409. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/192x192.png +0 -0
  410. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/20x20.png +0 -0
  411. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/29x29.png +0 -0
  412. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/40x40.png +0 -0
  413. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/58x58.png +0 -0
  414. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/60x60.png +0 -0
  415. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/72x72.png +0 -0
  416. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/76x76.png +0 -0
  417. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/80x80.png +0 -0
  418. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/87x87.png +0 -0
  419. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/96x96.png +0 -0
  420. package/templates/ice-mobile-native/ios/HBuilder-Hello/ViewController.h +0 -19
  421. package/templates/ice-mobile-native/ios/HBuilder-Hello/ViewController.m +0 -161
  422. package/templates/ice-mobile-native/ios/HBuilder-Hello/Xprinter.h +0 -19
  423. package/templates/ice-mobile-native/ios/HBuilder-Hello/Xprinter.m +0 -235
  424. package/templates/ice-mobile-native/ios/HBuilder-Hello/control.xml +0 -107
  425. package/templates/ice-mobile-native/ios/HBuilder-Hello/en.lproj/InfoPlist.strings +0 -4
  426. package/templates/ice-mobile-native/ios/HBuilder-Hello/en.lproj/Localizable.strings +0 -12
  427. package/templates/ice-mobile-native/ios/HBuilder-Hello/main.m +0 -18
  428. package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/InfoPlist.strings +0 -4
  429. package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/LaunchScreen.strings +0 -3
  430. package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/Localizable.strings +0 -13
  431. package/templates/ice-mobile-native/ios/HBuilder-Hello.xcodeproj/project.pbxproj +0 -1607
  432. package/templates/ice-mobile-native/package.json.tpl +0 -16
  433. package/templates/ice-mobile-native/public/favicon.ico +0 -0
  434. package/templates/ice-mobile-native/public/index.html +0 -15
  435. package/templates/ice-mobile-native/src/app.tsx +0 -5
  436. package/templates/ice-mobile-native/src/common/Xprinter.ts +0 -58
  437. package/templates/ice-mobile-native/src/common/bluetooth.ts +0 -354
  438. package/templates/ice-mobile-native/src/common/bridge.ts +0 -59
  439. package/templates/ice-mobile-native/src/common/request.ts +0 -3
  440. package/templates/ice-mobile-native/src/common/util.ts +0 -7
  441. package/templates/ice-mobile-native/src/global.less +0 -3
  442. package/templates/ice-mobile-native/src/layouts/index.tsx +0 -5
  443. package/templates/ice-mobile-native/src/pages/404.tsx +0 -10
  444. package/templates/ice-mobile-native/src/pages/demo/examples/BarCode.tsx +0 -4
  445. package/templates/ice-mobile-native/src/pages/demo/examples/Iconfont.tsx +0 -18
  446. package/templates/ice-mobile-native/src/pages/demo/examples/Input.tsx +0 -17
  447. package/templates/ice-mobile-native/src/pages/demo/examples/List/2.tsx +0 -29
  448. package/templates/ice-mobile-native/src/pages/demo/examples/List/3.tsx +0 -29
  449. package/templates/ice-mobile-native/src/pages/demo/examples/List/4.tsx +0 -55
  450. package/templates/ice-mobile-native/src/pages/demo/examples/List/mock.ts +0 -30
  451. package/templates/ice-mobile-native/src/pages/demo/examples/Loading.tsx +0 -12
  452. package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/2.tsx +0 -17
  453. package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/3.tsx +0 -17
  454. package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/4.tsx +0 -17
  455. package/templates/ice-mobile-native/src/pages/demo/examples/PagingList/1.tsx +0 -6
  456. package/templates/ice-mobile-native/src/pages/demo/examples/QrCode.tsx +0 -4
  457. package/templates/ice-mobile-native/src/pages/demo/examples/TimerButton.tsx +0 -4
  458. package/templates/ice-mobile-native/src/pages/demo/examples/Xprinter/index.tsx +0 -64
  459. package/templates/ice-mobile-native/src/pages/demo/examples/Xprinter/style.less +0 -16
  460. package/templates/ice-mobile-native/src/pages/demo/examples/usePreload.tsx +0 -9
  461. package/templates/ice-mobile-native/src/pages/demo/index.tsx +0 -89
  462. package/templates/ice-mobile-native/src/routes.ts +0 -29
  463. package/templates/ice-mobile-native/src/types/user.d.ts +0 -3
  464. package/templates/ice-mobile-native/tsconfig.json +0 -3
  465. package/templates/ice-mobile-native/typings.d.ts +0 -1
  466. package/templates/ice-web/.eslintrc +0 -6
  467. package/templates/ice-web/.gitignore.tpl +0 -34
  468. package/templates/ice-web/.icerc.ts +0 -3
  469. package/templates/ice-web/.npmrc.tpl +0 -2
  470. package/templates/ice-web/.prettierignore +0 -9
  471. package/templates/ice-web/.prettierrc +0 -11
  472. package/templates/ice-web/.stylelintrc +0 -3
  473. package/templates/ice-web/README.md.tpl +0 -34
  474. package/templates/ice-web/package.json.tpl +0 -16
  475. package/templates/ice-web/public/favicon.ico +0 -0
  476. package/templates/ice-web/public/index.html +0 -15
  477. package/templates/ice-web/src/app.tsx +0 -5
  478. package/templates/ice-web/src/common/request.ts +0 -3
  479. package/templates/ice-web/src/common/util.ts +0 -7
  480. package/templates/ice-web/src/components/index.ts +0 -0
  481. package/templates/ice-web/src/global.less +0 -5
  482. package/templates/ice-web/src/layouts/index.tsx +0 -5
  483. package/templates/ice-web/src/pages/404.tsx +0 -17
  484. package/templates/ice-web/src/pages/demo/examples/BankInput.tsx +0 -13
  485. package/templates/ice-web/src/pages/demo/examples/BarCode.tsx +0 -4
  486. package/templates/ice-web/src/pages/demo/examples/Collapse.tsx +0 -4
  487. package/templates/ice-web/src/pages/demo/examples/DatePicker.tsx +0 -4
  488. package/templates/ice-web/src/pages/demo/examples/Flex.tsx +0 -10
  489. package/templates/ice-web/src/pages/demo/examples/Grid/1.tsx +0 -25
  490. package/templates/ice-web/src/pages/demo/examples/Grid/2.tsx +0 -26
  491. package/templates/ice-web/src/pages/demo/examples/Grid/3.tsx +0 -37
  492. package/templates/ice-web/src/pages/demo/examples/Grid/4.tsx +0 -43
  493. package/templates/ice-web/src/pages/demo/examples/Grid/5.tsx +0 -36
  494. package/templates/ice-web/src/pages/demo/examples/Grid/6.tsx +0 -28
  495. package/templates/ice-web/src/pages/demo/examples/ImagePreview.tsx +0 -20
  496. package/templates/ice-web/src/pages/demo/examples/Input/1.tsx +0 -4
  497. package/templates/ice-web/src/pages/demo/examples/Input/2.tsx +0 -80
  498. package/templates/ice-web/src/pages/demo/examples/LinkButton/1.tsx +0 -4
  499. package/templates/ice-web/src/pages/demo/examples/LinkButton/2.tsx +0 -9
  500. package/templates/ice-web/src/pages/demo/examples/LinkButton/3.tsx +0 -12
  501. package/templates/ice-web/src/pages/demo/examples/Loading.tsx +0 -12
  502. package/templates/ice-web/src/pages/demo/examples/MobileInput.tsx +0 -4
  503. package/templates/ice-web/src/pages/demo/examples/NumberInput.tsx +0 -4
  504. package/templates/ice-web/src/pages/demo/examples/PagingTable.tsx +0 -21
  505. package/templates/ice-web/src/pages/demo/examples/QrCode.tsx +0 -4
  506. package/templates/ice-web/src/pages/demo/examples/RangeNumber/1.tsx +0 -4
  507. package/templates/ice-web/src/pages/demo/examples/RangeNumber/2.tsx +0 -15
  508. package/templates/ice-web/src/pages/demo/examples/Required.tsx +0 -4
  509. package/templates/ice-web/src/pages/demo/examples/SearchLayout.tsx +0 -46
  510. package/templates/ice-web/src/pages/demo/examples/Table/1.tsx +0 -64
  511. package/templates/ice-web/src/pages/demo/examples/Table/2.tsx +0 -29
  512. package/templates/ice-web/src/pages/demo/examples/Table/3.tsx +0 -39
  513. package/templates/ice-web/src/pages/demo/examples/Table/4.tsx +0 -42
  514. package/templates/ice-web/src/pages/demo/examples/TimerButton.tsx +0 -4
  515. package/templates/ice-web/src/pages/demo/examples/Title/1.tsx +0 -4
  516. package/templates/ice-web/src/pages/demo/examples/Title/2.tsx +0 -5
  517. package/templates/ice-web/src/pages/demo/examples/WaterMark.tsx +0 -8
  518. package/templates/ice-web/src/pages/demo/examples/Wrapper.tsx +0 -40
  519. package/templates/ice-web/src/pages/demo/examples/usePreload.tsx +0 -9
  520. package/templates/ice-web/src/pages/demo/index.tsx +0 -135
  521. package/templates/ice-web/src/pages/index.tsx +0 -3
  522. package/templates/ice-web/src/routes.ts +0 -29
  523. package/templates/ice-web/src/types/user.d.ts +0 -3
  524. package/templates/ice-web/tsconfig.json +0 -3
  525. package/templates/ice-web/typings.d.ts +0 -1
  526. package/templates/ice-web-screen/.eslintrc +0 -6
  527. package/templates/ice-web-screen/.gitignore.tpl +0 -34
  528. package/templates/ice-web-screen/.icerc.ts +0 -3
  529. package/templates/ice-web-screen/.npmrc.tpl +0 -2
  530. package/templates/ice-web-screen/.prettierignore +0 -9
  531. package/templates/ice-web-screen/.prettierrc +0 -11
  532. package/templates/ice-web-screen/.stylelintrc +0 -3
  533. package/templates/ice-web-screen/package.json.tpl +0 -17
  534. package/templates/ice-web-screen/public/favicon.ico +0 -0
  535. package/templates/ice-web-screen/public/index.html +0 -15
  536. package/templates/ice-web-screen/src/app.tsx +0 -5
  537. package/templates/ice-web-screen/src/common/request.ts +0 -3
  538. package/templates/ice-web-screen/src/common/util.ts +0 -15
  539. package/templates/ice-web-screen/src/components/index.ts +0 -1
  540. package/templates/ice-web-screen/src/components/resize-container/index.tsx +0 -95
  541. package/templates/ice-web-screen/src/components/resize-container/style.module.less +0 -3
  542. package/templates/ice-web-screen/src/constants.ts +0 -7
  543. package/templates/ice-web-screen/src/global.less +0 -31
  544. package/templates/ice-web-screen/src/hooks/use-size.ts +0 -18
  545. package/templates/ice-web-screen/src/layouts/16_9/fixed.less +0 -18
  546. package/templates/ice-web-screen/src/layouts/16_9/index.tsx +0 -34
  547. package/templates/ice-web-screen/src/layouts/16_9/style.module.less +0 -19
  548. package/templates/ice-web-screen/src/layouts/components/index.ts +0 -0
  549. package/templates/ice-web-screen/src/layouts/controller/index.tsx +0 -79
  550. package/templates/ice-web-screen/src/layouts/index.tsx +0 -11
  551. package/templates/ice-web-screen/src/pages/404.tsx +0 -17
  552. package/templates/ice-web-screen/src/pages/index.tsx +0 -3
  553. package/templates/ice-web-screen/src/pages/template/16_9/index.tsx +0 -13
  554. package/templates/ice-web-screen/src/pages/template/16_9/style.module.less +0 -7
  555. package/templates/ice-web-screen/src/pages/template/components/charts/demo-line/index.tsx +0 -274
  556. package/templates/ice-web-screen/src/pages/template/components/charts/index.ts +0 -1
  557. package/templates/ice-web-screen/src/pages/template/components/index.ts +0 -1
  558. package/templates/ice-web-screen/src/pages/template/controller/index.tsx +0 -85
  559. package/templates/ice-web-screen/src/pages/template/index.tsx +0 -15
  560. package/templates/ice-web-screen/src/pages/template/style.module.less +0 -3
  561. package/templates/ice-web-screen/src/routes.ts +0 -29
  562. package/templates/ice-web-screen/src/styles/vars.less +0 -5
  563. package/templates/ice-web-screen/src/types/user.d.ts +0 -3
  564. package/templates/ice-web-screen/tsconfig.json +0 -3
  565. package/templates/ice-web-screen/typings.d.ts +0 -1
  566. package/templates/miniprogram/.editorconfig +0 -12
  567. package/templates/miniprogram/.eslintrc +0 -6
  568. package/templates/miniprogram/.npmrc.tpl +0 -2
  569. package/templates/miniprogram/.prettierignore +0 -5
  570. package/templates/miniprogram/.prettierrc +0 -12
  571. package/templates/miniprogram/.stylelintrc +0 -3
  572. package/templates/miniprogram/LICENSE +0 -21
  573. package/templates/miniprogram/README.md.tpl +0 -34
  574. package/templates/miniprogram/global.d.ts +0 -33
  575. package/templates/miniprogram/src/app.scss +0 -2
  576. package/templates/miniprogram/src/components/index.ts +0 -0
  577. package/templates/miniprogram/src/constants.ts +0 -1
  578. package/templates/miniprogram/src/hooks/index.ts +0 -0
  579. package/templates/miniprogram/src/pages/demo/examples/Input.tsx +0 -3
  580. package/templates/miniprogram/src/pages/demo/examples/Textarea.tsx +0 -3
  581. package/templates/miniprogram/src/pages/demo/index.module.scss.d.ts +0 -5
  582. package/templates/miniprogram/src/pages/index/index.module.scss.d.ts +0 -5
  583. package/templates/miniprogram/src/types/user.d.ts +0 -3
  584. package/templates/miniprogram/tsconfig.json +0 -28
  585. package/templates/umi-mobile/.eslintrc +0 -6
  586. package/templates/umi-mobile/.prettierrc +0 -11
  587. package/templates/umi-mobile/.stylelintrc +0 -3
  588. package/templates/umi-mobile-h5+app/.eslintrc +0 -6
  589. package/templates/umi-mobile-h5+app/.prettierrc +0 -11
  590. package/templates/umi-mobile-h5+app/.stylelintrc +0 -3
  591. package/templates/umi-mobile-native/.eslintrc +0 -6
  592. package/templates/umi-mobile-native/.prettierrc +0 -11
  593. package/templates/umi-mobile-native/.stylelintrc +0 -3
  594. package/templates/umi-web/.eslintrc +0 -6
  595. package/templates/umi-web/.prettierrc +0 -11
  596. package/templates/umi-web/.stylelintrc +0 -3
  597. package/templates/umi-web-screen/.eslintrc +0 -6
  598. package/templates/umi-web-screen/.prettierrc +0 -11
  599. package/templates/umi-web-screen/.stylelintrc +0 -3
  600. /package/templates/{ice-mobile-h5+app → taro-miniprogram}/.npmrc.tpl +0 -0
  601. /package/templates/{miniprogram → taro-miniprogram}/babel.config.js +0 -0
  602. /package/templates/{miniprogram → taro-miniprogram}/project.tt.json.tpl +0 -0
  603. /package/templates/{miniprogram → taro-miniprogram}/src/common/request.ts +0 -0
  604. /package/templates/{miniprogram → taro-miniprogram}/src/common/util.ts +0 -0
  605. /package/templates/{ice-mobile-h5+app → taro-miniprogram}/src/components/index.ts +0 -0
  606. /package/templates/{ice-mobile-native/src/components → taro-miniprogram/src/hooks}/index.ts +0 -0
  607. /package/templates/{miniprogram → taro-miniprogram}/src/images/empty.gif +0 -0
  608. /package/templates/{miniprogram → taro-miniprogram}/src/index.html +0 -0
  609. /package/templates/{miniprogram/src/pages/demo/index.module.scss → taro-miniprogram/src/pages/demo/style.scss} +0 -0
  610. /package/templates/{miniprogram/src/pages/index/index.module.scss → taro-miniprogram/src/pages/index/style.scss} +0 -0
  611. /package/templates/{miniprogram → taro-miniprogram}/src/theme.scss +0 -0
  612. /package/templates/{ice-mobile-native → umi-mobile-uni-app}/.npmrc.tpl +0 -0
  613. /package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/public/favicon.ico +0 -0
  614. /package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/common/request.ts +0 -0
  615. /package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/common/util.ts +0 -0
  616. /package/templates/{ice-mobile → umi-mobile-uni-app}/src/components/index.ts +0 -0
  617. /package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/global.less +0 -0
  618. /package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/List/mock.ts +0 -0
package/es/yolk.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #! /usr/bin/env node
2
- import e from"@babel/runtime/helpers/toArray";import t from"@babel/runtime/helpers/defineProperty";import s from"lodash/isString";import o from"lodash/pick";import r from"lodash/floor";import i from"lodash/chunk";function n(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,o)}return s}function c(e){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?n(Object(o),!0).forEach((function(s){t(e,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}import{execSync as a,spawn as m}from"child_process";import l from"commander";import p from"fs";import d from"glob";import u from"inquirer";import f from"minimatch";import*as y from"miniprogram-ci";import g from"mkdirp";import h from"mustache";import b from"ora";import j from"os";import S from"path";import{format as v}from"prettier";import x from"rimraf";import k from"../package.json";const w=require("staged-git-files"),$=process.cwd(),P="##### CREATED BY YOLK #####",O={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},F="utf-8",E=60,B=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/.ice/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],D=b(),I=e=>e&&D.warn(Buffer.from(e,F).toString()),q=e=>e&&D.fail(Buffer.from(e,F).toString()),Q=e=>e&&D.succeed(Buffer.from(e,F).toString()),N=e=>e&&D.info(Buffer.from(e,F).toString()),R=e=>"win32"===process.platform?`${e}.cmd`:e,T=()=>{Q("yolk complete!"),process.exit(0)},_=()=>{I("yolk break!"),process.exit(0)},L=({command:e,args:t,complete:s,close:o,exit:r=!0})=>{const i=m(R(e),t||[],{stdio:"inherit"}).on("close",(e=>{e?(o&&o(),q("yolk close!"),process.exit(e)):(s&&s(),r&&T())}));process.on("SIGINT",(()=>{l.runningCommand&&l.runningCommand.kill("SIGKILL"),i.kill(),_()}))},A=(e,t,s)=>{u.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:S.basename(S.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((o=>{const r={projectName:o.projectName,dependenciesInstallType:o.dependenciesInstallType,yolkVersion:k.version};t||(t=S.join(__dirname,`../templates/${o.type}`)),Q(`\u590d\u5236\u6a21\u7248 ${S.basename(t)}`);const i=d.sync("**/*",{cwd:t,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(i.forEach((s=>{if(!t)return;const o=S.join(t,s);if(!p.statSync(o).isDirectory())if(s.endsWith(".tpl")){const t=p.readFileSync(o,F),i=S.join(e,s.replace(/\.tpl$/u,"")),n=h.render(t,r);g.sync(S.dirname(i)),Q(`\u521b\u5efa ${S.relative(e,i)}`),p.writeFileSync(i,n,F)}else{Q(`\u521b\u5efa ${s}`);const t=S.join(e,s);g.sync(S.dirname(t)),p.copyFileSync(o,t)}})),Q("\u590d\u5236\u6a21\u7248 success!"),s&&p.existsSync(t)&&x(t,(()=>{Q(`\u7f13\u5b58\u5220\u9664 success! ${S.basename(t||"")}`)})),o.dependenciesInstallType)switch(Q("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),o.dependenciesInstallType){case"default":case"pnpm":L({command:"pnpm",args:["install"]});break;case"yarn":L({command:"yarn",args:["install"]});break;case"npm":L({command:"npm",args:["install"]});break;default:}Q("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},K=(e,t)=>A(e,t,!0),C=()=>{const e=d.sync("*.yolkrc*",{cwd:$,dot:!0});if(!e.length)return{};const t=S.join($,e[0]);if(!p.existsSync(t))return{};try{return JSON.parse(p.readFileSync(t,F))||{}}catch(s){return q(s.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},J=()=>{const e=S.join($,".prettierrc");if(p.existsSync(e))try{return JSON.parse(p.readFileSync(e,F))||{}}catch(t){return q(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return{singleQuote:!0,trailingComma:"all",printWidth:80,overrides:[{files:".prettierrc",options:{parser:"json"}}]}},H=()=>{const e=S.join($,"project.config.json");if(!p.existsSync(e))return{};try{return JSON.parse(p.readFileSync(e,F))||{}}catch(t){return q(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},M=()=>{const e=S.join($,"package.json");if(!p.existsSync(e))return{};try{return JSON.parse(p.readFileSync(e,F))||{}}catch(t){return q(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},U=()=>p.existsSync(S.join($,"project.config.json")),V=()=>p.existsSync(S.join($,".icerc.ts"))||p.existsSync(S.join($,".icerc.js"))||p.existsSync(S.join($,".ice.ts"))||p.existsSync(S.join($,".ice.js")),G=()=>{let e=p.existsSync(S.join($,"node_modules/.bin/max"));if(!e)try{e=p.existsSync(require.resolve("@umijs/max"))}catch(t){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/u.test(a("umi -v").toString())}catch(t){}if(!e){const s=S.join($,"node_modules","umi","package.json");if(p.existsSync(s))try{const t=JSON.parse(p.readFileSync(s,F))||{};e=t.version&&+t.version.split(".")[0]>3}catch(t){}}return e},W=()=>p.existsSync(S.join($,".icerc.ts"))?".icerc.ts":p.existsSync(S.join($,".icerc.js"))?".icerc.js":p.existsSync(S.join($,".ice.ts"))?".ice.ts":".ice.js",X=()=>{const e=S.join($,"project.config.json");if(p.existsSync(e)){const t=require(e);return t.appid}return""},Y=()=>p.existsSync(S.join($,"project.tt.json"))&&0===X().indexOf("tt"),z=()=>0===X().indexOf("20"),Z=()=>{const e=C();let t="";try{t=require.resolve("@baic/eslint-config-yolk")}catch(r){}const s=d.sync("*.eslintrc*",{cwd:$,dot:!0}),o=s[0];return!1===e.strict&&o&&p.existsSync(o)?o:t},ee=()=>{const e=d.sync("*.stylelintrc*",{cwd:$,dot:!0}),t=e[0];return t},te=()=>{const e=S.join($,".git/"),t=S.join($,".git/hooks"),s=S.join(t,"pre-commit"),o=p.existsSync(e),r=p.existsSync(s),i=r&&p.readFileSync(s,"utf8").includes(P);if(o&&(!r||!i)){g.sync(t),p.writeFileSync(s,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",P].join(j.EOL),"utf8");try{p.chmodSync(s,"777")}catch(n){q(`chmod ${s} failed: ${n.message}`)}Q("Create pre-commit hook")}},se=()=>{const e=C(),t=!1!==e.strict,s=e.eslintIgnore,o=e.stylelintIgnore;w().then((e=>{const r=new Promise(((s,r)=>{const n=ee();if(n){const a=e.map((e=>e.filename)).filter((e=>/^(src|tests)/iu.test(e))).filter((e=>/\.(le|sa|sc|c)s{2}$/iu.test(e))).filter((e=>B.every((t=>!f(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof o?!f(e,o,{matchBase:!0}):o instanceof RegExp?!o.test(e):!Array.isArray(o)||o.every((t=>"string"===typeof t?!f(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e))))).map((e=>{const t=S.join($,e);return p.existsSync(t)?t:null})).filter((e=>!!e));if(a.forEach((e=>{if(e&&p.existsSync(e)){const t=S.extname(e).replace(/^\./u,""),s=p.readFileSync(e,"utf8"),o=v(s,c({parser:O[t]},J()));p.writeFileSync(e,o,"utf8")}})),Q("style prettier success!"),a.length>=E){const e=[];i(a,20).forEach((s=>{e.push(new Promise(((e,o)=>{L({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--config",n,...s],complete:e,close:o,exit:!1})})))}));const o=process.getMaxListeners(),c=i(e,o?o/2:2);let m=0;const l=()=>{m<c.length?Promise.all(c[m]).then((()=>{m++,l()})).catch(r):s()};l()}else a.length&&L({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--config",n,...a],complete:s,close:r,exit:!1})}else s()})),n=()=>{const o=e.map((e=>e.filename)).filter((e=>/^(src|tests)/iu.test(e))).filter((e=>/\.([t|j]sx?)$/iu.test(e))).map((e=>{const t=S.join($,e);return p.existsSync(t)?t:null})).filter((e=>!!e));if(o.length){o.forEach((e=>{if(e&&p.existsSync(e)){const t=S.extname(e).replace(/^\./u,""),s=p.readFileSync(e,"utf8"),o=v(s,c({parser:O[t]},J()));p.writeFileSync(e,o,"utf8")}})),Q("script prettier success!");const e=Z();if(e){const r=o.filter((e=>B.every((t=>!f(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof s?!f(e,s,{matchBase:!0}):s instanceof RegExp?!s.test(e):!Array.isArray(s)||s.every((t=>"string"===typeof t?!f(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(t&&(I("git commit\u7981\u6b62eslint\u7684ignore\u65b9\u5f0f(eslint-disable\u3001.eslintrc*\u3001ignore\u7b49)\u3002"),s&&I(`\u901a\u8fc7yolkrc\u914d\u7f6eeslintIgnore\uff1a${s}\u3002`)),r.length>=E){const s=[];i(r,20).forEach((o=>{s.push(new Promise((s=>{L({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",e,...o],complete:s,exit:!1})})))}));const o=process.getMaxListeners(),n=i(s,o?o/2:2);let c=0;const a=()=>{c<n.length?Promise.all(n[c]).then((()=>{c++,a()})):T()};a()}else r.length&&L({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",e,...r]})}else I("\u6ca1\u6709eslint\u914d\u7f6e\u6587\u4ef6")}else T()};I("\u8981\u6c42\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),r.then(n)}))},oe=({mProject:e,mPrivateKeyPath:t,mVersion:s,mDesc:o,mRobot:r,mQrcodeFormat:i,mQrcodeOutputDest:n,mPagePath:c,mSearchQuery:m})=>{const l=p.existsSync(S.join($,".git"))?a("git log -1 --pretty=format:%H").toString():"",d=H(),u=d.appid,f=e||S.join($,"dist"),g=t||S.join($,`private.${u}.key`);if(p.existsSync(f)){if(p.existsSync(g)){const e=M(),t=s||e.version||d.version||"1.0.0",a=o||e.description||d.description,p=`version: ${t};${l?` commit: ${l};`:""}${a?` description: ${a};`:""}`;l&&N(`commit: ${l}`),N(`dist: ${f}`),N(`key: ${g}`),N(`appid: ${u}`),N(`version: ${t}`),N(`desc: ${p}`);const h=new y.Project({appid:u,type:"miniProgram",projectPath:f,privateKeyPath:g,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:u,options:{project:h,version:t,desc:p,setting:d.setting,robot:r,qrcodeFormat:i,qrcodeOutputDest:n,pagePath:c,searchQuery:m}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${g})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${f})`)},re=()=>{te(),process.argv.length>2?l.version(k.version).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(((t,i)=>{const n=e(i),a=n[0],m=n.slice(1),l=t.clone,d=t.template,u=t.docs;if(a)switch(N(`yolk version: ${k.version}`),N(`node version: ${process.version}`),N(`platform: ${j.platform()}`),N(`memory: ${r(j.freemem()/1024/1024)} MB(${r(j.totalmem()/1024/1024)} MB)`),a){case"init":if(Q(`yolk ${a} \u5f00\u59cb`),l)if(d){const e=".yolk",t=S.join($,e);p.existsSync(t)&&x(t,(()=>{Q(`\u7f13\u5b58\u5220\u9664 success! ${t}`)})),L({command:"git",args:["clone","-b","master","--depth","1",d,e].concat(m)}),K($,t)}else q("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else A($);break;case"start":U()?Y()?L({command:"taro",args:["build","--type","tt","--watch"].concat(m)}):z()?L({command:"taro",args:["build","--type","alipay","--watch"].concat(m)}):L({command:"taro",args:["build","--type","weapp","--watch"].concat(m)}):u?L({command:"dumi",args:["dev"].concat(m)}):V()?L({command:"icejs",args:["start","--config",W()].concat(m)}):G()?L({command:"max",args:["dev"].concat(m)}):L({command:"umi",args:["dev"].concat(m)});break;case"build":U()?Y()?L({command:"taro",args:["build","--type","tt"].concat(m)}):z()?L({command:"taro",args:["build","--type","alipay"].concat(m)}):L({command:"taro",args:["build","--type","weapp"].concat(m)}):u?L({command:"dumi",args:["build"].concat(m)}):V()?L({command:"icejs",args:["build","--config",W()].concat(m)}):G()?L({command:"max",args:["build"].concat(m)}):L({command:"umi",args:["build"].concat(m)});break;case"pre-commit":se();break;case"test":L({command:"umi-test",args:["--no-cache","--update-snapshot","--runInBand","--detectOpenHandles"].concat(m)});break;case"miniapp-upload":case"miniprogram-upload":if(U())if(Y());else if(z());else{const e=oe(t),r=e.appid,i=e.options;N(`${r}\u4e0a\u4f20\u5f00\u59cb`),y.upload(c(c({},o(i,["project","version","desc","setting","robot"])),{},{onProgressUpdate:e=>{if(s(e))N(`task: ${e}`);else{const t=e.status,s=e.message;N(`task(${t}): ${s}`)}}})).then((()=>{Q(`${r}\u4e0a\u4f20\u5b8c\u6210`)}))}break;case"miniapp-preview":case"miniprogram-preview":if(U())if(Y());else if(z());else{const e=oe(t),r=e.appid,i=e.options;N(`${r}\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),y.preview(c(c({},o(i,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"])),{},{onProgressUpdate:e=>{if(s(e))N(`task: ${e}`);else{const t=e.status,s=e.message;N(`task(${t}): ${s}`)}}})).then((()=>{Q(`${r}\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}break;default:_()}})).parse(process.argv):_()};re();
2
+ import e from"@babel/runtime/helpers/defineProperty";function t(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function o(o){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach((function(t){e(o,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}))}return o}import{execSync as r}from"node:child_process";import{chmodSync as i,copyFileSync as a,existsSync as n,readFileSync as s,statSync as c,writeFileSync as m}from"node:fs";import p from"node:os";import{basename as d,dirname as l,join as u,relative as g}from"node:path";import{floor as f,isString as y}from"lodash";import{globSync as h}from"glob";import v from"inquirer";import*as b from"miniprogram-ci";import{mkdirpSync as $}from"mkdirp";import{program as j}from"../compiled/commander";import k from"../compiled/mustache";import O from"../package.json";import{breakExit as w,cwd as P,ENCODING as x,error as D,execCommand as S,getPackageJSON as E,getProjectConfigJSON as q,getYolkConfig as _,info as Q,ready as N,rimrafSync as F,warn as K}from"./_util";const L="##### CREATED BY YOLK #####",R=(e,t,o)=>{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 HBuilderX uni-app template(umi framework)",value:"umi-mobile-uni-app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"taro-miniprogram template",value:"taro-miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:d(d(process.cwd()))},{type:"list",name:"packageManager",message:"\u9009\u62e9\u5305\u7ba1\u7406\u5668(\u9ed8\u8ba4\uff1apnpm\uff0c\u63a8\u8350\uff1apnpm)",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((({type:r,projectName:i,packageManager:p})=>{const f={projectName:i,packageManager:"default"===p?"pnpm":p,yolkVersion:O.version};if("umi-mobile-uni-app"===r)return void K("\u6682\u4e0d\u652f\u6301");const y=t||u(__dirname,`../templates/${r}`);N(`\u590d\u5236\u6a21\u7248 ${d(y)}`);const v=h("**/*",{cwd:y,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(v.forEach((t=>{if(!y)return;const o=u(y,t);if(!c(o).isDirectory())if(t.endsWith(".tpl")){const r=s(o,x),i=u(e,t.replace(/\.tpl$/,"")),a=k.render(r,f);$(l(i)),N(`\u521b\u5efa ${g(e,i)}`),m(i,a,x)}else{N(`\u521b\u5efa ${t}`);const r=u(e,t);$(l(r)),a(o,r)}})),N("\u590d\u5236\u6a21\u7248 success!"),o&&n(y)&&F(y)&&N(`\u7f13\u5b58\u5220\u9664 success! ${d(y||"")}`),p)switch(N("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),p){case"default":case"pnpm":S({command:"pnpm",args:["install"]});break;case"yarn":S({command:"yarn",args:["install"]});break;case"npm":S({command:"npm",args:["install"]});break;default:}N("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},M=(e,t)=>R(e,t,!0),B=()=>n(u(P,"project.config.json")),I=()=>{let e=n(u(P,"node_modules/.bin/max"));if(!e)try{e=n(require.resolve("@umijs/max"))}catch(t){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test(r("umi -v").toString())}catch(t){}if(!e){const o=u(P,"node_modules","umi","package.json");if(n(o))try{const t=JSON.parse(s(o,x))||{};e=t.version&&+t.version.split(".")[0]>3}catch(t){}}return e},U=()=>{const e=u(P,"project.config.json");if(n(e)){const t=require(e);return t.appid}return""},W=()=>n(u(P,"project.tt.json"))&&0===U().indexOf("tt"),A=()=>0===U().indexOf("20"),T=()=>{const e=_(),t=u(P,".husky/pre-commit"),o=u(P,".git/"),r=u(P,".git/hooks"),a=u(r,"pre-commit"),c=n(t),d=n(o),l=n(r),g=n(a),f=!1!==e.initPreCommit&&!c,y=[L,"npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",L].join(p.EOL),h=e=>{let t=e||"";return t&&t.indexOf(L)>=0&&(t=`${t.substring(0,t.indexOf(L))}${t.substring(t.lastIndexOf(L)+L.length)}`.replace(/(\r|\n)+$/gu,"")),t};if(d)if(f)if(l||($(r),N("create .git/hooks")),g){try{i(a,"777")}catch(v){D(`chmod ${a} failed: ${v.message}`)}const e=h(s(a,x).toString());m(a,(e.indexOf("#!/")<0?["#!/bin/sh"]:[]).concat([e,y]).filter((e=>!!e)).join(p.EOL),x)}else m(a,["#!/bin/sh",y].join(p.EOL),x),N("create pre-commit");else if(g){const e=h(s(a,x).toString());m(a,e,x)}},V=()=>{K("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),S({command:"lint-staged",args:["-c",require.resolve("./lintstagedrc")]})},X=({mAppid:e,mProject:t,mPrivateKeyPath:i,mVersion:a,mDesc:s,mRobot:c,mQrcodeFormat:m,mQrcodeOutputDest:p,mPagePath:d,mSearchQuery:l})=>{let g="";try{g=n(u(P,".git"))?r("git log -1 --pretty=format:%H").toString():""}catch(D){}const f=q(),y=e||f.appid,h=t||u(P,"dist"),v=i||u(P,`private.${y}.key`);if(n(h)){if(n(v)){const e=E(),t=a||e.version||f.version||"1.0.0",r=s||e.description||f.description,i=`${g?` commit: ${g};`:""}${r?` description: ${r};`:""}`;g&&Q(`commit: ${g}`),Q(`dist: ${h}`),Q(`key: ${v}`),Q(`appid: ${y}`),Q(`version: ${t}`),Q(`desc: ${i}`);const n=new b.Project({appid:y,type:"miniProgram",projectPath:h,privateKeyPath:v,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:y,options:{project:n,version:t,desc:i,setting:o(o({},f.setting),{},{es6:!1,es7:!1,minifyJS:!1,minifyWXML:!1,minifyWXSS:!1,minify:!1}),robot:c,qrcodeFormat:m,qrcodeOutputDest:p,pagePath:d,searchQuery:l}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${v})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${h})`)},C=()=>{let e="";try{e=r(`npm view ${O.name} version`,{timeout:3e3}).toString().replace(/\n/g,"")}catch(t){}Q(`yolk version: ${O.version}${e&&e!==O.version?`(latest\uff1a${e})`:""}`),Q(`node version: ${process.version}`),Q(`platform: ${p.platform()}`),Q(`memory: ${f(p.freemem()/1024/1024)} MB(${f(p.totalmem()/1024/1024)} MB)`)},H=e=>e.option("--appid, --mAppid <appid>","\u5c0f\u7a0b\u5e8fappid").option("--project, --mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--privateKeyPath, --mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6\uff0c\u9ed8\u8ba4\uff1a{\u5f53\u524d\u76ee\u5f55}/private.{appid}.key").option("--version, --mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--desc, --mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--robot, --mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--qrcodeFormat, --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("--qrcodeOutputDest, --mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--pagePath, --mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--searchQuery, --mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570"),J=/(\w+)=('(.*)'|"(.*)"|(.*))/giu,Y=e=>{process.env.DID_YOU_KNOW="none",process.env.VITE_CJS_IGNORE_WARNING="true";const t=[];return null===e||void 0===e||e.forEach((e=>{if(J.test(e)){const[t,o]=e.split("=");process.env[t]=o,Q(`\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff1a${t}=${o}`)}else t.push(e)})),t},G=()=>{T(),process.argv.length>2?(j.version(O.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]"),j.command("init").description("\u521d\u59cb\u5316\u9879\u76ee").option("--clone <template>","\u5982\u679c\u9700\u8981\uff0c\u53ef\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248\uff0c\u9ed8\u8ba4\u53d6cli\u9ed8\u8ba4\u6a21\u7248").action((({clone:e},{args:t})=>{if(C(),N("yolk init \u5f00\u59cb"),e){const o=".yolk",r=u(P,o);n(r)&&F(r)&&N(`\u7f13\u5b58\u5220\u9664 success! ${r}`),S({command:"git",args:["clone","-b","master","--depth","1",e,o].concat(t)}),M(P,r)}else R(P)})),j.command("start").description("\u542f\u52a8\u9879\u76ee").option("--docs","\u6587\u6863\u6a21\u5f0f").action((({docs:e},{args:t})=>{C();const o=Y(t);B()?W()?S({command:"taro",args:["build","--type","tt","--watch"].concat(o)}):A()?S({command:"taro",args:["build","--type","alipay","--watch"].concat(o)}):S({command:"taro",args:["build","--type","weapp","--watch"].concat(o)}):e?S({command:"dumi",args:["dev"].concat(o)}):I()?S({command:"max",args:["dev"].concat(o)}):S({command:"umi",args:["dev"].concat(o)})})),j.command("build").description("\u7f16\u8bd1\u9879\u76ee").option("--docs","\u6587\u6863\u6a21\u5f0f").action((({docs:e},{args:t})=>{C();const o=Y(t);B()?W()?S({command:"taro",args:["build","--type","tt"].concat(o)}):A()?S({command:"taro",args:["build","--type","alipay"].concat(o)}):S({command:"taro",args:["build","--type","weapp"].concat(o)}):e?S({command:"dumi",args:["build"].concat(o)}):I()?S({command:"max",args:["setup"].concat(o),complete:()=>S({command:"max",args:["build"].concat(o)}),exit:!1}):S({command:"umi",args:["build"].concat(o)})})),j.command("init-pre-commit").description("\u521d\u59cb\u5316 commit hook").action(T),j.command("pre-commit").description("\u6267\u884ccommit hook").action(V),H(j.command("miniprogram-upload").description("\u4f7f\u7528 miniprogram-ci \u4e0a\u4f20\u5c0f\u7a0b\u5e8f")).action((e=>{if(B())if(W());else if(A());else{const{appid:t,options:{project:o,version:r,desc:i,setting:a,robot:n}}=X(e);Q(`${t} \u4e0a\u4f20\u5f00\u59cb`),b.upload({project:o,version:r,desc:i,setting:a,robot:n,onProgressUpdate:e=>{if(y(e))Q(`task: ${e}`);else{const{status:t,message:o}=e;Q(`task(${t}): ${o}`)}}}).then((()=>{N(`${t} \u4e0a\u4f20\u5b8c\u6210`)}))}else D("\u975e\u5c0f\u7a0b\u5e8f\u9879\u76ee\u76ee\u5f55")})),H(j.command("miniprogram-preview").description("\u4f7f\u7528 miniprogram-ci \u9884\u89c8\u5c0f\u7a0b\u5e8f")).action((e=>{if(B())if(W());else if(A());else{const{appid:t,options:{project:o,version:r,desc:i,setting:a,robot:n,qrcodeFormat:s,qrcodeOutputDest:c,pagePath:m,searchQuery:p}}=X(e);Q(`${t} \u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),b.preview({project:o,version:r,desc:i,setting:a,robot:n,qrcodeFormat:s,qrcodeOutputDest:c,pagePath:m,searchQuery:p,onProgressUpdate:e=>{if(y(e))Q(`task: ${e}`);else{const{status:t,message:o}=e;Q(`task(${t}): ${o}`)}}}).then((()=>{N(`${t} \u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}else D("\u975e\u5c0f\u7a0b\u5e8f\u9879\u76ee\u76ee\u5f55")})),j.command("exec").description("\u6267\u884cts\u6587\u4ef6").argument("<path>","\u6267\u884c\u7684ts\u6587\u4ef6").action(((e,t,{args:o})=>{const r=Y(o);S({command:"tsx",args:[e].concat(r)})})),j.command("test").description("\u6267\u884c\u6d4b\u8bd5").option("--config","\u914d\u7f6e\u6587\u4ef6\u5730\u5740").option("--framework <framework>","\u6d4b\u8bd5\u6846\u67b6").action((({config:e},{args:t})=>{const o=Y(t);S({command:"yest",args:["run"].concat(e?["--config",e]:[]).concat(o)})})),j.parse(process.argv)):w()};G();
package/lib/_util.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ /// <reference types="node" />
2
+ export type YolkConfig = {
3
+ strict?: boolean;
4
+ eslintIgnorePattern?: string;
5
+ stylelintIgnorePattern?: string;
6
+ initPreCommit?: boolean;
7
+ };
8
+ export declare const cwd: string;
9
+ export declare const ENCODING: BufferEncoding;
10
+ export declare const warn: (text?: string) => void | "" | undefined;
11
+ export declare const error: (text?: string) => void | "" | undefined;
12
+ export declare const ready: (text?: string) => void | "" | undefined;
13
+ export declare const info: (text?: string) => void | "" | undefined;
14
+ export declare const rimrafSync: (path: string) => boolean;
15
+ export declare const completeExit: () => never;
16
+ export declare const breakExit: () => never;
17
+ export declare const execCommand: ({ command, args, complete, close, exit, }: {
18
+ command: string;
19
+ args?: string[] | undefined;
20
+ complete?: (() => void) | undefined;
21
+ close?: (() => void) | undefined;
22
+ exit?: boolean | undefined;
23
+ }) => void;
24
+ export declare const getYolkConfig: () => YolkConfig;
25
+ export declare const getProjectConfigJSON: () => any;
26
+ export declare const getPackageJSON: () => any;
27
+ export declare const getConfigFilePath: (type: 'eslint' | 'stylelint' | 'prettier' | 'biome') => string;
28
+ export declare const getEsLintConfigPath: () => string;
29
+ export declare const getStyleLintConfigPath: () => string;
30
+ export declare const getPrettierConfigPath: () => string;
31
+ export declare const getBiomeConfigPath: () => string;
package/lib/_util.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var e=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.warn=exports.rimrafSync=exports.ready=exports.info=exports.getYolkConfig=exports.getStyleLintConfigPath=exports.getProjectConfigJSON=exports.getPrettierConfigPath=exports.getPackageJSON=exports.getEsLintConfigPath=exports.getConfigFilePath=exports.getBiomeConfigPath=exports.execCommand=exports.error=exports.cwd=exports.completeExit=exports.breakExit=exports.ENCODING=void 0;var t=require("node:child_process"),r=require("node:fs"),o=require("node:path"),s=e(require("chalk")),n=require("glob"),c=require("rimraf"),i=require("../compiled/commander");const a=exports.cwd=process.cwd(),p=console,l=exports.ENCODING="utf-8",x=e=>e&&p.log(s.default.yellow("warn -"),e);exports.warn=x;const g=e=>e&&p.log(s.default.red("error -"),e);exports.error=g;const f=e=>e&&p.log(s.default.green("ready -"),e);exports.ready=f;const d=e=>e&&p.log(s.default.blue("info -"),e);exports.info=d;const u=()=>"win32"===process.platform,y=e=>u()?`${e}.cmd`:e,m=e=>u()?(0,c.windowsSync)(e):(0,c.rimrafSync)(e);exports.rimrafSync=m;const S=()=>{d("yolk complete!"),process.exit(0)};exports.completeExit=S;const h=()=>{x("yolk break!"),process.exit(0)};exports.breakExit=h;const C=({command:e,args:r,complete:o,close:s,exit:n=!0})=>{const c=(0,t.spawn)(y(e),r||[],{stdio:"inherit"}).on("close",(e=>{e?(s&&s(),g("yolk close!"),process.exit(e)):(o&&o(),n&&S())}));process.on("SIGINT",(()=>{i.program.exitOverride(),c.kill(),h()}))};exports.execCommand=C;const k=()=>{const e=(0,n.globSync)("*.yolkrc*",{cwd:a,dot:!0});if(!e.length)return{};const t=(0,o.join)(a,e[0]);if(!(0,r.existsSync)(t))return{};try{return JSON.parse((0,r.readFileSync)(t,l))||{}}catch(g){return g(g.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}};exports.getYolkConfig=k;const P=()=>{const e=(0,o.join)(a,"project.config.json");if(!(0,r.existsSync)(e))return{};try{return JSON.parse((0,r.readFileSync)(e,l))||{}}catch(g){return g(g.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}};exports.getProjectConfigJSON=P;const w=()=>{const e=(0,o.join)(a,"package.json");if(!(0,r.existsSync)(e))return{};try{return JSON.parse((0,r.readFileSync)(e,l))||{}}catch(g){return g(g.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}};exports.getPackageJSON=w;const b=e=>{const t=k();let o="";try{o=require.resolve(`@baic/${e}-config-yolk`)}catch(g){}const s=(0,n.globSync)(`*.${e}rc*`,{cwd:a,dot:!0}),c=null===s||void 0===s?void 0:s[0];return!1===t.strict&&c&&(0,r.existsSync)(c)?c:(0,r.existsSync)(o)?o:c};exports.getConfigFilePath=b;const j=()=>b("eslint");exports.getEsLintConfigPath=j;const N=()=>b("stylelint");exports.getStyleLintConfigPath=N;const O=()=>b("prettier");exports.getPrettierConfigPath=O;const q=()=>b("biome");exports.getBiomeConfigPath=q;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("@babel/runtime/helpers/interopRequireDefault"),t=e(require("@babel/runtime/helpers/defineProperty"));function n(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 r(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?n(Object(o),!0).forEach((function(n){(0,t.default)(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}const{join:o}=require("node:path"),{getBiomeConfigPath:c,getEsLintConfigPath:s,getPrettierConfigPath:i,getStyleLintConfigPath:a,getYolkConfig:l}=require("./_util"),p=["**/node_modules/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/mock/**","**/test/**","**/public/**","**/assets/**","**/.umi/**","**/.umi-production/**","**/h5+app/**","**/*uni*/**","**/android/**","**/ios/**","**/*.ignore/**"],{strict:u=!0,eslintIgnorePattern:g,stylelintIgnorePattern:h}=l(),f=o(process.cwd(),"node_modules",".cache"),m=`prettier --write --cache --cache-strategy=content --cache-location=${o(f,".prettiercache")} --config ${i()} --no-error-on-unmatched-pattern`,y=`eslint --fix ${u?"--no-inline-config":""} --no-error-on-unmatched-pattern --cache --cache-strategy=content --cache-location=${o(f,".eslintcache")} --config ${s()} ${p.concat(g?[g]:[]).map((e=>`--ignore-pattern ${e}`)).join(" ")}`,b=`stylelint --fix ${u?"--ignore-disables":""} --allow-empty-input --cache --cache-strategy=content --cache-location=${o(f,".stylelintcache")} --config ${a()} ${p.concat(h?[h]:[]).map((e=>`--ignore-pattern ${e}`)).join(" ")}`,j=`biome check --write --unsafe --no-errors-on-unmatched --log-level=error --files-ignore-unknown=true --config-path=${c()}`,d={"*.{md,json,jsonc}":[m],"*.css":[m,`${b} --custom-syntax postcss`],"*.less":[m,`${b} --custom-syntax postcss-less`],"*.{sass,scss}":[m,`${b} --custom-syntax postcss-scss`],"*.{js,jsx,cjs,mjs}":[m,y],"*.{ts,tsx,cts,mts}":[`${m} --parser=typescript`,y]};module.exports=r(r({},d),{},{[`!(${Object.keys(d).join("|")})`]:[j]});
package/lib/yolk.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #! /usr/bin/env node
2
- "use strict";var e=require("@babel/runtime/helpers/interopRequireDefault");function t(){const n=e(require("@babel/runtime/helpers/toArray"));return t=function(){return n},n}function n(){const t=e(require("@babel/runtime/helpers/defineProperty"));return n=function(){return t},t}function r(){const t=e(require("lodash/isString"));return r=function(){return t},t}function a(){const t=e(require("lodash/pick"));return a=function(){return t},t}function i(){const t=e(require("lodash/floor"));return i=function(){return t},t}function o(){const t=e(require("lodash/chunk"));return o=function(){return t},t}function s(){const e=require("child_process");return s=function(){return e},e}function c(){const t=e(require("commander"));return c=function(){return t},t}function u(){const t=e(require("fs"));return u=function(){return t},t}function l(){const t=e(require("glob"));return l=function(){return t},t}function f(){const t=e(require("inquirer"));return f=function(){return t},t}function d(){const t=e(require("minimatch"));return d=function(){return t},t}function m(){const e=x(require("miniprogram-ci"));return m=function(){return e},e}function p(){const t=e(require("mkdirp"));return p=function(){return t},t}function y(){const t=e(require("mustache"));return y=function(){return t},t}function g(){const t=e(require("ora"));return g=function(){return t},t}function h(){const t=e(require("os"));return h=function(){return t},t}function b(){const t=e(require("path"));return b=function(){return t},t}function j(){const e=require("prettier");return j=function(){return e},e}function v(){const t=e(require("rimraf"));return v=function(){return t},t}var S=e(require("../package.json"));function w(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(w=function(e){return e?n:t})(e)}function x(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==typeof e&&"function"!==typeof e)return{default:e};var n=w(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function k(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 $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){(0,n().default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const O=require("staged-git-files"),P=process.cwd(),q="##### CREATED BY YOLK #####",F={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},E="utf-8",D=60,B=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/.ice/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],I=(0,g().default)(),_=e=>e&&I.warn(Buffer.from(e,E).toString()),Q=e=>e&&I.fail(Buffer.from(e,E).toString()),R=e=>e&&I.succeed(Buffer.from(e,E).toString()),N=e=>e&&I.info(Buffer.from(e,E).toString()),T=e=>"win32"===process.platform?`${e}.cmd`:e,L=()=>{R("yolk complete!"),process.exit(0)},M=()=>{_("yolk break!"),process.exit(0)},A=({command:e,args:t,complete:n,close:r,exit:a=!0})=>{const i=(0,s().spawn)(T(e),t||[],{stdio:"inherit"}).on("close",(e=>{e?(r&&r(),Q("yolk close!"),process.exit(e)):(n&&n(),a&&L())}));process.on("SIGINT",(()=>{c().default.runningCommand&&c().default.runningCommand.kill("SIGKILL"),i.kill(),M()}))},K=(e,t,n)=>{f().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:b().default.basename(b().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((r=>{const a={projectName:r.projectName,dependenciesInstallType:r.dependenciesInstallType,yolkVersion:S.default.version};t||(t=b().default.join(__dirname,`../templates/${r.type}`)),R(`\u590d\u5236\u6a21\u7248 ${b().default.basename(t)}`);const i=l().default.sync("**/*",{cwd:t,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(i.forEach((n=>{if(!t)return;const r=b().default.join(t,n);if(!u().default.statSync(r).isDirectory())if(n.endsWith(".tpl")){const t=u().default.readFileSync(r,E),i=b().default.join(e,n.replace(/\.tpl$/u,"")),o=y().default.render(t,a);p().default.sync(b().default.dirname(i)),R(`\u521b\u5efa ${b().default.relative(e,i)}`),u().default.writeFileSync(i,o,E)}else{R(`\u521b\u5efa ${n}`);const t=b().default.join(e,n);p().default.sync(b().default.dirname(t)),u().default.copyFileSync(r,t)}})),R("\u590d\u5236\u6a21\u7248 success!"),n&&u().default.existsSync(t)&&(0,v().default)(t,(()=>{R(`\u7f13\u5b58\u5220\u9664 success! ${b().default.basename(t||"")}`)})),r.dependenciesInstallType)switch(R("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),r.dependenciesInstallType){case"default":case"pnpm":A({command:"pnpm",args:["install"]});break;case"yarn":A({command:"yarn",args:["install"]});break;case"npm":A({command:"npm",args:["install"]});break;default:}R("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},C=(e,t)=>K(e,t,!0),J=()=>{const e=l().default.sync("*.yolkrc*",{cwd:P,dot:!0});if(!e.length)return{};const t=b().default.join(P,e[0]);if(!u().default.existsSync(t))return{};try{return JSON.parse(u().default.readFileSync(t,E))||{}}catch(n){return Q(n.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},W=()=>{const e=b().default.join(P,".prettierrc");if(u().default.existsSync(e))try{return JSON.parse(u().default.readFileSync(e,E))||{}}catch(t){return Q(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return{singleQuote:!0,trailingComma:"all",printWidth:80,overrides:[{files:".prettierrc",options:{parser:"json"}}]}},H=()=>{const e=b().default.join(P,"project.config.json");if(!u().default.existsSync(e))return{};try{return JSON.parse(u().default.readFileSync(e,E))||{}}catch(t){return Q(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},U=()=>{const e=b().default.join(P,"package.json");if(!u().default.existsSync(e))return{};try{return JSON.parse(u().default.readFileSync(e,E))||{}}catch(t){return Q(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},V=()=>u().default.existsSync(b().default.join(P,"project.config.json")),G=()=>u().default.existsSync(b().default.join(P,".icerc.ts"))||u().default.existsSync(b().default.join(P,".icerc.js"))||u().default.existsSync(b().default.join(P,".ice.ts"))||u().default.existsSync(b().default.join(P,".ice.js")),X=()=>{let e=u().default.existsSync(b().default.join(P,"node_modules/.bin/max"));if(!e)try{e=u().default.existsSync(require.resolve("@umijs/max"))}catch(t){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/u.test((0,s().execSync)("umi -v").toString())}catch(t){}if(!e){const n=b().default.join(P,"node_modules","umi","package.json");if(u().default.existsSync(n))try{const t=JSON.parse(u().default.readFileSync(n,E))||{};e=t.version&&+t.version.split(".")[0]>3}catch(t){}}return e},Y=()=>u().default.existsSync(b().default.join(P,".icerc.ts"))?".icerc.ts":u().default.existsSync(b().default.join(P,".icerc.js"))?".icerc.js":u().default.existsSync(b().default.join(P,".ice.ts"))?".ice.ts":".ice.js",z=()=>{const e=b().default.join(P,"project.config.json");if(u().default.existsSync(e)){const t=require(e);return t.appid}return""},Z=()=>u().default.existsSync(b().default.join(P,"project.tt.json"))&&0===z().indexOf("tt"),ee=()=>0===z().indexOf("20"),te=()=>{const e=J();let t="";try{t=require.resolve("@baic/eslint-config-yolk")}catch(a){}const n=l().default.sync("*.eslintrc*",{cwd:P,dot:!0}),r=n[0];return!1===e.strict&&r&&u().default.existsSync(r)?r:t},ne=()=>{const e=l().default.sync("*.stylelintrc*",{cwd:P,dot:!0}),t=e[0];return t},re=()=>{const e=b().default.join(P,".git/"),t=b().default.join(P,".git/hooks"),n=b().default.join(t,"pre-commit"),r=u().default.existsSync(e),a=u().default.existsSync(n),i=a&&u().default.readFileSync(n,"utf8").includes(q);if(r&&(!a||!i)){p().default.sync(t),u().default.writeFileSync(n,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",q].join(h().default.EOL),"utf8");try{u().default.chmodSync(n,"777")}catch(o){Q(`chmod ${n} failed: ${o.message}`)}R("Create pre-commit hook")}},ae=()=>{const e=J(),t=!1!==e.strict,n=e.eslintIgnore,r=e.stylelintIgnore;O().then((e=>{const a=new Promise(((n,a)=>{const i=ne();if(i){const s=e.map((e=>e.filename)).filter((e=>/^(src|tests)/iu.test(e))).filter((e=>/\.(le|sa|sc|c)s{2}$/iu.test(e))).filter((e=>B.every((t=>!(0,d().default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof r?!(0,d().default)(e,r,{matchBase:!0}):r instanceof RegExp?!r.test(e):!Array.isArray(r)||r.every((t=>"string"===typeof t?!(0,d().default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e))))).map((e=>{const t=b().default.join(P,e);return u().default.existsSync(t)?t:null})).filter((e=>!!e));if(s.forEach((e=>{if(e&&u().default.existsSync(e)){const t=b().default.extname(e).replace(/^\./u,""),n=u().default.readFileSync(e,"utf8"),r=(0,j().format)(n,$({parser:F[t]},W()));u().default.writeFileSync(e,r,"utf8")}})),R("style prettier success!"),s.length>=D){const e=[];(0,o().default)(s,20).forEach((n=>{e.push(new Promise(((e,r)=>{A({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--config",i,...n],complete:e,close:r,exit:!1})})))}));const r=process.getMaxListeners(),c=(0,o().default)(e,r?r/2:2);let u=0;const l=()=>{u<c.length?Promise.all(c[u]).then((()=>{u++,l()})).catch(a):n()};l()}else s.length&&A({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--config",i,...s],complete:n,close:a,exit:!1})}else n()})),i=()=>{const r=e.map((e=>e.filename)).filter((e=>/^(src|tests)/iu.test(e))).filter((e=>/\.([t|j]sx?)$/iu.test(e))).map((e=>{const t=b().default.join(P,e);return u().default.existsSync(t)?t:null})).filter((e=>!!e));if(r.length){r.forEach((e=>{if(e&&u().default.existsSync(e)){const t=b().default.extname(e).replace(/^\./u,""),n=u().default.readFileSync(e,"utf8"),r=(0,j().format)(n,$({parser:F[t]},W()));u().default.writeFileSync(e,r,"utf8")}})),R("script prettier success!");const e=te();if(e){const a=r.filter((e=>B.every((t=>!(0,d().default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof n?!(0,d().default)(e,n,{matchBase:!0}):n instanceof RegExp?!n.test(e):!Array.isArray(n)||n.every((t=>"string"===typeof t?!(0,d().default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(t&&(_("git commit\u7981\u6b62eslint\u7684ignore\u65b9\u5f0f(eslint-disable\u3001.eslintrc*\u3001ignore\u7b49)\u3002"),n&&_(`\u901a\u8fc7yolkrc\u914d\u7f6eeslintIgnore\uff1a${n}\u3002`)),a.length>=D){const n=[];(0,o().default)(a,20).forEach((r=>{n.push(new Promise((n=>{A({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",e,...r],complete:n,exit:!1})})))}));const r=process.getMaxListeners(),i=(0,o().default)(n,r?r/2:2);let s=0;const c=()=>{s<i.length?Promise.all(i[s]).then((()=>{s++,c()})):L()};c()}else a.length&&A({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",e,...a]})}else _("\u6ca1\u6709eslint\u914d\u7f6e\u6587\u4ef6")}else L()};_("\u8981\u6c42\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),a.then(i)}))},ie=({mProject:e,mPrivateKeyPath:t,mVersion:n,mDesc:r,mRobot:a,mQrcodeFormat:i,mQrcodeOutputDest:o,mPagePath:c,mSearchQuery:l})=>{const f=u().default.existsSync(b().default.join(P,".git"))?(0,s().execSync)("git log -1 --pretty=format:%H").toString():"",d=H(),p=d.appid,y=e||b().default.join(P,"dist"),g=t||b().default.join(P,`private.${p}.key`);if(u().default.existsSync(y)){if(u().default.existsSync(g)){const e=U(),t=n||e.version||d.version||"1.0.0",s=r||e.description||d.description,u=`version: ${t};${f?` commit: ${f};`:""}${s?` description: ${s};`:""}`;f&&N(`commit: ${f}`),N(`dist: ${y}`),N(`key: ${g}`),N(`appid: ${p}`),N(`version: ${t}`),N(`desc: ${u}`);const h=new(m().Project)({appid:p,type:"miniProgram",projectPath:y,privateKeyPath:g,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:p,options:{project:h,version:t,desc:u,setting:d.setting,robot:a,qrcodeFormat:i,qrcodeOutputDest:o,pagePath:c,searchQuery:l}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${g})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${y})`)},oe=()=>{re(),process.argv.length>2?c().default.version(S.default.version).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,n)=>{const o=(0,t().default)(n),s=o[0],c=o.slice(1),l=e.clone,f=e.template,d=e.docs;if(s)switch(N(`yolk version: ${S.default.version}`),N(`node version: ${process.version}`),N(`platform: ${h().default.platform()}`),N(`memory: ${(0,i().default)(h().default.freemem()/1024/1024)} MB(${(0,i().default)(h().default.totalmem()/1024/1024)} MB)`),s){case"init":if(R(`yolk ${s} \u5f00\u59cb`),l)if(f){const e=".yolk",t=b().default.join(P,e);u().default.existsSync(t)&&(0,v().default)(t,(()=>{R(`\u7f13\u5b58\u5220\u9664 success! ${t}`)})),A({command:"git",args:["clone","-b","master","--depth","1",f,e].concat(c)}),C(P,t)}else Q("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else K(P);break;case"start":V()?Z()?A({command:"taro",args:["build","--type","tt","--watch"].concat(c)}):ee()?A({command:"taro",args:["build","--type","alipay","--watch"].concat(c)}):A({command:"taro",args:["build","--type","weapp","--watch"].concat(c)}):d?A({command:"dumi",args:["dev"].concat(c)}):G()?A({command:"icejs",args:["start","--config",Y()].concat(c)}):X()?A({command:"max",args:["dev"].concat(c)}):A({command:"umi",args:["dev"].concat(c)});break;case"build":V()?Z()?A({command:"taro",args:["build","--type","tt"].concat(c)}):ee()?A({command:"taro",args:["build","--type","alipay"].concat(c)}):A({command:"taro",args:["build","--type","weapp"].concat(c)}):d?A({command:"dumi",args:["build"].concat(c)}):G()?A({command:"icejs",args:["build","--config",Y()].concat(c)}):X()?A({command:"max",args:["build"].concat(c)}):A({command:"umi",args:["build"].concat(c)});break;case"pre-commit":ae();break;case"test":A({command:"umi-test",args:["--no-cache","--update-snapshot","--runInBand","--detectOpenHandles"].concat(c)});break;case"miniapp-upload":case"miniprogram-upload":if(V())if(Z());else if(ee());else{const t=ie(e),n=t.appid,i=t.options;N(`${n}\u4e0a\u4f20\u5f00\u59cb`),m().upload($($({},(0,a().default)(i,["project","version","desc","setting","robot"])),{},{onProgressUpdate:e=>{if((0,r().default)(e))N(`task: ${e}`);else{const t=e.status,n=e.message;N(`task(${t}): ${n}`)}}})).then((()=>{R(`${n}\u4e0a\u4f20\u5b8c\u6210`)}))}break;case"miniapp-preview":case"miniprogram-preview":if(V())if(Z());else if(ee());else{const t=ie(e),n=t.appid,i=t.options;N(`${n}\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),m().preview($($({},(0,a().default)(i,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"])),{},{onProgressUpdate:e=>{if((0,r().default)(e))N(`task: ${e}`);else{const t=e.status,n=e.message;N(`task(${t}): ${n}`)}}})).then((()=>{R(`${n}\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}break;default:M()}})).parse(process.argv):M()};oe();
2
+ "use strict";var e=require("@babel/runtime/helpers/interopRequireDefault"),t=e(require("@babel/runtime/helpers/defineProperty")),o=require("node:child_process"),r=require("node:fs"),n=e(require("node:os")),i=require("node:path"),a=require("lodash"),c=require("glob"),s=e(require("inquirer")),m=y(require("miniprogram-ci")),p=require("mkdirp"),d=require("../compiled/commander"),l=e(require("../compiled/mustache")),u=e(require("../package.json")),f=require("./_util");function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(g=function(e){return e?o:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=g(t);if(o&&o.has(e))return o.get(e);var r={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,o&&o.set(e,r),r}function b(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function v(e){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?b(Object(r),!0).forEach((function(o){(0,t.default)(e,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const h="##### CREATED BY YOLK #####",j=(e,t,o)=>{s.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 HBuilderX uni-app template(umi framework)",value:"umi-mobile-uni-app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"taro-miniprogram template",value:"taro-miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:(0,i.basename)((0,i.basename)(process.cwd()))},{type:"list",name:"packageManager",message:"\u9009\u62e9\u5305\u7ba1\u7406\u5668(\u9ed8\u8ba4\uff1apnpm\uff0c\u63a8\u8350\uff1apnpm)",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((({type:n,projectName:a,packageManager:s})=>{const m={projectName:a,packageManager:"default"===s?"pnpm":s,yolkVersion:u.default.version};if("umi-mobile-uni-app"===n)return void(0,f.warn)("\u6682\u4e0d\u652f\u6301");const d=t||(0,i.join)(__dirname,`../templates/${n}`);(0,f.ready)(`\u590d\u5236\u6a21\u7248 ${(0,i.basename)(d)}`);const g=(0,c.globSync)("**/*",{cwd:d,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(g.forEach((t=>{if(!d)return;const o=(0,i.join)(d,t);if(!(0,r.statSync)(o).isDirectory())if(t.endsWith(".tpl")){const n=(0,r.readFileSync)(o,f.ENCODING),a=(0,i.join)(e,t.replace(/\.tpl$/,"")),c=l.default.render(n,m);(0,p.mkdirpSync)((0,i.dirname)(a)),(0,f.ready)(`\u521b\u5efa ${(0,i.relative)(e,a)}`),(0,r.writeFileSync)(a,c,f.ENCODING)}else{(0,f.ready)(`\u521b\u5efa ${t}`);const n=(0,i.join)(e,t);(0,p.mkdirpSync)((0,i.dirname)(n)),(0,r.copyFileSync)(o,n)}})),(0,f.ready)("\u590d\u5236\u6a21\u7248 success!"),o&&(0,r.existsSync)(d)&&(0,f.rimrafSync)(d)&&(0,f.ready)(`\u7f13\u5b58\u5220\u9664 success! ${(0,i.basename)(d||"")}`),s)switch((0,f.ready)("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),s){case"default":case"pnpm":(0,f.execCommand)({command:"pnpm",args:["install"]});break;case"yarn":(0,f.execCommand)({command:"yarn",args:["install"]});break;case"npm":(0,f.execCommand)({command:"npm",args:["install"]});break;default:}(0,f.ready)("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},w=(e,t)=>j(e,t,!0),x=()=>(0,r.existsSync)((0,i.join)(f.cwd,"project.config.json")),S=()=>{let e=(0,r.existsSync)((0,i.join)(f.cwd,"node_modules/.bin/max"));if(!e)try{e=(0,r.existsSync)(require.resolve("@umijs/max"))}catch(t){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test((0,o.execSync)("umi -v").toString())}catch(t){}if(!e){const o=(0,i.join)(f.cwd,"node_modules","umi","package.json");if((0,r.existsSync)(o))try{const t=JSON.parse((0,r.readFileSync)(o,f.ENCODING))||{};e=t.version&&+t.version.split(".")[0]>3}catch(t){}}return e},O=()=>{const e=(0,i.join)(f.cwd,"project.config.json");if((0,r.existsSync)(e)){const t=require(e);return t.appid}return""},k=()=>(0,r.existsSync)((0,i.join)(f.cwd,"project.tt.json"))&&0===O().indexOf("tt"),$=()=>0===O().indexOf("20"),P=()=>{const e=(0,f.getYolkConfig)(),t=(0,i.join)(f.cwd,".husky/pre-commit"),o=(0,i.join)(f.cwd,".git/"),a=(0,i.join)(f.cwd,".git/hooks"),c=(0,i.join)(a,"pre-commit"),s=(0,r.existsSync)(t),m=(0,r.existsSync)(o),d=(0,r.existsSync)(a),l=(0,r.existsSync)(c),u=!1!==e.initPreCommit&&!s,g=[h,"npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",h].join(n.default.EOL),y=e=>{let t=e||"";return t&&t.indexOf(h)>=0&&(t=`${t.substring(0,t.indexOf(h))}${t.substring(t.lastIndexOf(h)+h.length)}`.replace(/(\r|\n)+$/gu,"")),t};if(m)if(u)if(d||((0,p.mkdirpSync)(a),(0,f.ready)("create .git/hooks")),l){try{(0,r.chmodSync)(c,"777")}catch(b){(0,f.error)(`chmod ${c} failed: ${b.message}`)}const e=y((0,r.readFileSync)(c,f.ENCODING).toString());(0,r.writeFileSync)(c,(e.indexOf("#!/")<0?["#!/bin/sh"]:[]).concat([e,g]).filter((e=>!!e)).join(n.default.EOL),f.ENCODING)}else(0,r.writeFileSync)(c,["#!/bin/sh",g].join(n.default.EOL),f.ENCODING),(0,f.ready)("create pre-commit");else if(l){const e=y((0,r.readFileSync)(c,f.ENCODING).toString());(0,r.writeFileSync)(c,e,f.ENCODING)}},C=()=>{(0,f.warn)("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),(0,f.execCommand)({command:"lint-staged",args:["-c",require.resolve("./lintstagedrc")]})},q=({mAppid:e,mProject:t,mPrivateKeyPath:n,mVersion:a,mDesc:c,mRobot:s,mQrcodeFormat:p,mQrcodeOutputDest:d,mPagePath:l,mSearchQuery:u})=>{let g="";try{g=(0,r.existsSync)((0,i.join)(f.cwd,".git"))?(0,o.execSync)("git log -1 --pretty=format:%H").toString():""}catch(w){}const y=(0,f.getProjectConfigJSON)(),b=e||y.appid,h=t||(0,i.join)(f.cwd,"dist"),j=n||(0,i.join)(f.cwd,`private.${b}.key`);if((0,r.existsSync)(h)){if((0,r.existsSync)(j)){const e=(0,f.getPackageJSON)(),t=a||e.version||y.version||"1.0.0",o=c||e.description||y.description,r=`${g?` commit: ${g};`:""}${o?` description: ${o};`:""}`;g&&(0,f.info)(`commit: ${g}`),(0,f.info)(`dist: ${h}`),(0,f.info)(`key: ${j}`),(0,f.info)(`appid: ${b}`),(0,f.info)(`version: ${t}`),(0,f.info)(`desc: ${r}`);const n=new m.Project({appid:b,type:"miniProgram",projectPath:h,privateKeyPath:j,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:b,options:{project:n,version:t,desc:r,setting:v(v({},y.setting),{},{es6:!1,es7:!1,minifyJS:!1,minifyWXML:!1,minifyWXSS:!1,minify:!1}),robot:s,qrcodeFormat:p,qrcodeOutputDest:d,pagePath:l,searchQuery:u}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${j})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${h})`)},D=()=>{let e="";try{e=(0,o.execSync)(`npm view ${u.default.name} version`,{timeout:3e3}).toString().replace(/\n/g,"")}catch(t){}(0,f.info)(`yolk version: ${u.default.version}${e&&e!==u.default.version?`(latest\uff1a${e})`:""}`),(0,f.info)(`node version: ${process.version}`),(0,f.info)(`platform: ${n.default.platform()}`),(0,f.info)(`memory: ${(0,a.floor)(n.default.freemem()/1024/1024)} MB(${(0,a.floor)(n.default.totalmem()/1024/1024)} MB)`)},N=e=>e.option("--appid, --mAppid <appid>","\u5c0f\u7a0b\u5e8fappid").option("--project, --mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--privateKeyPath, --mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6\uff0c\u9ed8\u8ba4\uff1a{\u5f53\u524d\u76ee\u5f55}/private.{appid}.key").option("--version, --mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--desc, --mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--robot, --mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--qrcodeFormat, --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("--qrcodeOutputDest, --mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--pagePath, --mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--searchQuery, --mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570"),E=/(\w+)=('(.*)'|"(.*)"|(.*))/giu,_=e=>{process.env.DID_YOU_KNOW="none",process.env.VITE_CJS_IGNORE_WARNING="true";const t=[];return null===e||void 0===e||e.forEach((e=>{if(E.test(e)){const[t,o]=e.split("=");process.env[t]=o,(0,f.info)(`\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff1a${t}=${o}`)}else t.push(e)})),t},F=()=>{P(),process.argv.length>2?(d.program.version(u.default.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]"),d.program.command("init").description("\u521d\u59cb\u5316\u9879\u76ee").option("--clone <template>","\u5982\u679c\u9700\u8981\uff0c\u53ef\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248\uff0c\u9ed8\u8ba4\u53d6cli\u9ed8\u8ba4\u6a21\u7248").action((({clone:e},{args:t})=>{if(D(),(0,f.ready)("yolk init \u5f00\u59cb"),e){const o=".yolk",n=(0,i.join)(f.cwd,o);(0,r.existsSync)(n)&&(0,f.rimrafSync)(n)&&(0,f.ready)(`\u7f13\u5b58\u5220\u9664 success! ${n}`),(0,f.execCommand)({command:"git",args:["clone","-b","master","--depth","1",e,o].concat(t)}),w(f.cwd,n)}else j(f.cwd)})),d.program.command("start").description("\u542f\u52a8\u9879\u76ee").option("--docs","\u6587\u6863\u6a21\u5f0f").action((({docs:e},{args:t})=>{D();const o=_(t);x()?k()?(0,f.execCommand)({command:"taro",args:["build","--type","tt","--watch"].concat(o)}):$()?(0,f.execCommand)({command:"taro",args:["build","--type","alipay","--watch"].concat(o)}):(0,f.execCommand)({command:"taro",args:["build","--type","weapp","--watch"].concat(o)}):e?(0,f.execCommand)({command:"dumi",args:["dev"].concat(o)}):S()?(0,f.execCommand)({command:"max",args:["dev"].concat(o)}):(0,f.execCommand)({command:"umi",args:["dev"].concat(o)})})),d.program.command("build").description("\u7f16\u8bd1\u9879\u76ee").option("--docs","\u6587\u6863\u6a21\u5f0f").action((({docs:e},{args:t})=>{D();const o=_(t);x()?k()?(0,f.execCommand)({command:"taro",args:["build","--type","tt"].concat(o)}):$()?(0,f.execCommand)({command:"taro",args:["build","--type","alipay"].concat(o)}):(0,f.execCommand)({command:"taro",args:["build","--type","weapp"].concat(o)}):e?(0,f.execCommand)({command:"dumi",args:["build"].concat(o)}):S()?(0,f.execCommand)({command:"max",args:["setup"].concat(o),complete:()=>(0,f.execCommand)({command:"max",args:["build"].concat(o)}),exit:!1}):(0,f.execCommand)({command:"umi",args:["build"].concat(o)})})),d.program.command("init-pre-commit").description("\u521d\u59cb\u5316 commit hook").action(P),d.program.command("pre-commit").description("\u6267\u884ccommit hook").action(C),N(d.program.command("miniprogram-upload").description("\u4f7f\u7528 miniprogram-ci \u4e0a\u4f20\u5c0f\u7a0b\u5e8f")).action((e=>{if(x())if(k());else if($());else{const{appid:t,options:{project:o,version:r,desc:n,setting:i,robot:c}}=q(e);(0,f.info)(`${t} \u4e0a\u4f20\u5f00\u59cb`),m.upload({project:o,version:r,desc:n,setting:i,robot:c,onProgressUpdate:e=>{if((0,a.isString)(e))(0,f.info)(`task: ${e}`);else{const{status:t,message:o}=e;(0,f.info)(`task(${t}): ${o}`)}}}).then((()=>{(0,f.ready)(`${t} \u4e0a\u4f20\u5b8c\u6210`)}))}else(0,f.error)("\u975e\u5c0f\u7a0b\u5e8f\u9879\u76ee\u76ee\u5f55")})),N(d.program.command("miniprogram-preview").description("\u4f7f\u7528 miniprogram-ci \u9884\u89c8\u5c0f\u7a0b\u5e8f")).action((e=>{if(x())if(k());else if($());else{const{appid:t,options:{project:o,version:r,desc:n,setting:i,robot:c,qrcodeFormat:s,qrcodeOutputDest:p,pagePath:d,searchQuery:l}}=q(e);(0,f.info)(`${t} \u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),m.preview({project:o,version:r,desc:n,setting:i,robot:c,qrcodeFormat:s,qrcodeOutputDest:p,pagePath:d,searchQuery:l,onProgressUpdate:e=>{if((0,a.isString)(e))(0,f.info)(`task: ${e}`);else{const{status:t,message:o}=e;(0,f.info)(`task(${t}): ${o}`)}}}).then((()=>{(0,f.ready)(`${t} \u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}else(0,f.error)("\u975e\u5c0f\u7a0b\u5e8f\u9879\u76ee\u76ee\u5f55")})),d.program.command("exec").description("\u6267\u884cts\u6587\u4ef6").argument("<path>","\u6267\u884c\u7684ts\u6587\u4ef6").action(((e,t,{args:o})=>{const r=_(o);(0,f.execCommand)({command:"tsx",args:[e].concat(r)})})),d.program.command("test").description("\u6267\u884c\u6d4b\u8bd5").option("--config","\u914d\u7f6e\u6587\u4ef6\u5730\u5740").option("--framework <framework>","\u6d4b\u8bd5\u6846\u67b6").action((({config:e},{args:t})=>{const o=_(t);(0,f.execCommand)({command:"yest",args:["run"].concat(e?["--config",e]:[]).concat(o)})})),d.program.parse(process.argv)):(0,f.breakExit)()};F();
package/package.json CHANGED
@@ -1,44 +1,65 @@
1
1
  {
2
2
  "name": "@baic/yolk-cli",
3
- "version": "2.1.0-alpha.25",
4
- "author": "Baic <303394539@qq.com>",
3
+ "version": "2.1.0-alpha.250",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/303394539/yolk.git"
7
+ },
5
8
  "license": "MIT",
9
+ "author": "Baic <303394539@qq.com>",
10
+ "main": "./lib/index.js",
11
+ "module": "./es/index.js",
12
+ "typings": "./lib/index.d.ts",
6
13
  "bin": {
7
- "yolk": "lib/index.js"
14
+ "yolk": "./lib/index.js"
8
15
  },
9
- "main": "lib/index.js",
10
- "module": "es/index.js",
11
- "typings": "lib/index.d.ts",
12
16
  "files": [
17
+ "compiled",
13
18
  "lib",
14
19
  "es",
15
20
  "templates"
16
21
  ],
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/303394539/yolk.git"
22
+ "scripts": {
23
+ "build": "father build",
24
+ "ncu": "ncu",
25
+ "prebundle": "father prebundle"
20
26
  },
21
27
  "dependencies": {
22
- "@types/glob": "~7.2.0",
23
- "@types/inquirer": "~8.2.1",
24
- "@types/lodash": "~4.x",
25
- "@types/mkdirp": "~1.0.2",
26
- "@types/mustache": "~4.1.3",
27
- "@types/prettier": "~2.6.3",
28
- "@types/rimraf": "~3.0.2",
29
- "commander": "~6.x",
30
- "glob": "~8.0.3",
31
- "inquirer": "~8.x",
32
- "lodash": "~4.x",
33
- "miniprogram-ci": "~1.8.25",
34
- "mkdirp": "~1.0.4",
35
- "mustache": "~4.2.0",
36
- "prettier": "~2.x",
37
- "rimraf": "~3.0.2",
38
- "staged-git-files": "~1.3.0"
28
+ "@baic/biome-config-yolk": "2.1.0-alpha.250",
29
+ "@baic/eslint-config-yolk": "2.1.0-alpha.250",
30
+ "@baic/prettier-config-yolk": "2.1.0-alpha.250",
31
+ "@baic/stylelint-config-yolk": "2.1.0-alpha.250",
32
+ "@baic/yolk-test": "2.1.0-alpha.250",
33
+ "@democrance/imagemin-lint-staged": "5.0.x",
34
+ "@types/lodash": "4.x",
35
+ "chalk": "4.x",
36
+ "eslint": "8.x",
37
+ "glob": "10.4.x",
38
+ "inquirer": "8.x",
39
+ "lint-staged": "16.0.x",
40
+ "lodash": "4.x",
41
+ "miniprogram-ci": "1.9.x",
42
+ "mkdirp": "3.0.x",
43
+ "postcss": "8.5.x",
44
+ "postcss-less": "6.0.x",
45
+ "postcss-scss": "4.0.x",
46
+ "prettier": "2.x",
47
+ "rimraf": "5.0.x",
48
+ "stylelint": "14.x",
49
+ "tsx": "4.x"
50
+ },
51
+ "devDependencies": {
52
+ "@types/inquirer": "8.x",
53
+ "@types/lint-staged": "13.x",
54
+ "@types/mustache": "4.x",
55
+ "commander": "12.1.x",
56
+ "mustache": "4.2.x"
57
+ },
58
+ "engines": {
59
+ "node": ">=16"
39
60
  },
40
61
  "publishConfig": {
41
62
  "access": "public"
42
63
  },
43
- "gitHead": "9d390a1e9e49df697d60f222359ff26810d03fed"
64
+ "gitHead": "4c32b99cf6e88f46214b12886bb0130354187476"
44
65
  }
@@ -0,0 +1,4 @@
1
+ node_modules/
2
+ /public/
3
+ /build/
4
+ /dist/
@@ -0,0 +1,8 @@
1
+ /** @type {import('eslint').Linter.BaseConfig} */
2
+ module.exports = {
3
+ extends: '@baic/eslint-config-yolk',
4
+ parserOptions: {
5
+ project: './tsconfig.json',
6
+ tsconfigRootDir: __dirname,
7
+ },
8
+ };
@@ -1,21 +1,18 @@
1
1
  # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
2
 
3
3
  # dependencies
4
- /node_modules
4
+ node_modules/
5
5
  npm-debug.log*
6
6
  npm-error.log*
7
- package-lock.json
8
- yarn.lock
9
7
  yarn-debug.log*
10
8
  yarn-error.log*
11
- pnpm-lock.yaml
12
9
 
13
10
  # testing
14
11
  /coverage
15
12
 
16
13
  # production
17
14
  /build
18
- dist/
15
+ /dist
19
16
 
20
17
  # misc
21
18
  .DS_Store
@@ -25,6 +22,7 @@ dist/
25
22
  .env.production.local
26
23
 
27
24
  # temp
25
+ .swc/
28
26
  .temp/
29
27
  .rn_temp/
30
28
  deploy_versions/
@@ -34,4 +32,7 @@ deploy_versions/
34
32
  .eslintcache
35
33
  .stylelintcache
36
34
  .vscode
37
- project.private.config.json
35
+ project.private.config.json
36
+
37
+ # ide
38
+ .vscode
@@ -0,0 +1,9 @@
1
+ **/*.md
2
+ **/*.svg
3
+ **/*.ejs
4
+ **/*.html
5
+ package-lock.json
6
+ yarn.lock
7
+ yarn-debug.log
8
+ yarn-error.log
9
+ pnpm-lock.yaml
@@ -0,0 +1,2 @@
1
+ /** @type {import('prettier').Config} */
2
+ module.exports = require('@baic/prettier-config-yolk');
@@ -0,0 +1,4 @@
1
+ node_modules/
2
+ /public/
3
+ /build/
4
+ /dist/
@@ -0,0 +1,4 @@
1
+ /** @type {import('stylelint').Config} */
2
+ module.exports = {
3
+ extends: '@baic/stylelint-config-yolk',
4
+ };
@@ -0,0 +1,22 @@
1
+ MIT LICENSE
2
+
3
+ Copyright (c) 2025 Baic<303394539@qq.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -4,20 +4,20 @@
4
4
 
5
5
  Install dependencies,
6
6
 
7
- {{ #dependenciesInstallType }}
7
+ {{ #packageManager }}
8
8
 
9
9
  ```bash
10
- $ {{ dependenciesInstallType }} install
10
+ $ {{ packageManager }} install
11
11
  ```
12
12
 
13
- {{ /dependenciesInstallType }}
14
- {{ ^dependenciesInstallType }}
13
+ {{ /packageManager }}
14
+ {{ ^packageManager }}
15
15
 
16
16
  ```bash
17
17
  $ pnpm install
18
18
  ```
19
19
 
20
- {{ /dependenciesInstallType }}
20
+ {{ /packageManager }}
21
21
 
22
22
  Start the dev server,
23
23
 
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": ["@baic/biome-config-yolk"]
3
+ }
@@ -1,4 +1,4 @@
1
- import path from 'path';
1
+ import path from 'node:path';
2
2
  import { config } from '@baic/yolk-taro';
3
3
 
4
4
  export default (merge) =>
@@ -0,0 +1 @@
1
+ import "@baic/yolk-taro/project.typings";
@@ -18,6 +18,10 @@
18
18
  "dependencies": {
19
19
  "@baic/preset-yolk-taro-miniprogram": "~{{ yolkVersion }}"
20
20
  },
21
+ "devDependencies": {
22
+ "@types/react": "17.x",
23
+ "react": "17.x",
24
+ },
21
25
  "pnpm": {
22
26
  "peerDependencyRules": {
23
27
  "ignoreMissing": "*"
@@ -42,12 +42,14 @@
42
42
  "showES6CompileOption": false,
43
43
  "disableUseStrict": false,
44
44
  "useCompilerPlugins": false,
45
- "minifyWXML": true
45
+ "minifyWXML": true,
46
+ "condition": false,
47
+ "bigPackageSizeSupport": true
46
48
  },
47
49
  "compileType": "miniprogram",
48
50
  "simulatorType": "wechat",
49
51
  "simulatorPluginLibVersion": {},
50
- "libVersion": "2.13.0",
52
+ "libVersion": "2.32.0",
51
53
  "condition": {},
52
54
  "srcMiniprogramRoot": "dist/",
53
55
  "packOptions": {
@@ -1,4 +1,4 @@
1
- import { AppConfig } from '@tarojs/taro/types/index';
1
+ import { AppConfig } from '@tarojs/taro';
2
2
 
3
3
  export default {
4
4
  pages: ['pages/index/index', 'pages/demo/index'],
@@ -0,0 +1 @@
1
+ @import "~taro-ui/dist/style/index.scss";
@@ -1,14 +1,12 @@
1
- import * as React from 'react';
1
+ import './app.scss';
2
+
3
+ import React, { PropsWithChildren } from 'react';
2
4
 
3
5
  import { Provider } from '@baic/yolk-miniprogram';
4
6
 
5
7
  import request from '@/common/request';
6
8
 
7
- import './app.scss';
8
-
9
- interface Props {
10
- children: React.ReactNode;
11
- }
9
+ type Props = PropsWithChildren<Record<string, unknown>>;
12
10
 
13
11
  export default ({ children }: Props) => (
14
12
  <Provider request={request} inputMaxLength={40}>
@@ -0,0 +1 @@
1
+ export const REQUEST_HOST: string = '';
@@ -0,0 +1,11 @@
1
+ import { Form, FormItem, Input, useForm } from '@baic/yolk-miniprogram';
2
+ export default () => {
3
+ const [form] = useForm();
4
+ return (
5
+ <Form form={form}>
6
+ <FormItem name="input" rules="required">
7
+ <Input />
8
+ </FormItem>
9
+ </Form>
10
+ );
11
+ };
@@ -1,3 +1,2 @@
1
- import * as React from 'react';
2
1
  import { MobileInput } from '@baic/yolk-miniprogram';
3
2
  export default () => <MobileInput />;
@@ -1,3 +1,2 @@
1
- import * as React from 'react';
2
1
  import { MoneyInput } from '@baic/yolk-miniprogram';
3
2
  export default () => <MoneyInput />;
@@ -1,3 +1,2 @@
1
- import * as React from 'react';
2
1
  import { NumberInput } from '@baic/yolk-miniprogram';
3
2
  export default () => <NumberInput />;
@@ -0,0 +1,12 @@
1
+ import { Form, FormItem, Textarea, useForm } from '@baic/yolk-miniprogram';
2
+
3
+ export default () => {
4
+ const [form] = useForm();
5
+ return (
6
+ <Form form={form}>
7
+ <FormItem name="textarea" rules="required">
8
+ <Textarea />
9
+ </FormItem>
10
+ </Form>
11
+ );
12
+ };
@@ -1,3 +1,2 @@
1
- import * as React from 'react';
2
1
  import { TimerButton } from '@baic/yolk-miniprogram';
3
2
  export default () => <TimerButton>验证码</TimerButton>;
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { View } from '@tarojs/components';
3
2
  import { Util } from '@baic/yolk';
4
3
  import { usePreload } from '@baic/yolk-miniprogram';
@@ -1,4 +1,4 @@
1
- import { PageConfig } from '@tarojs/taro/types/index';
1
+ import { PageConfig } from '@tarojs/taro';
2
2
 
3
3
  export default {
4
4
  navigationBarTitleText: 'demo',