@baic/yolk-cli 2.1.0-alpha.27 → 2.1.0-alpha.270

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 (631) hide show
  1. package/LICENSE +18 -17
  2. package/README.md +5 -5
  3. package/compiled/commander/index.d.ts +968 -0
  4. package/compiled/commander/index.js +1 -0
  5. package/compiled/commander/package.json +1 -0
  6. package/compiled/js-yaml/index.d.ts +148 -0
  7. package/compiled/js-yaml/index.js +1 -0
  8. package/compiled/js-yaml/package.json +1 -0
  9. package/compiled/mustache/index.d.ts +431 -0
  10. package/compiled/mustache/index.js +5 -0
  11. package/compiled/mustache/package.json +1 -0
  12. package/es/_util.d.ts +43 -0
  13. package/es/_util.js +1 -0
  14. package/es/lintstagedrc.js +1 -0
  15. package/es/yolk.js +1 -1
  16. package/lib/_util.d.ts +43 -0
  17. package/lib/_util.js +1 -0
  18. package/lib/lintstagedrc.js +1 -0
  19. package/lib/yolk.js +1 -1
  20. package/package.json +53 -27
  21. package/templates/taro-miniprogram/.eslintignore +4 -0
  22. package/templates/taro-miniprogram/.eslintrc.js +8 -0
  23. package/templates/{miniprogram → taro-miniprogram}/.gitignore.tpl +12 -6
  24. package/templates/taro-miniprogram/.prettierignore +9 -0
  25. package/templates/taro-miniprogram/.prettierrc.js +2 -0
  26. package/templates/taro-miniprogram/.stylelintignore +4 -0
  27. package/templates/taro-miniprogram/.stylelintrc.js +4 -0
  28. package/templates/taro-miniprogram/LICENSE +22 -0
  29. package/templates/{ice-mobile-h5+app → taro-miniprogram}/README.md.tpl +5 -5
  30. package/templates/taro-miniprogram/biome.json +3 -0
  31. package/templates/{miniprogram → taro-miniprogram}/config/index.ts.tpl +1 -1
  32. package/templates/taro-miniprogram/global.d.ts +1 -0
  33. package/templates/{miniprogram → taro-miniprogram}/package.json.tpl +4 -0
  34. package/templates/{miniprogram → taro-miniprogram}/project.config.json.tpl +4 -2
  35. package/templates/{miniprogram → taro-miniprogram}/src/app.config.ts +1 -1
  36. package/templates/taro-miniprogram/src/app.scss +1 -0
  37. package/templates/{miniprogram → taro-miniprogram}/src/app.tsx +4 -6
  38. package/templates/taro-miniprogram/src/constants.ts +1 -0
  39. package/templates/taro-miniprogram/src/pages/demo/examples/Input.tsx +11 -0
  40. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/examples/MobileInput.tsx +0 -1
  41. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/examples/MoneyInput.tsx +0 -1
  42. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/examples/NumberInput.tsx +0 -1
  43. package/templates/taro-miniprogram/src/pages/demo/examples/Textarea.tsx +12 -0
  44. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/examples/TimerButton.tsx +0 -1
  45. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/examples/usePreload.tsx +0 -1
  46. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/index.config.ts +1 -1
  47. package/templates/{miniprogram → taro-miniprogram}/src/pages/demo/index.tsx +6 -5
  48. package/templates/{miniprogram → taro-miniprogram}/src/pages/index/index.config.ts +1 -1
  49. package/templates/{miniprogram → taro-miniprogram}/src/pages/index/index.tsx +1 -1
  50. package/templates/taro-miniprogram/src/types/user.d.ts +5 -0
  51. package/templates/taro-miniprogram/tsconfig.json +11 -0
  52. package/templates/umi-mobile/.eslintignore +6 -0
  53. package/templates/umi-mobile/.eslintrc.js +8 -0
  54. package/templates/umi-mobile/.gitignore.tpl +9 -7
  55. package/templates/umi-mobile/.prettierignore +6 -2
  56. package/templates/umi-mobile/.prettierrc.js +2 -0
  57. package/templates/umi-mobile/.stylelintignore +6 -0
  58. package/templates/umi-mobile/.stylelintrc.js +4 -0
  59. package/templates/umi-mobile/.umirc.ts.tpl +0 -1
  60. package/templates/umi-mobile/LICENSE +18 -17
  61. package/templates/umi-mobile/README.md.tpl +5 -5
  62. package/templates/umi-mobile/biome.json +3 -0
  63. package/templates/umi-mobile/package.json.tpl +9 -2
  64. package/templates/umi-mobile/src/app.tsx +2 -3
  65. package/templates/umi-mobile/src/pages/404.tsx +0 -1
  66. package/templates/umi-mobile/src/pages/demo/examples/BarCode.tsx +0 -1
  67. package/templates/umi-mobile/src/pages/demo/examples/Iconfont.tsx +1 -2
  68. package/templates/umi-mobile/src/pages/demo/examples/Input.tsx +1 -3
  69. package/templates/umi-mobile/src/pages/demo/examples/List/1.tsx +1 -2
  70. package/templates/umi-mobile/src/pages/demo/examples/List/2.tsx +1 -1
  71. package/templates/umi-mobile/src/pages/demo/examples/List/3.tsx +1 -1
  72. package/templates/umi-mobile/src/pages/demo/examples/List/4.tsx +12 -13
  73. package/templates/umi-mobile/src/pages/demo/examples/Loading.tsx +0 -1
  74. package/templates/umi-mobile/src/pages/demo/examples/NumberInput/1.tsx +1 -3
  75. package/templates/umi-mobile/src/pages/demo/examples/NumberInput/2.tsx +1 -3
  76. package/templates/umi-mobile/src/pages/demo/examples/NumberInput/3.tsx +1 -3
  77. package/templates/umi-mobile/src/pages/demo/examples/NumberInput/4.tsx +1 -3
  78. package/templates/umi-mobile/src/pages/demo/examples/PagingList/1.tsx +1 -2
  79. package/templates/umi-mobile/src/pages/demo/examples/QrCode.tsx +0 -1
  80. package/templates/umi-mobile/src/pages/demo/examples/Required.tsx +0 -1
  81. package/templates/umi-mobile/src/pages/demo/examples/TimerButton.tsx +0 -1
  82. package/templates/umi-mobile/src/pages/demo/examples/usePreload.tsx +1 -1
  83. package/templates/umi-mobile/src/pages/demo/index.tsx +10 -10
  84. package/templates/umi-mobile/src/pages/index.tsx +0 -2
  85. package/templates/umi-mobile/src/types/user.d.ts +2 -2
  86. package/templates/umi-mobile/tsconfig.json +9 -1
  87. package/templates/umi-mobile/yest.config.ts +10 -0
  88. package/templates/umi-mobile-h5+app/.eslintignore +6 -0
  89. package/templates/umi-mobile-h5+app/.eslintrc.js +8 -0
  90. package/templates/umi-mobile-h5+app/.gitignore.tpl +9 -7
  91. package/templates/umi-mobile-h5+app/.prettierignore +6 -2
  92. package/templates/umi-mobile-h5+app/.prettierrc.js +2 -0
  93. package/templates/umi-mobile-h5+app/.stylelintignore +6 -0
  94. package/templates/umi-mobile-h5+app/.stylelintrc.js +4 -0
  95. package/templates/umi-mobile-h5+app/.umirc.ts.tpl +0 -1
  96. package/templates/umi-mobile-h5+app/LICENSE +18 -17
  97. package/templates/umi-mobile-h5+app/README.md.tpl +5 -5
  98. package/templates/umi-mobile-h5+app/biome.json +3 -0
  99. package/templates/umi-mobile-h5+app/package.json.tpl +8 -1
  100. package/templates/umi-mobile-h5+app/src/app.tsx +2 -3
  101. package/templates/umi-mobile-h5+app/src/pages/404.tsx +0 -1
  102. package/templates/umi-mobile-h5+app/src/pages/demo/examples/Input.tsx +1 -2
  103. package/templates/umi-mobile-h5+app/src/pages/demo/examples/List/4.tsx +7 -7
  104. package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/1.tsx +1 -2
  105. package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/2.tsx +1 -2
  106. package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/3.tsx +1 -2
  107. package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/4.tsx +1 -2
  108. package/templates/umi-mobile-h5+app/src/pages/demo/index.tsx +8 -7
  109. package/templates/umi-mobile-h5+app/src/pages/index.tsx +0 -2
  110. package/templates/umi-mobile-h5+app/src/types/user.d.ts +2 -2
  111. package/templates/umi-mobile-h5+app/tsconfig.json +9 -1
  112. package/templates/umi-mobile-h5+app/yest.config.ts +10 -0
  113. package/templates/umi-mobile-native/.eslintignore +6 -0
  114. package/templates/umi-mobile-native/.eslintrc.js +8 -0
  115. package/templates/umi-mobile-native/.gitignore.tpl +9 -7
  116. package/templates/umi-mobile-native/.prettierignore +6 -2
  117. package/templates/umi-mobile-native/.prettierrc.js +2 -0
  118. package/templates/umi-mobile-native/.stylelintignore +6 -0
  119. package/templates/umi-mobile-native/.stylelintrc.js +4 -0
  120. package/templates/umi-mobile-native/.umirc.ts.tpl +0 -1
  121. package/templates/umi-mobile-native/LICENSE +18 -17
  122. package/templates/umi-mobile-native/README.md.tpl +5 -5
  123. package/templates/umi-mobile-native/android/app/build.gradle +19 -4
  124. package/templates/umi-mobile-native/android/app/libs/Bluetooth-release.aar +0 -0
  125. package/templates/umi-mobile-native/android/gradle.properties +1 -1
  126. package/templates/umi-mobile-native/biome.json +3 -0
  127. package/templates/umi-mobile-native/package.json.tpl +8 -1
  128. package/templates/umi-mobile-native/src/app.tsx +2 -3
  129. package/templates/umi-mobile-native/src/common/Xprinter.ts +4 -4
  130. package/templates/umi-mobile-native/src/common/bluetooth.ts +14 -14
  131. package/templates/umi-mobile-native/src/common/bridge.ts +6 -6
  132. package/templates/umi-mobile-native/src/pages/404.tsx +0 -1
  133. package/templates/umi-mobile-native/src/pages/demo/examples/Input.tsx +1 -2
  134. package/templates/umi-mobile-native/src/pages/demo/examples/List/4.tsx +7 -7
  135. package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/1.tsx +1 -2
  136. package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/2.tsx +1 -2
  137. package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/3.tsx +1 -2
  138. package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/4.tsx +1 -2
  139. package/templates/umi-mobile-native/src/pages/demo/index.tsx +8 -7
  140. package/templates/umi-mobile-native/src/types/user.d.ts +2 -2
  141. package/templates/umi-mobile-native/tsconfig.json +9 -1
  142. package/templates/umi-mobile-native/yest.config.ts +10 -0
  143. package/templates/umi-mobile-uni-app/.eslintignore +6 -0
  144. package/templates/umi-mobile-uni-app/.eslintrc.js +8 -0
  145. package/templates/umi-mobile-uni-app/.gitignore.tpl +39 -0
  146. package/templates/umi-mobile-uni-app/.prettierignore +12 -0
  147. package/templates/umi-mobile-uni-app/.prettierrc.js +2 -0
  148. package/templates/umi-mobile-uni-app/.stylelintignore +6 -0
  149. package/templates/umi-mobile-uni-app/.stylelintrc.js +4 -0
  150. package/templates/umi-mobile-uni-app/.umirc.ts.tpl +7 -0
  151. package/templates/umi-mobile-uni-app/LICENSE +22 -0
  152. package/templates/{ice-web-screen → umi-mobile-uni-app}/README.md.tpl +5 -5
  153. package/templates/umi-mobile-uni-app/biome.json +3 -0
  154. package/templates/umi-mobile-uni-app/package.json.tpl +23 -0
  155. package/templates/umi-mobile-uni-app/src/app.tsx +18 -0
  156. package/templates/umi-mobile-uni-app/src/layouts/index.tsx +3 -0
  157. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/404.tsx +0 -1
  158. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/BarCode.tsx +0 -1
  159. package/templates/{ice-web → umi-mobile-uni-app}/src/pages/demo/examples/Iconfont.tsx +1 -2
  160. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/Input.tsx +1 -3
  161. package/templates/{ice-mobile-native → umi-mobile-uni-app}/src/pages/demo/examples/List/1.tsx +1 -2
  162. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/List/2.tsx +1 -1
  163. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/List/3.tsx +1 -1
  164. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/List/4.tsx +12 -13
  165. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/Loading.tsx +0 -1
  166. package/templates/{ice-mobile-native → umi-mobile-uni-app}/src/pages/demo/examples/NumberInput/1.tsx +1 -3
  167. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/NumberInput/2.tsx +1 -3
  168. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/NumberInput/3.tsx +1 -3
  169. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/NumberInput/4.tsx +1 -3
  170. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/PagingList/1.tsx +1 -2
  171. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/QrCode.tsx +0 -1
  172. package/templates/{ice-mobile-native → umi-mobile-uni-app}/src/pages/demo/examples/Required.tsx +0 -1
  173. package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/TimerButton.tsx +0 -1
  174. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/examples/usePreload.tsx +1 -1
  175. package/templates/{ice-mobile → umi-mobile-uni-app}/src/pages/demo/index.tsx +10 -10
  176. package/templates/{ice-mobile-native → umi-mobile-uni-app}/src/pages/index.tsx +0 -2
  177. package/templates/umi-mobile-uni-app/src/types/user.d.ts +3 -0
  178. package/templates/umi-mobile-uni-app/tsconfig.json +11 -0
  179. package/templates/umi-mobile-uni-app/typings.d.ts +1 -0
  180. package/templates/umi-mobile-uni-app/uni-app/AndroidManifest.xml +8 -0
  181. package/templates/umi-mobile-uni-app/uni-app/App.vue +28 -0
  182. package/templates/umi-mobile-uni-app/uni-app/androidPrivacy.json +22 -0
  183. package/templates/umi-mobile-uni-app/uni-app/assets/apple-app-site-association +11 -0
  184. package/templates/umi-mobile-uni-app/uni-app/common/constants.ts +5 -0
  185. package/templates/umi-mobile-uni-app/uni-app/common/request.ts +118 -0
  186. package/templates/umi-mobile-uni-app/uni-app/common/util.ts +27 -0
  187. package/templates/umi-mobile-uni-app/uni-app/components/webview/webview.vue +61 -0
  188. package/templates/umi-mobile-uni-app/uni-app/hybrid/html/error.html +24 -0
  189. package/templates/umi-mobile-uni-app/uni-app/images/index.ts +2 -0
  190. package/templates/umi-mobile-uni-app/uni-app/index.html +20 -0
  191. package/templates/{ice-mobile-native/ios/HBuilder/HBuilder.entitlements → umi-mobile-uni-app/uni-app/info.plist} +3 -2
  192. package/templates/umi-mobile-uni-app/uni-app/main.js +22 -0
  193. package/templates/umi-mobile-uni-app/uni-app/manifest.json +207 -0
  194. package/templates/umi-mobile-uni-app/uni-app/pages/index/index.vue +17 -0
  195. package/templates/umi-mobile-uni-app/uni-app/pages/webview/index.vue +19 -0
  196. package/templates/umi-mobile-uni-app/uni-app/pages.json +22 -0
  197. package/templates/umi-mobile-uni-app/uni-app/uni.promisify.adaptor.js +16 -0
  198. package/templates/umi-mobile-uni-app/uni-app/uni.scss +76 -0
  199. package/templates/umi-mobile-uni-app/yest.config.ts +10 -0
  200. package/templates/umi-web/.eslintignore +6 -0
  201. package/templates/umi-web/.eslintrc.js +8 -0
  202. package/templates/umi-web/.gitignore.tpl +9 -7
  203. package/templates/umi-web/.prettierignore +6 -2
  204. package/templates/umi-web/.prettierrc.js +2 -0
  205. package/templates/umi-web/.stylelintignore +6 -0
  206. package/templates/umi-web/.stylelintrc.js +4 -0
  207. package/templates/umi-web/.umirc.ts.tpl +1 -1
  208. package/templates/umi-web/LICENSE +18 -17
  209. package/templates/umi-web/README.md.tpl +5 -5
  210. package/templates/umi-web/biome.json +3 -0
  211. package/templates/umi-web/package.json.tpl +8 -1
  212. package/templates/umi-web/src/app.tsx +2 -3
  213. package/templates/umi-web/src/pages/404.tsx +2 -3
  214. package/templates/umi-web/src/pages/demo/examples/BankInput.tsx +1 -2
  215. package/templates/umi-web/src/pages/demo/examples/Grid/4.tsx +1 -1
  216. package/templates/umi-web/src/pages/demo/examples/Grid/5.tsx +1 -2
  217. package/templates/umi-web/src/pages/demo/examples/Input/2.tsx +2 -1
  218. package/templates/umi-web/src/pages/demo/examples/RangeNumber/2.tsx +1 -2
  219. package/templates/umi-web/src/pages/demo/examples/SearchLayout.tsx +2 -2
  220. package/templates/umi-web/src/pages/demo/examples/Wrapper.tsx +2 -2
  221. package/templates/umi-web/src/pages/demo/index.tsx +11 -9
  222. package/templates/umi-web/src/pages/index.tsx +0 -2
  223. package/templates/umi-web/src/types/user.d.ts +2 -2
  224. package/templates/umi-web/tsconfig.json +9 -1
  225. package/templates/umi-web/yest.config.ts +8 -0
  226. package/templates/umi-web-screen/.eslintignore +6 -0
  227. package/templates/umi-web-screen/.eslintrc.js +8 -0
  228. package/templates/umi-web-screen/.gitignore.tpl +9 -7
  229. package/templates/umi-web-screen/.prettierignore +6 -2
  230. package/templates/umi-web-screen/.prettierrc.js +2 -0
  231. package/templates/umi-web-screen/.stylelintignore +6 -0
  232. package/templates/umi-web-screen/.stylelintrc.js +4 -0
  233. package/templates/umi-web-screen/.umirc.ts.tpl +2 -2
  234. package/templates/umi-web-screen/LICENSE +18 -17
  235. package/templates/umi-web-screen/README.md.tpl +5 -5
  236. package/templates/umi-web-screen/biome.json +3 -0
  237. package/templates/umi-web-screen/package.json.tpl +8 -1
  238. package/templates/umi-web-screen/src/app.tsx +2 -3
  239. package/templates/umi-web-screen/src/components/resize-container/index.tsx +18 -18
  240. package/templates/umi-web-screen/src/constants.ts +4 -4
  241. package/templates/umi-web-screen/src/layouts/controller/index.tsx +6 -10
  242. package/templates/umi-web-screen/src/pages/404.tsx +2 -3
  243. package/templates/umi-web-screen/src/pages/index.tsx +0 -2
  244. package/templates/umi-web-screen/src/pages/template/components/charts/demo-line/index.tsx +2 -3
  245. package/templates/umi-web-screen/src/pages/template/controller/index.tsx +11 -12
  246. package/templates/umi-web-screen/src/types/user.d.ts +2 -2
  247. package/templates/umi-web-screen/tsconfig.json +9 -1
  248. package/templates/umi-web-screen/yest.config.ts +8 -0
  249. package/templates/ice-mobile/.eslintrc +0 -6
  250. package/templates/ice-mobile/.gitignore.tpl +0 -34
  251. package/templates/ice-mobile/.icerc.ts +0 -3
  252. package/templates/ice-mobile/.npmrc.tpl +0 -2
  253. package/templates/ice-mobile/.prettierignore +0 -9
  254. package/templates/ice-mobile/.prettierrc +0 -11
  255. package/templates/ice-mobile/.stylelintrc +0 -3
  256. package/templates/ice-mobile/README.md.tpl +0 -34
  257. package/templates/ice-mobile/package.json.tpl +0 -16
  258. package/templates/ice-mobile/public/favicon.ico +0 -0
  259. package/templates/ice-mobile/public/index.html +0 -15
  260. package/templates/ice-mobile/src/app.tsx +0 -5
  261. package/templates/ice-mobile/src/common/request.ts +0 -3
  262. package/templates/ice-mobile/src/common/util.ts +0 -7
  263. package/templates/ice-mobile/src/global.less +0 -3
  264. package/templates/ice-mobile/src/layouts/index.tsx +0 -5
  265. package/templates/ice-mobile/src/pages/404.tsx +0 -10
  266. package/templates/ice-mobile/src/pages/demo/examples/BarCode.tsx +0 -4
  267. package/templates/ice-mobile/src/pages/demo/examples/Iconfont.tsx +0 -18
  268. package/templates/ice-mobile/src/pages/demo/examples/List/1.tsx +0 -12
  269. package/templates/ice-mobile/src/pages/demo/examples/List/2.tsx +0 -29
  270. package/templates/ice-mobile/src/pages/demo/examples/List/4.tsx +0 -55
  271. package/templates/ice-mobile/src/pages/demo/examples/List/mock.ts +0 -30
  272. package/templates/ice-mobile/src/pages/demo/examples/NumberInput/1.tsx +0 -17
  273. package/templates/ice-mobile/src/pages/demo/examples/NumberInput/3.tsx +0 -17
  274. package/templates/ice-mobile/src/pages/demo/examples/QrCode.tsx +0 -4
  275. package/templates/ice-mobile/src/pages/demo/examples/Required.tsx +0 -4
  276. package/templates/ice-mobile/src/pages/demo/examples/TimerButton.tsx +0 -4
  277. package/templates/ice-mobile/src/pages/index.tsx +0 -3
  278. package/templates/ice-mobile/src/routes.ts +0 -29
  279. package/templates/ice-mobile/src/types/user.d.ts +0 -3
  280. package/templates/ice-mobile/tsconfig.json +0 -3
  281. package/templates/ice-mobile/typings.d.ts +0 -1
  282. package/templates/ice-mobile-h5+app/.eslintrc +0 -6
  283. package/templates/ice-mobile-h5+app/.gitignore.tpl +0 -34
  284. package/templates/ice-mobile-h5+app/.icerc.ts +0 -6
  285. package/templates/ice-mobile-h5+app/.prettierignore +0 -9
  286. package/templates/ice-mobile-h5+app/.prettierrc +0 -11
  287. package/templates/ice-mobile-h5+app/.stylelintrc +0 -3
  288. package/templates/ice-mobile-h5+app/h5+app/manifest.json +0 -87
  289. package/templates/ice-mobile-h5+app/package.json.tpl +0 -16
  290. package/templates/ice-mobile-h5+app/public/index.html +0 -15
  291. package/templates/ice-mobile-h5+app/src/app.tsx +0 -5
  292. package/templates/ice-mobile-h5+app/src/layouts/index.tsx +0 -5
  293. package/templates/ice-mobile-h5+app/src/pages/demo/examples/Iconfont.tsx +0 -18
  294. package/templates/ice-mobile-h5+app/src/pages/demo/examples/Input.tsx +0 -17
  295. package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/1.tsx +0 -12
  296. package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/3.tsx +0 -29
  297. package/templates/ice-mobile-h5+app/src/pages/demo/examples/Loading.tsx +0 -12
  298. package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/1.tsx +0 -17
  299. package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/2.tsx +0 -17
  300. package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/4.tsx +0 -17
  301. package/templates/ice-mobile-h5+app/src/pages/demo/examples/PagingList/1.tsx +0 -6
  302. package/templates/ice-mobile-h5+app/src/pages/demo/examples/Required.tsx +0 -4
  303. package/templates/ice-mobile-h5+app/src/pages/demo/examples/usePreload.tsx +0 -9
  304. package/templates/ice-mobile-h5+app/src/pages/demo/index.tsx +0 -87
  305. package/templates/ice-mobile-h5+app/src/pages/index.tsx +0 -3
  306. package/templates/ice-mobile-h5+app/src/routes.ts +0 -29
  307. package/templates/ice-mobile-h5+app/src/types/user.d.ts +0 -3
  308. package/templates/ice-mobile-h5+app/tsconfig.json +0 -3
  309. package/templates/ice-mobile-h5+app/typings.d.ts +0 -1
  310. package/templates/ice-mobile-native/.eslintrc +0 -6
  311. package/templates/ice-mobile-native/.gitignore.tpl +0 -39
  312. package/templates/ice-mobile-native/.icerc.ts +0 -8
  313. package/templates/ice-mobile-native/.prettierignore +0 -9
  314. package/templates/ice-mobile-native/.prettierrc +0 -11
  315. package/templates/ice-mobile-native/.stylelintrc +0 -3
  316. package/templates/ice-mobile-native/README.md.tpl +0 -34
  317. package/templates/ice-mobile-native/android/app/6209ba977ffec7d62675a4e254ebc209.keystore +0 -0
  318. package/templates/ice-mobile-native/android/app/build.gradle +0 -66
  319. package/templates/ice-mobile-native/android/app/libs/Bluetooth-release.aar +0 -0
  320. package/templates/ice-mobile-native/android/app/libs/PosPrinterSDK.jar +0 -0
  321. package/templates/ice-mobile-native/android/app/libs/android-gif-drawable-release@1.2.23.aar +0 -0
  322. package/templates/ice-mobile-native/android/app/libs/lib.5plus.base-release.aar +0 -0
  323. package/templates/ice-mobile-native/android/app/libs/oaid_sdk_1.0.25.aar +0 -0
  324. package/templates/ice-mobile-native/android/app/libs/webview-x5-release.aar +0 -0
  325. package/templates/ice-mobile-native/android/app/proguard-rules.pro +0 -303
  326. package/templates/ice-mobile-native/android/app/src/main/AndroidManifest.xml +0 -98
  327. package/templates/ice-mobile-native/android/app/src/main/assets/apps/H5ECA1DEE/www/manifest.json +0 -89
  328. package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_control.xml +0 -6
  329. package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_error.html +0 -92
  330. package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_properties.xml +0 -19
  331. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/JSBridge/FunctionCreator.java +0 -119
  332. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/MPandoraEntryActivity.java +0 -17
  333. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/FunctionFactory/Creator.java +0 -17
  334. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/FunctionFactory/Error.java +0 -26
  335. package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/JSPlugin.java +0 -265
  336. package/templates/ice-mobile-native/android/app/src/main/res/drawable/icon.png +0 -0
  337. package/templates/ice-mobile-native/android/app/src/main/res/values/colors.xml +0 -5
  338. package/templates/ice-mobile-native/android/app/src/main/res/values/strings.xml +0 -3
  339. package/templates/ice-mobile-native/android/build.gradle +0 -9
  340. package/templates/ice-mobile-native/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  341. package/templates/ice-mobile-native/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  342. package/templates/ice-mobile-native/android/gradle.properties +0 -22
  343. package/templates/ice-mobile-native/android/gradlew +0 -185
  344. package/templates/ice-mobile-native/android/gradlew.bat +0 -89
  345. package/templates/ice-mobile-native/android/settings.gradle +0 -16
  346. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/1024x1024.png +0 -0
  347. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/120x120-1.png +0 -0
  348. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/120x120.png +0 -0
  349. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/180x180.png +0 -0
  350. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/40x40.png +0 -0
  351. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/58x58.png +0 -0
  352. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/60x60.png +0 -0
  353. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/80x80.png +0 -0
  354. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/87x87.png +0 -0
  355. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/Contents.json +0 -62
  356. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/Contents.json +0 -6
  357. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/Image.imageset/Contents.json +0 -20
  358. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/120x120.png +0 -0
  359. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/180x180.png +0 -0
  360. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/60x60.png +0 -0
  361. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/Contents.json +0 -26
  362. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/control_brightness.imageset/Contents.json +0 -21
  363. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/control_brightness.imageset/brightness@2x.png +0 -0
  364. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/Contents.json +0 -22
  365. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/shrinkscreen@2x.png +0 -0
  366. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/shrinkscreen@3x.png +0 -0
  367. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset/Contents.json +0 -22
  368. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset//346/233/235/345/205/211-1.png +0 -0
  369. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset//346/233/235/345/205/211.png +0 -0
  370. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset/Contents.json +0 -22
  371. 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
  372. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset//345/257/271/347/204/246/346/241/206.png +0 -0
  373. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_line.imageset/Contents.json +0 -21
  374. 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
  375. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_thumb.imageset/Contents.json +0 -22
  376. 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
  377. 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
  378. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/Contents.json +0 -22
  379. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/fullscreen@2x.png +0 -0
  380. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/fullscreen@3x.png +0 -0
  381. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/Contents.json +0 -23
  382. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play.png +0 -0
  383. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play@2x.png +0 -0
  384. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play@3x.png +0 -0
  385. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/Contents.json +0 -23
  386. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back.png +0 -0
  387. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back@2x.png +0 -0
  388. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back@3x.png +0 -0
  389. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/Contents.json +0 -23
  390. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play.png +0 -0
  391. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play@2x.png +0 -0
  392. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play@3x.png +0 -0
  393. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/Contents.json +0 -23
  394. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop.png +0 -0
  395. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop@2x.png +0 -0
  396. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop@3x.png +0 -0
  397. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/Contents.json +0 -22
  398. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/video_ic_muteoff@2x.png +0 -0
  399. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/video_ic_muteoff@3x.png +0 -0
  400. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/Contents.json +0 -22
  401. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/video_ic_muteon@2x.png +0 -0
  402. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/video_ic_muteon@3x.png +0 -0
  403. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/Contents.json +0 -22
  404. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/video_volume@2x.png +0 -0
  405. package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/video_volume@3x.png +0 -0
  406. package/templates/ice-mobile-native/ios/HBuilder-Hello/120x120.png +0 -0
  407. package/templates/ice-mobile-native/ios/HBuilder-Hello/180x180.png +0 -0
  408. package/templates/ice-mobile-native/ios/HBuilder-Hello/AppDelegate.h +0 -16
  409. package/templates/ice-mobile-native/ios/HBuilder-Hello/AppDelegate.m +0 -225
  410. package/templates/ice-mobile-native/ios/HBuilder-Hello/Base.lproj/LaunchScreen.storyboard +0 -65
  411. package/templates/ice-mobile-native/ios/HBuilder-Hello/English.lproj/Localizable.strings +0 -13
  412. package/templates/ice-mobile-native/ios/HBuilder-Hello/HBuilder-Hello-Info.plist +0 -486
  413. package/templates/ice-mobile-native/ios/HBuilder-Hello/HBuilder-Hello-Prefix.pch +0 -16
  414. package/templates/ice-mobile-native/ios/HBuilder-Hello/LaunchScreen.storyboard +0 -67
  415. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/manifest.json +0 -79
  416. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/1024x1024.png +0 -0
  417. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/120x120.png +0 -0
  418. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/144x144.png +0 -0
  419. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/152x152.png +0 -0
  420. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/167x167.png +0 -0
  421. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/180x180.png +0 -0
  422. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/192x192.png +0 -0
  423. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/20x20.png +0 -0
  424. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/29x29.png +0 -0
  425. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/40x40.png +0 -0
  426. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/58x58.png +0 -0
  427. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/60x60.png +0 -0
  428. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/72x72.png +0 -0
  429. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/76x76.png +0 -0
  430. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/80x80.png +0 -0
  431. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/87x87.png +0 -0
  432. package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/96x96.png +0 -0
  433. package/templates/ice-mobile-native/ios/HBuilder-Hello/ViewController.h +0 -19
  434. package/templates/ice-mobile-native/ios/HBuilder-Hello/ViewController.m +0 -161
  435. package/templates/ice-mobile-native/ios/HBuilder-Hello/Xprinter.h +0 -19
  436. package/templates/ice-mobile-native/ios/HBuilder-Hello/Xprinter.m +0 -235
  437. package/templates/ice-mobile-native/ios/HBuilder-Hello/control.xml +0 -107
  438. package/templates/ice-mobile-native/ios/HBuilder-Hello/en.lproj/InfoPlist.strings +0 -4
  439. package/templates/ice-mobile-native/ios/HBuilder-Hello/en.lproj/Localizable.strings +0 -12
  440. package/templates/ice-mobile-native/ios/HBuilder-Hello/main.m +0 -18
  441. package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/InfoPlist.strings +0 -4
  442. package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/LaunchScreen.strings +0 -3
  443. package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/Localizable.strings +0 -13
  444. package/templates/ice-mobile-native/ios/HBuilder-Hello.xcodeproj/project.pbxproj +0 -1607
  445. package/templates/ice-mobile-native/package.json.tpl +0 -16
  446. package/templates/ice-mobile-native/public/favicon.ico +0 -0
  447. package/templates/ice-mobile-native/public/index.html +0 -15
  448. package/templates/ice-mobile-native/src/app.tsx +0 -5
  449. package/templates/ice-mobile-native/src/common/Xprinter.ts +0 -58
  450. package/templates/ice-mobile-native/src/common/bluetooth.ts +0 -354
  451. package/templates/ice-mobile-native/src/common/bridge.ts +0 -59
  452. package/templates/ice-mobile-native/src/common/request.ts +0 -3
  453. package/templates/ice-mobile-native/src/common/util.ts +0 -7
  454. package/templates/ice-mobile-native/src/global.less +0 -3
  455. package/templates/ice-mobile-native/src/layouts/index.tsx +0 -5
  456. package/templates/ice-mobile-native/src/pages/404.tsx +0 -10
  457. package/templates/ice-mobile-native/src/pages/demo/examples/BarCode.tsx +0 -4
  458. package/templates/ice-mobile-native/src/pages/demo/examples/Iconfont.tsx +0 -18
  459. package/templates/ice-mobile-native/src/pages/demo/examples/Input.tsx +0 -17
  460. package/templates/ice-mobile-native/src/pages/demo/examples/List/2.tsx +0 -29
  461. package/templates/ice-mobile-native/src/pages/demo/examples/List/3.tsx +0 -29
  462. package/templates/ice-mobile-native/src/pages/demo/examples/List/4.tsx +0 -55
  463. package/templates/ice-mobile-native/src/pages/demo/examples/List/mock.ts +0 -30
  464. package/templates/ice-mobile-native/src/pages/demo/examples/Loading.tsx +0 -12
  465. package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/2.tsx +0 -17
  466. package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/3.tsx +0 -17
  467. package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/4.tsx +0 -17
  468. package/templates/ice-mobile-native/src/pages/demo/examples/PagingList/1.tsx +0 -6
  469. package/templates/ice-mobile-native/src/pages/demo/examples/QrCode.tsx +0 -4
  470. package/templates/ice-mobile-native/src/pages/demo/examples/TimerButton.tsx +0 -4
  471. package/templates/ice-mobile-native/src/pages/demo/examples/Xprinter/index.tsx +0 -64
  472. package/templates/ice-mobile-native/src/pages/demo/examples/Xprinter/style.less +0 -16
  473. package/templates/ice-mobile-native/src/pages/demo/examples/usePreload.tsx +0 -9
  474. package/templates/ice-mobile-native/src/pages/demo/index.tsx +0 -89
  475. package/templates/ice-mobile-native/src/routes.ts +0 -29
  476. package/templates/ice-mobile-native/src/types/user.d.ts +0 -3
  477. package/templates/ice-mobile-native/tsconfig.json +0 -3
  478. package/templates/ice-mobile-native/typings.d.ts +0 -1
  479. package/templates/ice-web/.eslintrc +0 -6
  480. package/templates/ice-web/.gitignore.tpl +0 -34
  481. package/templates/ice-web/.icerc.ts +0 -3
  482. package/templates/ice-web/.npmrc.tpl +0 -2
  483. package/templates/ice-web/.prettierignore +0 -9
  484. package/templates/ice-web/.prettierrc +0 -11
  485. package/templates/ice-web/.stylelintrc +0 -3
  486. package/templates/ice-web/README.md.tpl +0 -34
  487. package/templates/ice-web/package.json.tpl +0 -16
  488. package/templates/ice-web/public/favicon.ico +0 -0
  489. package/templates/ice-web/public/index.html +0 -15
  490. package/templates/ice-web/src/app.tsx +0 -5
  491. package/templates/ice-web/src/common/request.ts +0 -3
  492. package/templates/ice-web/src/common/util.ts +0 -7
  493. package/templates/ice-web/src/components/index.ts +0 -0
  494. package/templates/ice-web/src/global.less +0 -5
  495. package/templates/ice-web/src/layouts/index.tsx +0 -5
  496. package/templates/ice-web/src/pages/404.tsx +0 -17
  497. package/templates/ice-web/src/pages/demo/examples/BankInput.tsx +0 -13
  498. package/templates/ice-web/src/pages/demo/examples/BarCode.tsx +0 -4
  499. package/templates/ice-web/src/pages/demo/examples/Collapse.tsx +0 -4
  500. package/templates/ice-web/src/pages/demo/examples/DatePicker.tsx +0 -4
  501. package/templates/ice-web/src/pages/demo/examples/Flex.tsx +0 -10
  502. package/templates/ice-web/src/pages/demo/examples/Grid/1.tsx +0 -25
  503. package/templates/ice-web/src/pages/demo/examples/Grid/2.tsx +0 -26
  504. package/templates/ice-web/src/pages/demo/examples/Grid/3.tsx +0 -37
  505. package/templates/ice-web/src/pages/demo/examples/Grid/4.tsx +0 -43
  506. package/templates/ice-web/src/pages/demo/examples/Grid/5.tsx +0 -36
  507. package/templates/ice-web/src/pages/demo/examples/Grid/6.tsx +0 -28
  508. package/templates/ice-web/src/pages/demo/examples/ImagePreview.tsx +0 -20
  509. package/templates/ice-web/src/pages/demo/examples/Input/1.tsx +0 -4
  510. package/templates/ice-web/src/pages/demo/examples/Input/2.tsx +0 -80
  511. package/templates/ice-web/src/pages/demo/examples/LinkButton/1.tsx +0 -4
  512. package/templates/ice-web/src/pages/demo/examples/LinkButton/2.tsx +0 -9
  513. package/templates/ice-web/src/pages/demo/examples/LinkButton/3.tsx +0 -12
  514. package/templates/ice-web/src/pages/demo/examples/Loading.tsx +0 -12
  515. package/templates/ice-web/src/pages/demo/examples/MobileInput.tsx +0 -4
  516. package/templates/ice-web/src/pages/demo/examples/NumberInput.tsx +0 -4
  517. package/templates/ice-web/src/pages/demo/examples/PagingTable.tsx +0 -21
  518. package/templates/ice-web/src/pages/demo/examples/QrCode.tsx +0 -4
  519. package/templates/ice-web/src/pages/demo/examples/RangeNumber/1.tsx +0 -4
  520. package/templates/ice-web/src/pages/demo/examples/RangeNumber/2.tsx +0 -15
  521. package/templates/ice-web/src/pages/demo/examples/Required.tsx +0 -4
  522. package/templates/ice-web/src/pages/demo/examples/SearchLayout.tsx +0 -46
  523. package/templates/ice-web/src/pages/demo/examples/Table/1.tsx +0 -64
  524. package/templates/ice-web/src/pages/demo/examples/Table/2.tsx +0 -29
  525. package/templates/ice-web/src/pages/demo/examples/Table/3.tsx +0 -39
  526. package/templates/ice-web/src/pages/demo/examples/Table/4.tsx +0 -42
  527. package/templates/ice-web/src/pages/demo/examples/TimerButton.tsx +0 -4
  528. package/templates/ice-web/src/pages/demo/examples/Title/1.tsx +0 -4
  529. package/templates/ice-web/src/pages/demo/examples/Title/2.tsx +0 -5
  530. package/templates/ice-web/src/pages/demo/examples/WaterMark.tsx +0 -8
  531. package/templates/ice-web/src/pages/demo/examples/Wrapper.tsx +0 -40
  532. package/templates/ice-web/src/pages/demo/examples/usePreload.tsx +0 -9
  533. package/templates/ice-web/src/pages/demo/index.tsx +0 -135
  534. package/templates/ice-web/src/pages/index.tsx +0 -3
  535. package/templates/ice-web/src/routes.ts +0 -29
  536. package/templates/ice-web/src/types/user.d.ts +0 -3
  537. package/templates/ice-web/tsconfig.json +0 -3
  538. package/templates/ice-web/typings.d.ts +0 -1
  539. package/templates/ice-web-screen/.eslintrc +0 -6
  540. package/templates/ice-web-screen/.gitignore.tpl +0 -34
  541. package/templates/ice-web-screen/.icerc.ts +0 -3
  542. package/templates/ice-web-screen/.npmrc.tpl +0 -2
  543. package/templates/ice-web-screen/.prettierignore +0 -9
  544. package/templates/ice-web-screen/.prettierrc +0 -11
  545. package/templates/ice-web-screen/.stylelintrc +0 -3
  546. package/templates/ice-web-screen/package.json.tpl +0 -17
  547. package/templates/ice-web-screen/public/favicon.ico +0 -0
  548. package/templates/ice-web-screen/public/index.html +0 -15
  549. package/templates/ice-web-screen/src/app.tsx +0 -5
  550. package/templates/ice-web-screen/src/common/request.ts +0 -3
  551. package/templates/ice-web-screen/src/common/util.ts +0 -15
  552. package/templates/ice-web-screen/src/components/index.ts +0 -1
  553. package/templates/ice-web-screen/src/components/resize-container/index.tsx +0 -95
  554. package/templates/ice-web-screen/src/components/resize-container/style.module.less +0 -3
  555. package/templates/ice-web-screen/src/constants.ts +0 -7
  556. package/templates/ice-web-screen/src/global.less +0 -31
  557. package/templates/ice-web-screen/src/hooks/use-size.ts +0 -18
  558. package/templates/ice-web-screen/src/layouts/16_9/fixed.less +0 -18
  559. package/templates/ice-web-screen/src/layouts/16_9/index.tsx +0 -34
  560. package/templates/ice-web-screen/src/layouts/16_9/style.module.less +0 -19
  561. package/templates/ice-web-screen/src/layouts/components/index.ts +0 -0
  562. package/templates/ice-web-screen/src/layouts/controller/index.tsx +0 -79
  563. package/templates/ice-web-screen/src/layouts/index.tsx +0 -11
  564. package/templates/ice-web-screen/src/pages/404.tsx +0 -17
  565. package/templates/ice-web-screen/src/pages/index.tsx +0 -3
  566. package/templates/ice-web-screen/src/pages/template/16_9/index.tsx +0 -13
  567. package/templates/ice-web-screen/src/pages/template/16_9/style.module.less +0 -7
  568. package/templates/ice-web-screen/src/pages/template/components/charts/demo-line/index.tsx +0 -274
  569. package/templates/ice-web-screen/src/pages/template/components/charts/index.ts +0 -1
  570. package/templates/ice-web-screen/src/pages/template/components/index.ts +0 -1
  571. package/templates/ice-web-screen/src/pages/template/controller/index.tsx +0 -85
  572. package/templates/ice-web-screen/src/pages/template/index.tsx +0 -15
  573. package/templates/ice-web-screen/src/pages/template/style.module.less +0 -3
  574. package/templates/ice-web-screen/src/routes.ts +0 -29
  575. package/templates/ice-web-screen/src/styles/vars.less +0 -5
  576. package/templates/ice-web-screen/src/types/user.d.ts +0 -3
  577. package/templates/ice-web-screen/tsconfig.json +0 -3
  578. package/templates/ice-web-screen/typings.d.ts +0 -1
  579. package/templates/miniprogram/.editorconfig +0 -12
  580. package/templates/miniprogram/.eslintrc +0 -6
  581. package/templates/miniprogram/.npmrc.tpl +0 -2
  582. package/templates/miniprogram/.prettierignore +0 -5
  583. package/templates/miniprogram/.prettierrc +0 -12
  584. package/templates/miniprogram/.stylelintrc +0 -3
  585. package/templates/miniprogram/LICENSE +0 -21
  586. package/templates/miniprogram/README.md.tpl +0 -34
  587. package/templates/miniprogram/global.d.ts +0 -33
  588. package/templates/miniprogram/src/app.scss +0 -2
  589. package/templates/miniprogram/src/components/index.ts +0 -0
  590. package/templates/miniprogram/src/constants.ts +0 -1
  591. package/templates/miniprogram/src/hooks/index.ts +0 -0
  592. package/templates/miniprogram/src/pages/demo/examples/Input.tsx +0 -3
  593. package/templates/miniprogram/src/pages/demo/examples/Textarea.tsx +0 -3
  594. package/templates/miniprogram/src/pages/demo/index.module.scss.d.ts +0 -5
  595. package/templates/miniprogram/src/pages/index/index.module.scss.d.ts +0 -5
  596. package/templates/miniprogram/src/types/user.d.ts +0 -3
  597. package/templates/miniprogram/tsconfig.json +0 -28
  598. package/templates/umi-mobile/.eslintrc +0 -6
  599. package/templates/umi-mobile/.prettierrc +0 -11
  600. package/templates/umi-mobile/.stylelintrc +0 -3
  601. package/templates/umi-mobile-h5+app/.eslintrc +0 -6
  602. package/templates/umi-mobile-h5+app/.prettierrc +0 -11
  603. package/templates/umi-mobile-h5+app/.stylelintrc +0 -3
  604. package/templates/umi-mobile-native/.eslintrc +0 -6
  605. package/templates/umi-mobile-native/.prettierrc +0 -11
  606. package/templates/umi-mobile-native/.stylelintrc +0 -3
  607. package/templates/umi-web/.eslintrc +0 -6
  608. package/templates/umi-web/.prettierrc +0 -11
  609. package/templates/umi-web/.stylelintrc +0 -3
  610. package/templates/umi-web-screen/.eslintrc +0 -6
  611. package/templates/umi-web-screen/.prettierrc +0 -11
  612. package/templates/umi-web-screen/.stylelintrc +0 -3
  613. /package/templates/{ice-mobile-h5+app → taro-miniprogram}/.npmrc.tpl +0 -0
  614. /package/templates/{miniprogram → taro-miniprogram}/babel.config.js +0 -0
  615. /package/templates/{miniprogram → taro-miniprogram}/project.tt.json.tpl +0 -0
  616. /package/templates/{miniprogram → taro-miniprogram}/src/common/request.ts +0 -0
  617. /package/templates/{miniprogram → taro-miniprogram}/src/common/util.ts +0 -0
  618. /package/templates/{ice-mobile-h5+app → taro-miniprogram}/src/components/index.ts +0 -0
  619. /package/templates/{ice-mobile-native/src/components → taro-miniprogram/src/hooks}/index.ts +0 -0
  620. /package/templates/{miniprogram → taro-miniprogram}/src/images/empty.gif +0 -0
  621. /package/templates/{miniprogram → taro-miniprogram}/src/index.html +0 -0
  622. /package/templates/{miniprogram/src/pages/demo/index.module.scss → taro-miniprogram/src/pages/demo/style.scss} +0 -0
  623. /package/templates/{miniprogram/src/pages/index/index.module.scss → taro-miniprogram/src/pages/index/style.scss} +0 -0
  624. /package/templates/{miniprogram → taro-miniprogram}/src/theme.scss +0 -0
  625. /package/templates/{ice-mobile-native → umi-mobile-uni-app}/.npmrc.tpl +0 -0
  626. /package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/public/favicon.ico +0 -0
  627. /package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/common/request.ts +0 -0
  628. /package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/common/util.ts +0 -0
  629. /package/templates/{ice-mobile → umi-mobile-uni-app}/src/components/index.ts +0 -0
  630. /package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/global.less +0 -0
  631. /package/templates/{ice-mobile-h5+app → umi-mobile-uni-app}/src/pages/demo/examples/List/mock.ts +0 -0
@@ -0,0 +1,431 @@
1
+ /**
2
+ * Clears all cached templates in this writer.
3
+ */
4
+ export declare function clearCache(): void;
5
+
6
+ export declare type COMMENT = "!";
7
+
8
+ /**
9
+ * Represents a rendering context by wrapping a view object and maintaining a reference to the parent context.
10
+ */
11
+ export declare class Context {
12
+ view: any;
13
+ parent: Context | undefined;
14
+
15
+ /**
16
+ * Initializes a new instance of the {@link Context `Context`} class.
17
+ */
18
+ constructor(view: any, parentContext?: Context);
19
+
20
+ /**
21
+ * Creates a new context using the given view with this context as the parent.
22
+ *
23
+ * @param view
24
+ * The view to create the new context with.
25
+ */
26
+ push(view: any): Context;
27
+
28
+ /**
29
+ * Returns the value of the given name in this context, traversing up the context hierarchy if the value is absent in this context's view.
30
+ *
31
+ * @param name
32
+ * The name to look up.
33
+ */
34
+ lookup(name: string): any;
35
+ }
36
+
37
+ export declare type EQUAL = "=";
38
+
39
+ /**
40
+ * HTML escaping by default, can be overridden by setting Mustache.escape explicitly or providing the `options`
41
+ * argument with an `escape` function when invoking {@link render `Mustache.render()`}.
42
+ *
43
+ * Escaping can be avoided when needed by using `{{{ value }}}` or `{{& value }}` in templates.
44
+ *
45
+ * @param value
46
+ * The value to escape into a string.
47
+ */
48
+ declare let escape_2: EscapeFunction;
49
+ export { escape_2 as escape }
50
+
51
+ export declare type ESCAPED_VALUE = "name";
52
+
53
+ /**
54
+ * Function responsible for escaping values from the view into the rendered output when templates
55
+ * has `{{ value }}` in them.
56
+ */
57
+ export declare type EscapeFunction = (value: any) => string;
58
+
59
+ export declare type INVERTED = "^";
60
+
61
+ /**
62
+ * The name of the module.
63
+ */
64
+ declare const name_2: string;
65
+ export { name_2 as name }
66
+
67
+ /**
68
+ * An array of two strings, representing the opening and closing tags respectively, to be used in the templates being rendered.
69
+ */
70
+ export declare type OpeningAndClosingTags = [string, string];
71
+
72
+ /**
73
+ * Parses and caches the given template in the default writer and returns the array of tokens it contains.
74
+ *
75
+ * Doing this ahead of time avoids the need to parse templates on the fly as they are rendered.
76
+ *
77
+ * @param template
78
+ * The template to parse.
79
+ *
80
+ * @param tags
81
+ * The tags to use.
82
+ */
83
+ export declare function parse(template: string, tags?: OpeningAndClosingTags): TemplateSpans;
84
+
85
+ export declare type PARTIAL = ">";
86
+
87
+ export declare type PartialLookupFn = (partialName: string) => string | undefined;
88
+
89
+ /**
90
+ * Whenever partials are provided, it can either be an object that contains the names and templates of partials that are used in templates
91
+ *
92
+ * -- or --
93
+ *
94
+ * A function that is used to load partial template on the fly that takes a single argument: the name of the partial.
95
+ */
96
+ export declare type PartialsOrLookupFn = Record<string, string> | PartialLookupFn;
97
+
98
+ export declare type RAW_VALUE = "text";
99
+
100
+ /**
101
+ * Renders the {@link template `template`} with the given {@link view `view`} and {@link partials `partials`} using the default writer.
102
+ *
103
+ * @param template
104
+ * The template to render.
105
+ *
106
+ * @param view
107
+ * The view to render the template with.
108
+ *
109
+ * @param partials
110
+ * Either an object that contains the names and templates of partials that are used in a template
111
+ *
112
+ * -- or --
113
+ *
114
+ * A function that is used to load partial template on the fly that takes a single argument: the name of the partial.
115
+ *
116
+ * @param tagsOrOptions
117
+ * The delimiter tags to use or options overriding global defaults.
118
+ */
119
+ export declare function render(
120
+ template: string,
121
+ view: any | Context,
122
+ partials?: PartialsOrLookupFn,
123
+ tagsOrOptions?: OpeningAndClosingTags | RenderOptions,
124
+ ): string;
125
+
126
+ export declare interface RenderOptions {
127
+ escape?: EscapeFunction | undefined;
128
+ tags?: OpeningAndClosingTags | undefined;
129
+ }
130
+
131
+ /**
132
+ * A simple string scanner that is used by the template parser to find tokens in template strings.
133
+ */
134
+ export declare class Scanner {
135
+ string: string;
136
+ tail: string;
137
+ pos: number;
138
+
139
+ /**
140
+ * Initializes a new instance of the {@link Scanner `Scanner`} class.
141
+ */
142
+ constructor(string: string);
143
+
144
+ /**
145
+ * Returns `true` if the tail is empty (end of string).
146
+ */
147
+ eos(): boolean;
148
+
149
+ /**
150
+ * Tries to match the given regular expression at the current position.
151
+ *
152
+ * @param re
153
+ * The regex-pattern to match.
154
+ *
155
+ * @returns
156
+ * The matched text if it can match, the empty string otherwise.
157
+ */
158
+ scan(re: RegExp): string;
159
+
160
+ /**
161
+ * Skips all text until the given regular expression can be matched.
162
+ *
163
+ * @param re
164
+ * The regex-pattern to match.
165
+ *
166
+ * @returns
167
+ * Returns the skipped string, which is the entire tail if no match can be made.
168
+ */
169
+ scanUntil(re: RegExp): string;
170
+ }
171
+
172
+ export declare type SECTION = "#";
173
+
174
+ /**
175
+ * The default opening and closing tags used while parsing the templates.
176
+ *
177
+ * Different default tags can be overridden by setting this field. They will have effect on all subsequent
178
+ * calls to {@link render `.render()`} or {@link parse `.parse()`}, unless custom tags are given as arguments to those functions.
179
+ *
180
+ * Default value is `[ "{{", "}}" ]`.
181
+ */
182
+ export declare let tags: OpeningAndClosingTags;
183
+
184
+ export declare interface TemplateCache {
185
+ set(cacheKey: string, value: string): void;
186
+ get(cacheKey: string): string | undefined;
187
+ clear(): void;
188
+ }
189
+
190
+ /**
191
+ * Customise the template caching behaviour by either:
192
+ *
193
+ * disable it completely by setting it to `undefined`
194
+ *
195
+ * -- or --
196
+ *
197
+ * provide a custom cache strategy that satisfies the {@link TemplateCache `TemplateCache`} interface
198
+ */
199
+ export declare let templateCache: TemplateCache | undefined;
200
+
201
+ export declare type TemplateSpans = Array<
202
+ | [TemplateSpanType, string, number, number]
203
+ | [TemplateSpanType, string, number, number, TemplateSpans, number]
204
+ | [TemplateSpanType, string, number, number, string, number, boolean]
205
+ >;
206
+
207
+ export declare type TemplateSpanType =
208
+ | RAW_VALUE
209
+ | ESCAPED_VALUE
210
+ | SECTION
211
+ | UNESCAPED_VALUE
212
+ | INVERTED
213
+ | COMMENT
214
+ | PARTIAL
215
+ | EQUAL;
216
+
217
+ export declare type UNESCAPED_VALUE = "&";
218
+
219
+ /**
220
+ * The version of the module.
221
+ */
222
+ export declare const version: string;
223
+
224
+ /**
225
+ * A Writer knows how to take a stream of tokens and render them to a {@link String `string`}, given a context.
226
+ *
227
+ * It also maintains a cache of templates to avoid the need to parse the same template twice.
228
+ */
229
+ export declare class Writer {
230
+ /**
231
+ * Initializes a new instance of the {@link Writer `Writer`} class.
232
+ */
233
+ constructor();
234
+
235
+ /**
236
+ * Clears all cached templates in this writer.
237
+ */
238
+ clearCache(): void;
239
+
240
+ /**
241
+ * Parses and caches the given {@link template `template`} and returns the array of tokens that is generated from the parse.
242
+ *
243
+ * @param template
244
+ * The template to parse.
245
+ *
246
+ * @param tags
247
+ * The tags to use.
248
+ */
249
+ parse(template: string, tags?: OpeningAndClosingTags): any;
250
+
251
+ /**
252
+ * High-level method that is used to render the given {@link template `template`} with the given {@link view `view`}.
253
+ *
254
+ * @param template
255
+ * The template to render.
256
+ *
257
+ * @param view
258
+ * The view to render the template with.
259
+ *
260
+ * @param partials
261
+ * Either an object that contains the names and templates of partials that are used in a template
262
+ *
263
+ * -- or --
264
+ *
265
+ * A function that is used to load partial template on the fly that takes a single argument: the name of the partial.
266
+ *
267
+ * @param config
268
+ * The options for the rendering process.
269
+ */
270
+ render(
271
+ template: string,
272
+ view: any | Context,
273
+ partials?: PartialsOrLookupFn,
274
+ config?: OpeningAndClosingTags | RenderOptions,
275
+ ): string;
276
+
277
+ /**
278
+ * Low-level method that renders the given array of {@link tokens `tokens`} using the given {@link context `context`} and {@link partials `partials`}.
279
+ *
280
+ * @param tokens
281
+ * The tokens to render.
282
+ *
283
+ * @param context
284
+ * The context to use for rendering the tokens.
285
+ *
286
+ * @param partials
287
+ * The partials to use for rendering the tokens.
288
+ *
289
+ * @param originalTemplate
290
+ * An object used to extract the portion of the original template that was contained in a higher-order section.
291
+ *
292
+ * If the template doesn't use higher-order sections, this argument may be omitted.
293
+ *
294
+ * @param config
295
+ * The options for the rendering process.
296
+ */
297
+ renderTokens(
298
+ tokens: string[][],
299
+ context: Context,
300
+ partials?: PartialsOrLookupFn,
301
+ originalTemplate?: string,
302
+ config?: RenderOptions,
303
+ ): string;
304
+
305
+ /**
306
+ * Renders a section block.
307
+ *
308
+ * @param token
309
+ * The token to render.
310
+ *
311
+ * @param context
312
+ * The context to use for rendering the token.
313
+ *
314
+ * @param partials
315
+ * The partials to use for rendering the token.
316
+ *
317
+ * @param originalTemplate
318
+ * An object used to extract the portion of the original template that was contained in a higher-order section.
319
+ *
320
+ * @param config
321
+ * The options for the rendering process.
322
+ */
323
+ renderSection(
324
+ token: string[],
325
+ context: Context,
326
+ partials?: PartialsOrLookupFn,
327
+ originalTemplate?: string,
328
+ config?: RenderOptions,
329
+ ): string;
330
+
331
+ /**
332
+ * Renders an inverted section block.
333
+ *
334
+ * @param token
335
+ * The token to render.
336
+ *
337
+ * @param context
338
+ * The context to use for rendering the token.
339
+ *
340
+ * @param partials
341
+ * The partials to use for rendering the token.
342
+ *
343
+ * @param originalTemplate
344
+ * An object used to extract the portion of the original template that was contained in a higher-order section.
345
+ *
346
+ * @param config
347
+ * The options for the rendering process.
348
+ */
349
+ renderInverted(
350
+ token: string[],
351
+ context: Context,
352
+ partials?: PartialsOrLookupFn,
353
+ originalTemplate?: string,
354
+ config?: RenderOptions,
355
+ ): string;
356
+
357
+ /**
358
+ * Adds indentation to each line of the given partial.
359
+ *
360
+ * @param partial
361
+ * The partial to indent.
362
+ *
363
+ * @param indentation
364
+ * String containing a combination of spaces and tabs to use as indentation.
365
+ *
366
+ * @param lineHasNonSpace
367
+ * Whether to indent lines that are empty.
368
+ */
369
+ indentPartial(partial: string, indentation: string, lineHasNonSpace: boolean): string;
370
+
371
+ /**
372
+ * Renders a partial.
373
+ *
374
+ * @param token
375
+ * The token to render.
376
+ *
377
+ * @param context
378
+ * The context to use for rendering the token.
379
+ *
380
+ * @param partials
381
+ * The partials to use for rendering the token.
382
+ *
383
+ * @param config
384
+ * The options for the rendering process.
385
+ */
386
+ renderPartial(
387
+ token: string[],
388
+ context: Context,
389
+ partials?: PartialsOrLookupFn,
390
+ config?: OpeningAndClosingTags | RenderOptions,
391
+ ): string;
392
+
393
+ /**
394
+ * Renders an unescaped value.
395
+ *
396
+ * @param token
397
+ * The token to render.
398
+ *
399
+ * @param context
400
+ * The context to use for rendering the token.
401
+ */
402
+ unescapedValue(token: string[], context: Context): string;
403
+
404
+ /**
405
+ * Renders an escaped value.
406
+ *
407
+ * @param token
408
+ * The token to render.
409
+ *
410
+ * @param context
411
+ * The context to use for rendering the token.
412
+ *
413
+ * @param config
414
+ * The options for the rendering process.
415
+ */
416
+ escapedValue(
417
+ token: string[],
418
+ context: Context,
419
+ config?: RenderOptions,
420
+ ): string;
421
+
422
+ /**
423
+ * Renders a raw token.
424
+ *
425
+ * @param token
426
+ * The token to render.
427
+ */
428
+ rawValue(token: string[]): string;
429
+ }
430
+
431
+ export { }
@@ -0,0 +1,5 @@
1
+ (function(){var e={639:function(e){(function(t,r){true?e.exports=r():0})(this,(function(){"use strict";
2
+ /*!
3
+ * mustache.js - Logic-less {{mustache}} templates with JavaScript
4
+ * http://github.com/janl/mustache.js
5
+ */var e=Object.prototype.toString;var t=Array.isArray||function isArrayPolyfill(t){return e.call(t)==="[object Array]"};function isFunction(e){return typeof e==="function"}function typeStr(e){return t(e)?"array":typeof e}function escapeRegExp(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hasProperty(e,t){return e!=null&&typeof e==="object"&&t in e}function primitiveHasOwnProperty(e,t){return e!=null&&typeof e!=="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}var r=RegExp.prototype.test;function testRegExp(e,t){return r.call(e,t)}var n=/\S/;function isWhitespace(e){return!testRegExp(n,e)}var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function escapeHtml(e){return String(e).replace(/[&<>"'`=\/]/g,(function fromEntityMap(e){return i[e]}))}var a=/\s*/;var s=/\s+/;var o=/\s*=/;var p=/\s*\}/;var u=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(e,r){if(!e)return[];var n=false;var i=[];var l=[];var f=[];var h=false;var d=false;var v="";var g=0;function stripSpace(){if(h&&!d){while(f.length)delete l[f.pop()]}else{f=[]}h=false;d=false}var y,w,m;function compileTags(e){if(typeof e==="string")e=e.split(s,2);if(!t(e)||e.length!==2)throw new Error("Invalid tags: "+e);y=new RegExp(escapeRegExp(e[0])+"\\s*");w=new RegExp("\\s*"+escapeRegExp(e[1]));m=new RegExp("\\s*"+escapeRegExp("}"+e[1]))}compileTags(r||c.tags);var x=new Scanner(e);var C,_,k,b,T,E;while(!x.eos()){C=x.pos;k=x.scanUntil(y);if(k){for(var S=0,W=k.length;S<W;++S){b=k.charAt(S);if(isWhitespace(b)){f.push(l.length);v+=b}else{d=true;n=true;v+=" "}l.push(["text",b,C,C+1]);C+=1;if(b==="\n"){stripSpace();v="";g=0;n=false}}}if(!x.scan(y))break;h=true;_=x.scan(u)||"name";x.scan(a);if(_==="="){k=x.scanUntil(o);x.scan(o);x.scanUntil(w)}else if(_==="{"){k=x.scanUntil(m);x.scan(p);x.scanUntil(w);_="&"}else{k=x.scanUntil(w)}if(!x.scan(w))throw new Error("Unclosed tag at "+x.pos);if(_==">"){T=[_,k,C,x.pos,v,g,n]}else{T=[_,k,C,x.pos]}g++;l.push(T);if(_==="#"||_==="^"){i.push(T)}else if(_==="/"){E=i.pop();if(!E)throw new Error('Unopened section "'+k+'" at '+C);if(E[1]!==k)throw new Error('Unclosed section "'+E[1]+'" at '+C)}else if(_==="name"||_==="{"||_==="&"){d=true}else if(_==="="){compileTags(k)}}stripSpace();E=i.pop();if(E)throw new Error('Unclosed section "'+E[1]+'" at '+x.pos);return nestTokens(squashTokens(l))}function squashTokens(e){var t=[];var r,n;for(var i=0,a=e.length;i<a;++i){r=e[i];if(r){if(r[0]==="text"&&n&&n[0]==="text"){n[1]+=r[1];n[3]=r[3]}else{t.push(r);n=r}}}return t}function nestTokens(e){var t=[];var r=t;var n=[];var i,a;for(var s=0,o=e.length;s<o;++s){i=e[s];switch(i[0]){case"#":case"^":r.push(i);n.push(i);r=i[4]=[];break;case"/":a=n.pop();a[5]=i[2];r=n.length>0?n[n.length-1][4]:t;break;default:r.push(i)}}return t}function Scanner(e){this.string=e;this.tail=e;this.pos=0}Scanner.prototype.eos=function eos(){return this.tail===""};Scanner.prototype.scan=function scan(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var r=t[0];this.tail=this.tail.substring(r.length);this.pos+=r.length;return r};Scanner.prototype.scanUntil=function scanUntil(e){var t=this.tail.search(e),r;switch(t){case-1:r=this.tail;this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,t);this.tail=this.tail.substring(t)}this.pos+=r.length;return r};function Context(e,t){this.view=e;this.cache={".":this.view};this.parent=t}Context.prototype.push=function push(e){return new Context(e,this)};Context.prototype.lookup=function lookup(e){var t=this.cache;var r;if(t.hasOwnProperty(e)){r=t[e]}else{var n=this,i,a,s,o=false;while(n){if(e.indexOf(".")>0){i=n.view;a=e.split(".");s=0;while(i!=null&&s<a.length){if(s===a.length-1)o=hasProperty(i,a[s])||primitiveHasOwnProperty(i,a[s]);i=i[a[s++]]}}else{i=n.view[e];o=hasProperty(n.view,e)}if(o){r=i;break}n=n.parent}t[e]=r}if(isFunction(r))r=r.call(this.view);return r};function Writer(){this.templateCache={_cache:{},set:function set(e,t){this._cache[e]=t},get:function get(e){return this._cache[e]},clear:function clear(){this._cache={}}}}Writer.prototype.clearCache=function clearCache(){if(typeof this.templateCache!=="undefined"){this.templateCache.clear()}};Writer.prototype.parse=function parse(e,t){var r=this.templateCache;var n=e+":"+(t||c.tags).join(":");var i=typeof r!=="undefined";var a=i?r.get(n):undefined;if(a==undefined){a=parseTemplate(e,t);i&&r.set(n,a)}return a};Writer.prototype.render=function render(e,t,r,n){var i=this.getConfigTags(n);var a=this.parse(e,i);var s=t instanceof Context?t:new Context(t,undefined);return this.renderTokens(a,s,r,e,n)};Writer.prototype.renderTokens=function renderTokens(e,t,r,n,i){var a="";var s,o,p;for(var u=0,c=e.length;u<c;++u){p=undefined;s=e[u];o=s[0];if(o==="#")p=this.renderSection(s,t,r,n,i);else if(o==="^")p=this.renderInverted(s,t,r,n,i);else if(o===">")p=this.renderPartial(s,t,r,i);else if(o==="&")p=this.unescapedValue(s,t);else if(o==="name")p=this.escapedValue(s,t,i);else if(o==="text")p=this.rawValue(s);if(p!==undefined)a+=p}return a};Writer.prototype.renderSection=function renderSection(e,r,n,i,a){var s=this;var o="";var p=r.lookup(e[1]);function subRender(e){return s.render(e,r,n,a)}if(!p)return;if(t(p)){for(var u=0,c=p.length;u<c;++u){o+=this.renderTokens(e[4],r.push(p[u]),n,i,a)}}else if(typeof p==="object"||typeof p==="string"||typeof p==="number"){o+=this.renderTokens(e[4],r.push(p),n,i,a)}else if(isFunction(p)){if(typeof i!=="string")throw new Error("Cannot use higher-order sections without the original template");p=p.call(r.view,i.slice(e[3],e[5]),subRender);if(p!=null)o+=p}else{o+=this.renderTokens(e[4],r,n,i,a)}return o};Writer.prototype.renderInverted=function renderInverted(e,r,n,i,a){var s=r.lookup(e[1]);if(!s||t(s)&&s.length===0)return this.renderTokens(e[4],r,n,i,a)};Writer.prototype.indentPartial=function indentPartial(e,t,r){var n=t.replace(/[^ \t]/g,"");var i=e.split("\n");for(var a=0;a<i.length;a++){if(i[a].length&&(a>0||!r)){i[a]=n+i[a]}}return i.join("\n")};Writer.prototype.renderPartial=function renderPartial(e,t,r,n){if(!r)return;var i=this.getConfigTags(n);var a=isFunction(r)?r(e[1]):r[e[1]];if(a!=null){var s=e[6];var o=e[5];var p=e[4];var u=a;if(o==0&&p){u=this.indentPartial(a,p,s)}var c=this.parse(u,i);return this.renderTokens(c,t,r,u,n)}};Writer.prototype.unescapedValue=function unescapedValue(e,t){var r=t.lookup(e[1]);if(r!=null)return r};Writer.prototype.escapedValue=function escapedValue(e,t,r){var n=this.getConfigEscape(r)||c.escape;var i=t.lookup(e[1]);if(i!=null)return typeof i==="number"&&n===c.escape?String(i):n(i)};Writer.prototype.rawValue=function rawValue(e){return e[1]};Writer.prototype.getConfigTags=function getConfigTags(e){if(t(e)){return e}else if(e&&typeof e==="object"){return e.tags}else{return undefined}};Writer.prototype.getConfigEscape=function getConfigEscape(e){if(e&&typeof e==="object"&&!t(e)){return e.escape}else{return undefined}};var c={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:undefined,escape:undefined,parse:undefined,render:undefined,Scanner:undefined,Context:undefined,Writer:undefined,set templateCache(e){l.templateCache=e},get templateCache(){return l.templateCache}};var l=new Writer;c.clearCache=function clearCache(){return l.clearCache()};c.parse=function parse(e,t){return l.parse(e,t)};c.render=function render(e,t,r,n){if(typeof e!=="string"){throw new TypeError('Invalid template! Template should be a "string" '+'but "'+typeStr(e)+'" was given as the first '+"argument for mustache#render(template, view, partials)")}return l.render(e,t,r,n)};c.escape=escapeHtml;c.Scanner=Scanner;c.Context=Context;c.Writer=Writer;return c}))}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var a=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(639);module.exports=r})();
@@ -0,0 +1 @@
1
+ {"name":"mustache","version":"4.2.0","author":"mustache.js Authors <http://github.com/janl/mustache.js>","license":"MIT","_lastModified":"2024-02-20T09:30:14.095Z"}
package/es/_util.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import type { SpawnOptions } from 'node:child_process';
4
+ import type { PackageJson } from 'type-fest';
5
+ export type YolkConfig = {
6
+ strict?: boolean;
7
+ eslintIgnorePattern?: string;
8
+ stylelintIgnorePattern?: string;
9
+ initPreCommit?: boolean;
10
+ ignorePreCommitRunLint?: boolean;
11
+ ignorePreCommitRunTest?: boolean;
12
+ ignoreCheckNodeModulesMatchLockFile?: boolean;
13
+ };
14
+ export declare const cwd: string;
15
+ export declare const ENCODING: BufferEncoding;
16
+ export declare const warn: (text?: string) => void | "" | undefined;
17
+ export declare const error: (text?: string) => void | "" | undefined;
18
+ export declare const ready: (text?: string) => void | "" | undefined;
19
+ export declare const info: (text?: string) => void | "" | undefined;
20
+ export declare const transformCommand: (command: string) => string;
21
+ export declare const rimrafSync: (path: string) => boolean;
22
+ export declare const breakExit: () => void;
23
+ export declare const spawnCommand: ({ command, args, complete, exit, options, }: {
24
+ command: string;
25
+ args?: string[] | undefined;
26
+ complete?: (() => void) | undefined;
27
+ exit?: boolean | undefined;
28
+ options?: SpawnOptions | undefined;
29
+ }) => void;
30
+ export declare const spawnSyncCommand: ({ command, args, complete, options, }: {
31
+ command: string;
32
+ args?: string[] | undefined;
33
+ complete?: (() => void) | undefined;
34
+ options?: SpawnOptions | undefined;
35
+ }) => void;
36
+ export declare const getYolkConfig: () => YolkConfig;
37
+ export declare const getProjectConfigJSON: () => any;
38
+ export declare const getPackageJSON: () => PackageJson;
39
+ export declare const getConfigFilePath: (type: 'eslint' | 'stylelint' | 'prettier' | 'biome') => string;
40
+ export declare const getEsLintConfigPath: () => string;
41
+ export declare const getStyleLintConfigPath: () => string;
42
+ export declare const getPrettierConfigPath: () => string;
43
+ export declare const getBiomeConfigPath: () => string;
package/es/_util.js ADDED
@@ -0,0 +1 @@
1
+ import{spawn as r,spawnSync as o}from"node:child_process";import{existsSync as t,readFileSync as e}from"node:fs";import{join as n}from"node:path";import c from"chalk";import s from"exit-x";import{globSync as i}from"glob";import{rimrafSync as a,windowsSync as m}from"rimraf";import{program as p}from"../compiled/commander";export const cwd=process.cwd();const g=console;export const ENCODING="utf-8";export const warn=r=>r&&g.log(c.yellow("warn -"),r);export const error=r=>r&&g.log(c.red("error -"),c.red(r));export const ready=r=>r&&g.log(c.green("ready -"),r);export const info=r=>r&&g.log(c.blue("info -"),r);const f=()=>"win32"===process.platform;export const transformCommand=r=>f()?`${r}.cmd`:r;export const rimrafSync=r=>f()?m(r):a(r);export const breakExit=()=>{warn("yolk break!"),s(0)};export const spawnCommand=({command:o,args:t,complete:e,exit:n=!0,options:c})=>{const i=r(transformCommand(o),t||[],{stdio:"inherit",...c}).on("close",r=>{r?s(r):(e?.(),n&&s(0))});process.on("SIGINT",()=>{p.exitOverride(),i.kill(),s(0)})};export const spawnSyncCommand=({command:r,args:t,complete:e,options:n})=>{try{const{status:c}=o(transformCommand(r),t||[],{stdio:"inherit",...n});e?.(),c&&s(c)}catch(c){error(c?.message),s(1)}process.on("SIGINT",()=>{p.exitOverride(),s(0)})};export const getYolkConfig=()=>{const r=i("*.yolkrc*",{cwd:cwd,dot:!0});if(!r.length)return{};const o=n(cwd,r[0]);if(!t(o))return{};try{return JSON.parse(e(o,ENCODING))||{}}catch(error){return error(error.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}};export const getProjectConfigJSON=()=>{const r=n(cwd,"project.config.json");if(!t(r))return{};try{return JSON.parse(e(r,ENCODING))||{}}catch(error){return error(error.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}};export const getPackageJSON=()=>{const r=n(cwd,"package.json");if(!t(r))return{};try{return JSON.parse(e(r,ENCODING))||{}}catch(error){return error(error.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}};export const getConfigFilePath=r=>{const o=getYolkConfig();let e="";try{e=require.resolve(`@baic/${r}-config-yolk`)}catch(error){}const n=i(`*.${r}rc*`,{cwd:cwd,dot:!0}),c=n?.[0];return!1===o.strict&&c&&t(c)?c:t(e)?e:c};export const getEsLintConfigPath=()=>getConfigFilePath("eslint");export const getStyleLintConfigPath=()=>getConfigFilePath("stylelint");export const getPrettierConfigPath=()=>getConfigFilePath("prettier");export const getBiomeConfigPath=()=>getConfigFilePath("biome");
@@ -0,0 +1 @@
1
+ const{join:t}=require("node:path"),{getBiomeConfigPath:e,getEsLintConfigPath:n,getPrettierConfigPath:s,getStyleLintConfigPath:o,getYolkConfig:c}=require("./_util"),i=["**/node_modules/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/mock/**","**/test/**","**/public/**","**/assets/**","**/.umi/**","**/.umi-production/**","**/h5+app/**","**/*uni*/**","**/android/**","**/ios/**","**/*.ignore/**"],{strict:a=!0,eslintIgnorePattern:r,stylelintIgnorePattern:l}=c(),g=t(process.cwd(),"node_modules",".cache"),h=`prettier --write --cache --cache-strategy=content --cache-location=${t(g,".prettiercache")} --config ${s()} --no-error-on-unmatched-pattern`,p=`eslint --fix ${a?"--no-inline-config":""} --no-error-on-unmatched-pattern --cache --cache-strategy=content --cache-location=${t(g,".eslintcache")} --config ${n()} ${i.concat(r?[r]:[]).map(t=>`--ignore-pattern ${t}`).join(" ")}`,u=`stylelint --fix ${a?"--ignore-disables":""} --allow-empty-input --cache --cache-strategy=content --cache-location=${t(g,".stylelintcache")} --config ${o()} ${i.concat(l?[l]:[]).map(t=>`--ignore-pattern ${t}`).join(" ")}`,m=`biome check --write --unsafe --no-errors-on-unmatched --log-level=error --files-ignore-unknown=true --config-path=${e()}`,$={"*.{md,json,jsonc}":[h],"*.css":[h,`${u} --custom-syntax postcss`],"*.less":[h,`${u} --custom-syntax postcss-less`],"*.{sass,scss}":[h,`${u} --custom-syntax postcss-scss`],"*.{js,jsx,cjs,mjs}":[h,p],"*.{ts,tsx,cts,mts}":[`${h} --parser=typescript`,p]};module.exports={...$,[`!(${Object.keys($).join("|")})`]:[m]};
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:["setup"].concat(m),complete:()=>L({command:"max",args:["build"].concat(m)}),exit:!1}):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"lodash/isString";import t from"lodash/floor";import{execSync as o}from"node:child_process";import{chmodSync as a,copyFileSync as i,existsSync as r,readFileSync as n,statSync as s,writeFileSync as m}from"node:fs";import c from"node:os";import{basename as p,dirname as l,join as d,relative as u}from"node:path";import{defaultRunCommandOptions as g}from"@baic/yolk-test";import{globSync as f}from"glob";import h from"inquirer";import*as y from"miniprogram-ci";import{mkdirpSync as v}from"mkdirp";import{program as $}from"../compiled/commander";import b from"../compiled/js-yaml";import k from"../compiled/mustache";import j from"../package.json";import{breakExit as w,cwd as x,ENCODING as P,error as O,getPackageJSON as E,getProjectConfigJSON as q,getYolkConfig as _,info as S,ready as D,rimrafSync as Q,spawnCommand as R,spawnSyncCommand as N,transformCommand as L,warn as F}from"./_util";const M="##### CREATED BY YOLK #####",B=async(e,t,o)=>{const{type:a,projectName:c,packageManager:g}=await h.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:p(p(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"}]}]),y={projectName:c,packageManager:"default"===g?"pnpm":g,yolkVersion:j.version};if("umi-mobile-uni-app"===a)return void F("\u6682\u4e0d\u652f\u6301");const $=t||d(__dirname,`../templates/${a}`);D(`\u590d\u5236\u6a21\u7248 ${p($)}`);const b=f("**/*",{cwd:$,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(b.forEach(t=>{if(!$)return;const o=d($,t);if(!s(o).isDirectory())if(t.endsWith(".tpl")){const a=n(o,P),i=d(e,t.replace(/\.tpl$/,"")),r=k.render(a,y);v(l(i)),D(`\u521b\u5efa ${u(e,i)}`),m(i,r,P)}else{D(`\u521b\u5efa ${t}`);const a=d(e,t);v(l(a)),i(o,a)}}),D("\u590d\u5236\u6a21\u7248 success!"),o&&r($)&&Q($)&&D(`\u7f13\u5b58\u5220\u9664 success! ${p($||"")}`),g)switch(D("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),g){case"default":case"pnpm":R({command:"pnpm",args:["install"]});break;case"yarn":R({command:"yarn",args:["install"]});break;case"npm":R({command:"npm",args:["install"]});break;default:}D("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")},K=(e,t)=>B(e,t,!0),C=()=>r(d(x,"project.config.json")),I=()=>{let e=r(d(x,"node_modules/.bin/umi"));try{if(!e)try{e=r(require.resolve("umi"))}catch(t){}}catch(t){}return e},T=()=>{let e=r(d(x,"node_modules/.bin/max"));try{if(!e)try{e=r(require.resolve("@umijs/max"))}catch(t){}}catch(t){}return e},U=()=>{const e=d(x,"project.config.json");if(r(e)){const t=require(e);return t.appid}return""},V=()=>r(d(x,"project.tt.json"))&&0===U().indexOf("tt"),W=()=>0===U().indexOf("20"),A=()=>{const e=_(),t=d(x,".husky/pre-commit"),o=d(x,".git/"),i=d(x,".git/hooks"),s=d(i,"pre-commit"),p=r(t),l=r(o),u=r(i),g=r(s),f=!1!==e.initPreCommit&&!p,h=[M,"npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",M].join(c.EOL),y=e=>{let t=e||"";return t&&t.indexOf(M)>=0&&(t=`${t.substring(0,t.indexOf(M))}${t.substring(t.lastIndexOf(M)+M.length)}`.replace(/(\r|\n)+$/gu,"")),t};if(l)if(f)if(u||(v(i),D("create .git/hooks")),g){try{a(s,"777")}catch($){O(`chmod ${s} failed: ${$.message}`)}const e=y(n(s,P).toString());m(s,(e.indexOf("#!/")<0?["#!/bin/sh"]:[]).concat([e,h]).filter(e=>!!e).join(c.EOL),P)}else m(s,["#!/bin/sh",h].join(c.EOL),P),D("create pre-commit");else if(g){const e=y(n(s,P).toString());m(s,e,P)}},X=()=>{const{ignorePreCommitRunLint:e,ignorePreCommitRunTest:t}=_();if(e?F("\u5df2\u8bed\u6cd5\u68c0\u67e5\uff0c\u8bf7\u81ea\u884c\u6267\u884c\u3002"):(F("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),N({command:"lint-staged",args:["-c",require.resolve("./lintstagedrc"),"--allow-empty"]})),t)F("\u5df2\u5ffd\u7565test\u6267\u884c\uff0c\u8bf7\u81ea\u884c\u6267\u884c\u3002");else{F("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684test\u6267\u884c\u3002");const e=E();e?.scripts&&e?.scripts?.test?.length&&N({command:"npm",args:["test"]})}},H=({mAppid:e,mProject:t,mPrivateKeyPath:a,mVersion:i,mDesc:n,mRobot:s,mQrcodeFormat:m,mQrcodeOutputDest:c,mPagePath:p,mSearchQuery:l})=>{let u="";try{u=r(d(x,".git"))?o("git log -1 --pretty=format:%H").toString():""}catch($){}const g=q(),f=e||g.appid,h=t||d(x,"dist"),v=a||d(x,`private.${f}.key`);if(r(h)){if(r(v)){const e=E(),t=i||e.version||g.version||"1.0.0",o=n||e.description||g.description,a=`${u?` commit: ${u};`:""}${o?` description: ${o};`:""}`;u&&S(`commit: ${u}`),S(`dist: ${h}`),S(`key: ${v}`),S(`appid: ${f}`),S(`version: ${t}`),S(`desc: ${a}`);const r=new y.Project({appid:f,type:"miniProgram",projectPath:h,privateKeyPath:v,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:f,options:{project:r,version:t,desc:a,setting:{...g.setting,es6:!1,es7:!1,minifyJS:!1,minifyWXML:!1,minifyWXSS:!1,minify:!1},robot:s,qrcodeFormat:m,qrcodeOutputDest:c,pagePath:p,searchQuery:l}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${v})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${h})`)},Y=()=>{let e="";try{e=o(`${L("npm")} view ${j.name} version`,{timeout:3e3}).toString().replace(/\n/g,"")}catch(a){}S(`yolk version: ${j.version}${e&&e!==j.version?`(latest\uff1a${e})`:""}`),S(`node version: ${process.version}`),S(`platform: ${c.platform()}`),S(`memory: ${t(c.freemem()/1024/1024)} MB(${t(c.totalmem()/1024/1024)} MB)`)},G=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,z=e=>{process.env.DID_YOU_KNOW="none",process.env.VITE_CJS_IGNORE_WARNING="true";const t=[];return e?.forEach(e=>{if(J.test(e)){const[t,o]=e.split("=");process.env[t]=o,S(`\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff1a${t}=${o}`)}else t.push(e)}),t},Z=()=>{const{ignoreCheckNodeModulesMatchLockFile:e}=_();if(e)F("\u5ffd\u7565node_modules\u4e0elock\u6587\u4ef6\u5339\u914d\u68c0\u67e5\uff0c\u8bf7\u81ea\u884c\u68c0\u67e5\u3002");else{const e=d(x,"pnpm-lock.yaml"),t=d(x,"yarn.lock");let o=!1;if(r(e)){const t=n(e,P),a=b.load(t);Object.keys(a.packages).forEach(e=>{const t=e.match(new RegExp(`^/${j.name}@([^()]+)`,"u"))||[];t?.length>=2&&t[1]===j.version&&(o=!0)})}else if(r(t)){const e=n(t,P),a=b.load(e);Object.keys(a.object).forEach(e=>{const t=e.match(new RegExp(`^${j.name}@([^(),]+)`,"u"))||[];t?.length>=2&&t[1]===j.version&&(o=!0)})}else o=!0;o||O("\u5f53\u524dnode_modules\u4e0elock\u6587\u4ef6\u4e0d\u5339\u914d\uff0c\u8bf7\u68c0\u67e5\u5e76\u91cd\u65b0\u5b89\u88c5\u3002")}},ee=()=>{A(),process.argv.length>2?($.version(j.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]"),$.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(Y(),D("yolk init \u5f00\u59cb"),e){const o=".yolk",a=d(x,o);r(a)&&Q(a)&&D(`\u7f13\u5b58\u5220\u9664 success! ${a}`),R({command:"git",args:["clone","-b","master","--depth","1",e,o].concat(t)}),K(x,a)}else B(x)}),$.command("start").description("\u542f\u52a8\u9879\u76ee").option("--docs","\u6587\u6863\u6a21\u5f0f").action(({docs:e},{args:t})=>{Y(),Z();const o=z(t);C()?V()?R({command:"taro",args:["build","--type","tt","--watch"].concat(o)}):W()?R({command:"taro",args:["build","--type","alipay","--watch"].concat(o)}):R({command:"taro",args:["build","--type","weapp","--watch"].concat(o)}):e?R({command:"dumi",args:["dev"].concat(o)}):T()?R({command:"max",args:["dev"].concat(o)}):I()?R({command:"umi",args:["dev"].concat(o)}):w()}),$.command("build").description("\u7f16\u8bd1\u9879\u76ee").option("--docs","\u6587\u6863\u6a21\u5f0f").action(({docs:e},{args:t})=>{Y(),Z();const o=z(t);if(C())V()?R({command:"taro",args:["build","--type","tt"].concat(o)}):W()?R({command:"taro",args:["build","--type","alipay"].concat(o)}):R({command:"taro",args:["build","--type","weapp"].concat(o)});else if(e)R({command:"dumi",args:["build"].concat(o)});else if(T())R({command:"max",args:["setup"].concat(o),complete:()=>R({command:"max",args:["build"].concat(o)}),exit:!1});else if(I()){const e=require("umi/package.json"),t=Number((e.version||"").split(".")[0]||0);R(t>=4?{command:"umi",args:["setup"].concat(o),complete:()=>R({command:"umi",args:["build"].concat(o)}),exit:!1}:{command:"umi",args:["generate","tmp"].concat(o),complete:()=>R({command:"umi",args:["build"].concat(o)}),exit:!1})}else w()}),$.command("init-pre-commit").description("\u521d\u59cb\u5316 commit hook").action(A),$.command("pre-commit").description("\u6267\u884ccommit hook").action(X),G($.command("miniprogram-upload").description("\u4f7f\u7528 miniprogram-ci \u4e0a\u4f20\u5c0f\u7a0b\u5e8f")).action(async t=>{if(C())if(V());else if(W());else{const{appid:o,options:{project:a,version:i,desc:r,setting:n,robot:s}}=H(t);S(`${o} \u4e0a\u4f20\u5f00\u59cb`),await y.upload({project:a,version:i,desc:r,setting:n,robot:s,onProgressUpdate:t=>{if(e(t))S(`task: ${t}`);else{const{status:e,message:o}=t;S(`task(${e}): ${o}`)}}}),D(`${o} \u4e0a\u4f20\u5b8c\u6210`)}else O("\u975e\u5c0f\u7a0b\u5e8f\u9879\u76ee\u76ee\u5f55")}),G($.command("miniprogram-preview").description("\u4f7f\u7528 miniprogram-ci \u9884\u89c8\u5c0f\u7a0b\u5e8f")).action(async t=>{if(C())if(V());else if(W());else{const{appid:o,options:{project:a,version:i,desc:r,setting:n,robot:s,qrcodeFormat:m,qrcodeOutputDest:c,pagePath:p,searchQuery:l}}=H(t);S(`${o} \u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),await y.preview({project:a,version:i,desc:r,setting:n,robot:s,qrcodeFormat:m,qrcodeOutputDest:c,pagePath:p,searchQuery:l,onProgressUpdate:t=>{if(e(t))S(`task: ${t}`);else{const{status:e,message:o}=t;S(`task(${e}): ${o}`)}}}),D(`${o} \u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}else O("\u975e\u5c0f\u7a0b\u5e8f\u9879\u76ee\u76ee\u5f55")}),$.command("exec").description("\u6267\u884cts\u6587\u4ef6").argument("<path>","\u6267\u884c\u7684ts\u6587\u4ef6").action((e,t,{args:o})=>{const a=z(o);R({command:"tsx",args:[e].concat(a)})}),(e=>{let t=$.command("test").description("\u6267\u884c\u6d4b\u8bd5");return e.forEach(({name:e,isBoolean:o,description:a,defaultValue:i})=>{t=t.option(o?`--${e}`:`--${e} <${e}>`,a,i)}),t})(g).action((e,{args:t})=>{const o=g.filter(({isBoolean:e})=>!!e).map(({name:e})=>e),a=z(t);let i=["run"];if(Object.keys(e).forEach(t=>{const a=e[t];i=i.concat(a?[o.indexOf(t)>=0?`--${t}`:`--${t}=${a}`]:[])}),T())R({command:"max",args:["setup"].concat(a),complete:()=>R({command:"yest",args:i.concat(a)}),exit:!1});else if(I()){const e=require("umi/package.json"),t=Number((e.version||"").split(".")[0]||0);R(t>=4?{command:"umi",args:["setup"].concat(a),complete:()=>R({command:"yest",args:i.concat(a)}),exit:!1}:{command:"umi",args:["generate","tmp"].concat(a),complete:()=>R({command:"yest",args:i.concat(a)}),exit:!1})}else R({command:"yest",args:i.concat(a)})}),$.parse(process.argv)):w()};ee();
package/lib/_util.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import type { SpawnOptions } from 'node:child_process';
4
+ import type { PackageJson } from 'type-fest';
5
+ export type YolkConfig = {
6
+ strict?: boolean;
7
+ eslintIgnorePattern?: string;
8
+ stylelintIgnorePattern?: string;
9
+ initPreCommit?: boolean;
10
+ ignorePreCommitRunLint?: boolean;
11
+ ignorePreCommitRunTest?: boolean;
12
+ ignoreCheckNodeModulesMatchLockFile?: boolean;
13
+ };
14
+ export declare const cwd: string;
15
+ export declare const ENCODING: BufferEncoding;
16
+ export declare const warn: (text?: string) => void | "" | undefined;
17
+ export declare const error: (text?: string) => void | "" | undefined;
18
+ export declare const ready: (text?: string) => void | "" | undefined;
19
+ export declare const info: (text?: string) => void | "" | undefined;
20
+ export declare const transformCommand: (command: string) => string;
21
+ export declare const rimrafSync: (path: string) => boolean;
22
+ export declare const breakExit: () => void;
23
+ export declare const spawnCommand: ({ command, args, complete, exit, options, }: {
24
+ command: string;
25
+ args?: string[] | undefined;
26
+ complete?: (() => void) | undefined;
27
+ exit?: boolean | undefined;
28
+ options?: SpawnOptions | undefined;
29
+ }) => void;
30
+ export declare const spawnSyncCommand: ({ command, args, complete, options, }: {
31
+ command: string;
32
+ args?: string[] | undefined;
33
+ complete?: (() => void) | undefined;
34
+ options?: SpawnOptions | undefined;
35
+ }) => void;
36
+ export declare const getYolkConfig: () => YolkConfig;
37
+ export declare const getProjectConfigJSON: () => any;
38
+ export declare const getPackageJSON: () => PackageJson;
39
+ export declare const getConfigFilePath: (type: 'eslint' | 'stylelint' | 'prettier' | 'biome') => string;
40
+ export declare const getEsLintConfigPath: () => string;
41
+ export declare const getStyleLintConfigPath: () => string;
42
+ export declare const getPrettierConfigPath: () => string;
43
+ 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.transformCommand=exports.spawnSyncCommand=exports.spawnCommand=exports.rimrafSync=exports.ready=exports.info=exports.getYolkConfig=exports.getStyleLintConfigPath=exports.getProjectConfigJSON=exports.getPrettierConfigPath=exports.getPackageJSON=exports.getEsLintConfigPath=exports.getConfigFilePath=exports.getBiomeConfigPath=exports.error=exports.cwd=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=e(require("exit-x")),i=require("glob"),c=require("rimraf"),a=require("../compiled/commander");const p=exports.cwd=process.cwd(),l=console,g=exports.ENCODING="utf-8",x=e=>e&&l.log(s.default.yellow("warn -"),e);exports.warn=x;const d=e=>e&&l.log(s.default.red("error -"),s.default.red(e));exports.error=d;const f=e=>e&&l.log(s.default.green("ready -"),e);exports.ready=f;const u=e=>e&&l.log(s.default.blue("info -"),e);exports.info=u;const m=()=>"win32"===process.platform,y=e=>m()?`${e}.cmd`:e;exports.transformCommand=y;const S=e=>m()?(0,c.windowsSync)(e):(0,c.rimrafSync)(e);exports.rimrafSync=S;const h=()=>{x("yolk break!"),(0,n.default)(0)};exports.breakExit=h;const C=({command:e,args:r,complete:o,exit:s=!0,options:i})=>{const c=(0,t.spawn)(y(e),r||[],{stdio:"inherit",...i}).on("close",e=>{e?(0,n.default)(e):(o?.(),s&&(0,n.default)(0))});process.on("SIGINT",()=>{a.program.exitOverride(),c.kill(),(0,n.default)(0)})};exports.spawnCommand=C;const w=({command:e,args:r,complete:o,options:s})=>{try{const{status:i}=(0,t.spawnSync)(y(e),r||[],{stdio:"inherit",...s});o?.(),i&&(0,n.default)(i)}catch(i){d(i?.message),(0,n.default)(1)}process.on("SIGINT",()=>{a.program.exitOverride(),(0,n.default)(0)})};exports.spawnSyncCommand=w;const P=()=>{const e=(0,i.globSync)("*.yolkrc*",{cwd:p,dot:!0});if(!e.length)return{};const t=(0,o.join)(p,e[0]);if(!(0,r.existsSync)(t))return{};try{return JSON.parse((0,r.readFileSync)(t,g))||{}}catch(d){return d(d.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}};exports.getYolkConfig=P;const k=()=>{const e=(0,o.join)(p,"project.config.json");if(!(0,r.existsSync)(e))return{};try{return JSON.parse((0,r.readFileSync)(e,g))||{}}catch(d){return d(d.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}};exports.getProjectConfigJSON=k;const N=()=>{const e=(0,o.join)(p,"package.json");if(!(0,r.existsSync)(e))return{};try{return JSON.parse((0,r.readFileSync)(e,g))||{}}catch(d){return d(d.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}};exports.getPackageJSON=N;const b=e=>{const t=P();let o="";try{o=require.resolve(`@baic/${e}-config-yolk`)}catch(d){}const s=(0,i.globSync)(`*.${e}rc*`,{cwd:p,dot:!0}),n=s?.[0];return!1===t.strict&&n&&(0,r.existsSync)(n)?n:(0,r.existsSync)(o)?o:n};exports.getConfigFilePath=b;const j=()=>b("eslint");exports.getEsLintConfigPath=j;const O=()=>b("stylelint");exports.getStyleLintConfigPath=O;const q=()=>b("prettier");exports.getPrettierConfigPath=q;const v=()=>b("biome");exports.getBiomeConfigPath=v;
@@ -0,0 +1 @@
1
+ "use strict";const{join:t}=require("node:path"),{getBiomeConfigPath:e,getEsLintConfigPath:n,getPrettierConfigPath:s,getStyleLintConfigPath:o,getYolkConfig:c}=require("./_util"),i=["**/node_modules/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/mock/**","**/test/**","**/public/**","**/assets/**","**/.umi/**","**/.umi-production/**","**/h5+app/**","**/*uni*/**","**/android/**","**/ios/**","**/*.ignore/**"],{strict:r=!0,eslintIgnorePattern:a,stylelintIgnorePattern:l}=c(),g=t(process.cwd(),"node_modules",".cache"),h=`prettier --write --cache --cache-strategy=content --cache-location=${t(g,".prettiercache")} --config ${s()} --no-error-on-unmatched-pattern`,p=`eslint --fix ${r?"--no-inline-config":""} --no-error-on-unmatched-pattern --cache --cache-strategy=content --cache-location=${t(g,".eslintcache")} --config ${n()} ${i.concat(a?[a]:[]).map(t=>`--ignore-pattern ${t}`).join(" ")}`,u=`stylelint --fix ${r?"--ignore-disables":""} --allow-empty-input --cache --cache-strategy=content --cache-location=${t(g,".stylelintcache")} --config ${o()} ${i.concat(l?[l]:[]).map(t=>`--ignore-pattern ${t}`).join(" ")}`,m=`biome check --write --unsafe --no-errors-on-unmatched --log-level=error --files-ignore-unknown=true --config-path=${e()}`,$={"*.{md,json,jsonc}":[h],"*.css":[h,`${u} --custom-syntax postcss`],"*.less":[h,`${u} --custom-syntax postcss-less`],"*.{sass,scss}":[h,`${u} --custom-syntax postcss-scss`],"*.{js,jsx,cjs,mjs}":[h,p],"*.{ts,tsx,cts,mts}":[`${h} --parser=typescript`,p]};module.exports={...$,[`!(${Object.keys($).join("|")})`]:[m]};