create-vuepress-theme-hope 2.0.0-alpha.24 → 2.0.0-alpha.28

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 (330) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/lib/node/index.js +2 -1
  3. package/lib/node/index.js.map +1 -1
  4. package/package.json +2 -4
  5. package/readme.md +6 -6
  6. package/rollup.config.js +10 -1
  7. package/src/node/checkVersion.ts +1 -1
  8. package/src/node/copy.ts +24 -9
  9. package/src/node/deepAssign.ts +42 -0
  10. package/src/node/i18n.ts +3 -0
  11. package/src/node/index.ts +27 -9
  12. package/template/en-US/.vuepress/config.ts +28 -0
  13. package/template/en-US/.vuepress/navbar.ts +52 -0
  14. package/template/{.vuepress → en-US/.vuepress}/public/assets/icon/apple-icon-152.png +0 -0
  15. package/template/{.vuepress → en-US/.vuepress}/public/assets/icon/chrome-192.png +0 -0
  16. package/template/{.vuepress → en-US/.vuepress}/public/assets/icon/chrome-512.png +0 -0
  17. package/template/{.vuepress → en-US/.vuepress}/public/assets/icon/chrome-mask-192.png +0 -0
  18. package/template/{.vuepress → en-US/.vuepress}/public/assets/icon/chrome-mask-512.png +0 -0
  19. package/template/{.vuepress → en-US/.vuepress}/public/assets/icon/guide-maskable.png +0 -0
  20. package/template/{.vuepress → en-US/.vuepress}/public/assets/icon/guide-monochrome.png +0 -0
  21. package/template/{.vuepress → en-US/.vuepress}/public/assets/icon/ms-icon-144.png +0 -0
  22. package/template/{.vuepress → en-US/.vuepress}/public/favicon.ico +0 -0
  23. package/template/{.vuepress → en-US/.vuepress}/public/logo.png +0 -0
  24. package/template/{.vuepress → en-US/.vuepress}/public/logo.svg +0 -0
  25. package/template/en-US/.vuepress/sidebar.ts +47 -0
  26. package/template/{.vuepress → en-US/.vuepress}/styles/index.scss +0 -0
  27. package/template/{.vuepress → en-US/.vuepress}/styles/palette.scss +0 -0
  28. package/template/en-US/.vuepress/themeConfig.ts +149 -0
  29. package/template/{README.md → en-US/README.md} +1 -1
  30. package/template/{guide → en-US/guide}/README.md +0 -0
  31. package/template/{guide → en-US/guide}/disable.md +0 -0
  32. package/template/{guide → en-US/guide}/encrypt.md +0 -0
  33. package/template/{guide → en-US/guide}/markdown.md +10 -10
  34. package/template/{guide → en-US/guide}/page.md +0 -0
  35. package/template/{home.md → en-US/home.md} +13 -13
  36. package/template/{intro.md → en-US/intro.md} +0 -0
  37. package/template/{posts → en-US/posts}/article/article1.md +0 -0
  38. package/template/{posts → en-US/posts}/article/article2.md +0 -0
  39. package/template/{posts → en-US/posts}/article/article3.md +0 -0
  40. package/template/{posts → en-US/posts}/article/article4.md +0 -0
  41. package/template/{posts → en-US/posts}/article/article5.md +0 -0
  42. package/template/{posts → en-US/posts}/article/article6.md +0 -0
  43. package/template/{posts → en-US/posts}/article/article7.md +0 -0
  44. package/template/{posts → en-US/posts}/article/article8.md +0 -0
  45. package/template/{posts → en-US/posts}/article10.md +0 -0
  46. package/template/{posts → en-US/posts}/article11.md +0 -0
  47. package/template/{posts → en-US/posts}/article12.md +0 -0
  48. package/template/{posts → en-US/posts}/article9.md +0 -0
  49. package/template/{slides.md → en-US/slide.md} +0 -0
  50. package/template/i18n/.vuepress/config.ts +33 -0
  51. package/template/i18n/.vuepress/navbar/en.ts +52 -0
  52. package/template/{.vuepress/configs → i18n/.vuepress}/navbar/index.ts +0 -0
  53. package/template/i18n/.vuepress/navbar/zh.ts +52 -0
  54. package/template/i18n/.vuepress/public/assets/icon/apple-icon-152.png +0 -0
  55. package/template/i18n/.vuepress/public/assets/icon/chrome-192.png +0 -0
  56. package/template/i18n/.vuepress/public/assets/icon/chrome-512.png +0 -0
  57. package/template/i18n/.vuepress/public/assets/icon/chrome-mask-192.png +0 -0
  58. package/template/i18n/.vuepress/public/assets/icon/chrome-mask-512.png +0 -0
  59. package/template/i18n/.vuepress/public/assets/icon/guide-maskable.png +0 -0
  60. package/template/i18n/.vuepress/public/assets/icon/guide-monochrome.png +0 -0
  61. package/template/i18n/.vuepress/public/assets/icon/ms-icon-144.png +0 -0
  62. package/template/i18n/.vuepress/public/favicon.ico +0 -0
  63. package/template/i18n/.vuepress/public/logo.png +0 -0
  64. package/template/i18n/.vuepress/public/logo.svg +1 -0
  65. package/template/i18n/.vuepress/sidebar/en.ts +49 -0
  66. package/template/{.vuepress/configs → i18n/.vuepress}/sidebar/index.ts +0 -0
  67. package/template/i18n/.vuepress/sidebar/zh.ts +47 -0
  68. package/template/i18n/.vuepress/styles/index.scss +0 -0
  69. package/template/i18n/.vuepress/styles/palette.scss +0 -0
  70. package/template/i18n/.vuepress/themeConfig.ts +185 -0
  71. package/template/i18n/README.md +38 -0
  72. package/template/i18n/guide/README.md +15 -0
  73. package/template/i18n/guide/disable.md +41 -0
  74. package/template/i18n/guide/encrypt.md +15 -0
  75. package/template/i18n/guide/markdown.md +304 -0
  76. package/template/i18n/guide/page.md +60 -0
  77. package/template/i18n/home.md +85 -0
  78. package/template/i18n/intro.md +7 -0
  79. package/template/i18n/posts/article/article1.md +19 -0
  80. package/template/i18n/posts/article/article2.md +20 -0
  81. package/template/i18n/posts/article/article3.md +20 -0
  82. package/template/i18n/posts/article/article4.md +20 -0
  83. package/template/i18n/posts/article/article5.md +20 -0
  84. package/template/i18n/posts/article/article6.md +21 -0
  85. package/template/i18n/posts/article/article7.md +20 -0
  86. package/template/i18n/posts/article/article8.md +20 -0
  87. package/template/i18n/posts/article10.md +20 -0
  88. package/template/i18n/posts/article11.md +20 -0
  89. package/template/i18n/posts/article12.md +21 -0
  90. package/template/i18n/posts/article9.md +20 -0
  91. package/template/i18n/slide.md +433 -0
  92. package/template/{zh → i18n/zh}/README.md +1 -1
  93. package/template/{zh → i18n/zh}/guide/README.md +0 -0
  94. package/template/{zh → i18n/zh}/guide/disable.md +0 -0
  95. package/template/{zh → i18n/zh}/guide/encrypt.md +0 -0
  96. package/template/{zh → i18n/zh}/guide/markdown.md +0 -0
  97. package/template/{zh → i18n/zh}/guide/page.md +0 -0
  98. package/template/{zh → i18n/zh}/home.md +13 -13
  99. package/template/{zh → i18n/zh}/posts/article/article1.md +0 -0
  100. package/template/{zh → i18n/zh}/posts/article/article2.md +0 -0
  101. package/template/{zh → i18n/zh}/posts/article/article3.md +0 -0
  102. package/template/{zh → i18n/zh}/posts/article/article4.md +0 -0
  103. package/template/{zh → i18n/zh}/posts/article/article5.md +0 -0
  104. package/template/{zh → i18n/zh}/posts/article/article6.md +0 -0
  105. package/template/{zh → i18n/zh}/posts/article/article7.md +0 -0
  106. package/template/{zh → i18n/zh}/posts/article/article8.md +0 -0
  107. package/template/{zh → i18n/zh}/posts/article10.md +0 -0
  108. package/template/{zh → i18n/zh}/posts/article11.md +0 -0
  109. package/template/{zh → i18n/zh}/posts/article12.md +0 -0
  110. package/template/{zh → i18n/zh}/posts/article9.md +0 -0
  111. package/template/{zh/slides.md → i18n/zh/slide.md} +0 -0
  112. package/template/zh-CN/.vuepress/.cache/@mr-hope_vuepress-shared_lib_client.js +1402 -0
  113. package/template/zh-CN/.vuepress/.cache/@mr-hope_vuepress-shared_lib_client.js.map +7 -0
  114. package/template/zh-CN/.vuepress/.cache/@vue_devtools-api.js +41 -0
  115. package/template/zh-CN/.vuepress/.cache/@vue_devtools-api.js.map +7 -0
  116. package/template/zh-CN/.vuepress/.cache/@vuepress_shared.js +622 -0
  117. package/template/zh-CN/.vuepress/.cache/@vuepress_shared.js.map +7 -0
  118. package/template/zh-CN/.vuepress/.cache/@vueuse_core.js +6556 -0
  119. package/template/zh-CN/.vuepress/.cache/@vueuse_core.js.map +7 -0
  120. package/template/zh-CN/.vuepress/.cache/@waline_client.js +3896 -0
  121. package/template/zh-CN/.vuepress/.cache/@waline_client.js.map +7 -0
  122. package/template/zh-CN/.vuepress/.cache/_metadata.json +161 -0
  123. package/template/zh-CN/.vuepress/.cache/bcryptjs.js +1909 -0
  124. package/template/zh-CN/.vuepress/.cache/bcryptjs.js.map +7 -0
  125. package/template/zh-CN/.vuepress/.cache/body-scroll-lock.js +214 -0
  126. package/template/zh-CN/.vuepress/.cache/body-scroll-lock.js.map +7 -0
  127. package/template/zh-CN/.vuepress/.cache/chunk-2JB763FX.js +187 -0
  128. package/template/zh-CN/.vuepress/.cache/chunk-2JB763FX.js.map +7 -0
  129. package/template/zh-CN/.vuepress/.cache/chunk-3EXDT3YR.js +123 -0
  130. package/template/zh-CN/.vuepress/.cache/chunk-3EXDT3YR.js.map +7 -0
  131. package/template/zh-CN/.vuepress/.cache/chunk-G642NIRV.js +8451 -0
  132. package/template/zh-CN/.vuepress/.cache/chunk-G642NIRV.js.map +7 -0
  133. package/template/zh-CN/.vuepress/.cache/chunk-GG2GV5SX.js +65 -0
  134. package/template/zh-CN/.vuepress/.cache/chunk-GG2GV5SX.js.map +7 -0
  135. package/template/zh-CN/.vuepress/.cache/chunk-HY7UP3Y7.js +331 -0
  136. package/template/zh-CN/.vuepress/.cache/chunk-HY7UP3Y7.js.map +7 -0
  137. package/template/zh-CN/.vuepress/.cache/chunk-KX764DYK.js +351 -0
  138. package/template/zh-CN/.vuepress/.cache/chunk-KX764DYK.js.map +7 -0
  139. package/template/zh-CN/.vuepress/.cache/chunk-RHUTP25B.js +243 -0
  140. package/template/zh-CN/.vuepress/.cache/chunk-RHUTP25B.js.map +7 -0
  141. package/template/zh-CN/.vuepress/.cache/chunk-SPNUHUU2.js +105 -0
  142. package/template/zh-CN/.vuepress/.cache/chunk-SPNUHUU2.js.map +7 -0
  143. package/template/zh-CN/.vuepress/.cache/chunk-UJLLDWRU.js +87 -0
  144. package/template/zh-CN/.vuepress/.cache/chunk-UJLLDWRU.js.map +7 -0
  145. package/template/zh-CN/.vuepress/.cache/dayjs.js +42 -0
  146. package/template/zh-CN/.vuepress/.cache/dayjs.js.map +7 -0
  147. package/template/zh-CN/.vuepress/.cache/dayjs_plugin_localizedFormat.js +42 -0
  148. package/template/zh-CN/.vuepress/.cache/dayjs_plugin_localizedFormat.js.map +7 -0
  149. package/template/zh-CN/.vuepress/.cache/dayjs_plugin_objectSupport.js +42 -0
  150. package/template/zh-CN/.vuepress/.cache/dayjs_plugin_objectSupport.js.map +7 -0
  151. package/template/zh-CN/.vuepress/.cache/dayjs_plugin_timezone.js +42 -0
  152. package/template/zh-CN/.vuepress/.cache/dayjs_plugin_timezone.js.map +7 -0
  153. package/template/zh-CN/.vuepress/.cache/dayjs_plugin_utc.js +42 -0
  154. package/template/zh-CN/.vuepress/.cache/dayjs_plugin_utc.js.map +7 -0
  155. package/template/zh-CN/.vuepress/.cache/flowchart_js.js +4617 -0
  156. package/template/zh-CN/.vuepress/.cache/flowchart_js.js.map +7 -0
  157. package/template/zh-CN/.vuepress/.cache/lodash_debounce.js +188 -0
  158. package/template/zh-CN/.vuepress/.cache/lodash_debounce.js.map +7 -0
  159. package/template/zh-CN/.vuepress/.cache/lodash_throttle.js +203 -0
  160. package/template/zh-CN/.vuepress/.cache/lodash_throttle.js.map +7 -0
  161. package/template/zh-CN/.vuepress/.cache/mermaid.js +29764 -0
  162. package/template/zh-CN/.vuepress/.cache/mermaid.js.map +7 -0
  163. package/template/zh-CN/.vuepress/.cache/mitt.js +74 -0
  164. package/template/zh-CN/.vuepress/.cache/mitt.js.map +7 -0
  165. package/template/zh-CN/.vuepress/.cache/nprogress.js +334 -0
  166. package/template/zh-CN/.vuepress/.cache/nprogress.js.map +7 -0
  167. package/template/zh-CN/.vuepress/.cache/package.json +1 -0
  168. package/template/zh-CN/.vuepress/.cache/photoswipe.js +2411 -0
  169. package/template/zh-CN/.vuepress/.cache/photoswipe.js.map +7 -0
  170. package/template/zh-CN/.vuepress/.cache/photoswipe_dist_photoswipe-ui-default.js +659 -0
  171. package/template/zh-CN/.vuepress/.cache/photoswipe_dist_photoswipe-ui-default.js.map +7 -0
  172. package/template/zh-CN/.vuepress/.cache/register-service-worker.js +160 -0
  173. package/template/zh-CN/.vuepress/.cache/register-service-worker.js.map +7 -0
  174. package/template/zh-CN/.vuepress/.cache/reveal_js.js +1844 -0
  175. package/template/zh-CN/.vuepress/.cache/reveal_js.js.map +7 -0
  176. package/template/zh-CN/.vuepress/.cache/reveal_js_plugin_highlight_highlight_esm_js.js +4549 -0
  177. package/template/zh-CN/.vuepress/.cache/reveal_js_plugin_highlight_highlight_esm_js.js.map +7 -0
  178. package/template/zh-CN/.vuepress/.cache/reveal_js_plugin_markdown_markdown_esm_js.js +2897 -0
  179. package/template/zh-CN/.vuepress/.cache/reveal_js_plugin_markdown_markdown_esm_js.js.map +7 -0
  180. package/template/zh-CN/.vuepress/.cache/reveal_js_plugin_math_math_esm_js.js +1545 -0
  181. package/template/zh-CN/.vuepress/.cache/reveal_js_plugin_math_math_esm_js.js.map +7 -0
  182. package/template/zh-CN/.vuepress/.cache/reveal_js_plugin_notes_notes_esm_js.js +2996 -0
  183. package/template/zh-CN/.vuepress/.cache/reveal_js_plugin_notes_notes_esm_js.js.map +7 -0
  184. package/template/zh-CN/.vuepress/.cache/reveal_js_plugin_search_search_esm_js.js +811 -0
  185. package/template/zh-CN/.vuepress/.cache/reveal_js_plugin_search_search_esm_js.js.map +7 -0
  186. package/template/zh-CN/.vuepress/.cache/reveal_js_plugin_zoom_zoom_esm_js.js +118 -0
  187. package/template/zh-CN/.vuepress/.cache/reveal_js_plugin_zoom_zoom_esm_js.js.map +7 -0
  188. package/template/zh-CN/.vuepress/.cache/screenfull.js +220 -0
  189. package/template/zh-CN/.vuepress/.cache/screenfull.js.map +7 -0
  190. package/template/zh-CN/.vuepress/.cache/vue-router.js +2415 -0
  191. package/template/zh-CN/.vuepress/.cache/vue-router.js.map +7 -0
  192. package/template/zh-CN/.vuepress/.cache/vue.js +329 -0
  193. package/template/zh-CN/.vuepress/.cache/vue.js.map +7 -0
  194. package/template/zh-CN/.vuepress/.temp/blog/category.js +14 -0
  195. package/template/zh-CN/.vuepress/.temp/blog/type.js +14 -0
  196. package/template/zh-CN/.vuepress/.temp/internal/clientAppEnhances.js +19 -0
  197. package/template/zh-CN/.vuepress/.temp/internal/clientAppRootComponents.js +11 -0
  198. package/template/zh-CN/.vuepress/.temp/internal/clientAppSetups.js +19 -0
  199. package/template/zh-CN/.vuepress/.temp/internal/layoutComponents.js +8 -0
  200. package/template/zh-CN/.vuepress/.temp/internal/pagesComponents.js +80 -0
  201. package/template/zh-CN/.vuepress/.temp/internal/pagesData.js +78 -0
  202. package/template/zh-CN/.vuepress/.temp/internal/pagesRoutes.js +67 -0
  203. package/template/zh-CN/.vuepress/.temp/internal/siteData.js +135 -0
  204. package/template/zh-CN/.vuepress/.temp/internal/themeData.js +280 -0
  205. package/template/zh-CN/.vuepress/.temp/pages/404.html.js +60 -0
  206. package/template/zh-CN/.vuepress/.temp/pages/404.html.vue +1 -0
  207. package/template/zh-CN/.vuepress/.temp/pages/article/index.html.js +64 -0
  208. package/template/zh-CN/.vuepress/.temp/pages/article/index.html.vue +1 -0
  209. package/template/zh-CN/.vuepress/.temp/pages/category/categorya/index.html.js +65 -0
  210. package/template/zh-CN/.vuepress/.temp/pages/category/categorya/index.html.vue +1 -0
  211. package/template/zh-CN/.vuepress/.temp/pages/category/categoryb/index.html.js +65 -0
  212. package/template/zh-CN/.vuepress/.temp/pages/category/categoryb/index.html.vue +1 -0
  213. package/template/zh-CN/.vuepress/.temp/pages/category/index.html.js +64 -0
  214. package/template/zh-CN/.vuepress/.temp/pages/category/index.html.vue +1 -0
  215. package/template/zh-CN/.vuepress/.temp/pages/category//344/275/277/347/224/250/346/214/207/345/215/227/index.html.js +65 -0
  216. package/template/zh-CN/.vuepress/.temp/pages/category//344/275/277/347/224/250/346/214/207/345/215/227/index.html.vue +1 -0
  217. package/template/zh-CN/.vuepress/.temp/pages/encrypted/index.html.js +64 -0
  218. package/template/zh-CN/.vuepress/.temp/pages/encrypted/index.html.vue +1 -0
  219. package/template/zh-CN/.vuepress/.temp/pages/guide/disable.html.js +93 -0
  220. package/template/zh-CN/.vuepress/.temp/pages/guide/disable.html.vue +17 -0
  221. package/template/zh-CN/.vuepress/.temp/pages/guide/encrypt.html.js +80 -0
  222. package/template/zh-CN/.vuepress/.temp/pages/guide/encrypt.html.vue +5 -0
  223. package/template/zh-CN/.vuepress/.temp/pages/guide/index.html.js +70 -0
  224. package/template/zh-CN/.vuepress/.temp/pages/guide/index.html.vue +16 -0
  225. package/template/zh-CN/.vuepress/.temp/pages/guide/markdown.html.js +180 -0
  226. package/template/zh-CN/.vuepress/.temp/pages/guide/markdown.html.vue +180 -0
  227. package/template/zh-CN/.vuepress/.temp/pages/guide/page.html.js +127 -0
  228. package/template/zh-CN/.vuepress/.temp/pages/guide/page.html.vue +41 -0
  229. package/template/zh-CN/.vuepress/.temp/pages/home.html.js +159 -0
  230. package/template/zh-CN/.vuepress/.temp/pages/home.html.vue +4 -0
  231. package/template/zh-CN/.vuepress/.temp/pages/index.html.js +101 -0
  232. package/template/zh-CN/.vuepress/.temp/pages/index.html.vue +4 -0
  233. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article1.html.js +110 -0
  234. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article1.html.vue +6 -0
  235. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article2.html.js +111 -0
  236. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article2.html.vue +6 -0
  237. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article3.html.js +111 -0
  238. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article3.html.vue +6 -0
  239. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article4.html.js +111 -0
  240. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article4.html.vue +6 -0
  241. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article5.html.js +111 -0
  242. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article5.html.vue +6 -0
  243. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article6.html.js +112 -0
  244. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article6.html.vue +6 -0
  245. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article7.html.js +111 -0
  246. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article7.html.vue +6 -0
  247. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article8.html.js +111 -0
  248. package/template/zh-CN/.vuepress/.temp/pages/posts/article/article8.html.vue +6 -0
  249. package/template/zh-CN/.vuepress/.temp/pages/posts/article10.html.js +111 -0
  250. package/template/zh-CN/.vuepress/.temp/pages/posts/article10.html.vue +6 -0
  251. package/template/zh-CN/.vuepress/.temp/pages/posts/article11.html.js +111 -0
  252. package/template/zh-CN/.vuepress/.temp/pages/posts/article11.html.vue +6 -0
  253. package/template/zh-CN/.vuepress/.temp/pages/posts/article12.html.js +112 -0
  254. package/template/zh-CN/.vuepress/.temp/pages/posts/article12.html.vue +6 -0
  255. package/template/zh-CN/.vuepress/.temp/pages/posts/article9.html.js +111 -0
  256. package/template/zh-CN/.vuepress/.temp/pages/posts/article9.html.vue +6 -0
  257. package/template/zh-CN/.vuepress/.temp/pages/slide.html.js +69 -0
  258. package/template/zh-CN/.vuepress/.temp/pages/slide.html.vue +2 -0
  259. package/template/zh-CN/.vuepress/.temp/pages/slides/index.html.js +64 -0
  260. package/template/zh-CN/.vuepress/.temp/pages/slides/index.html.vue +1 -0
  261. package/template/zh-CN/.vuepress/.temp/pages/star/index.html.js +64 -0
  262. package/template/zh-CN/.vuepress/.temp/pages/star/index.html.vue +1 -0
  263. package/template/zh-CN/.vuepress/.temp/pages/tag/index.html.js +64 -0
  264. package/template/zh-CN/.vuepress/.temp/pages/tag/index.html.vue +1 -0
  265. package/template/zh-CN/.vuepress/.temp/pages/tag/markdown/index.html.js +65 -0
  266. package/template/zh-CN/.vuepress/.temp/pages/tag/markdown/index.html.vue +1 -0
  267. package/template/zh-CN/.vuepress/.temp/pages/tag/tag-a/index.html.js +65 -0
  268. package/template/zh-CN/.vuepress/.temp/pages/tag/tag-a/index.html.vue +1 -0
  269. package/template/zh-CN/.vuepress/.temp/pages/tag/tag-b/index.html.js +65 -0
  270. package/template/zh-CN/.vuepress/.temp/pages/tag/tag-b/index.html.vue +1 -0
  271. package/template/zh-CN/.vuepress/.temp/pages/tag//344/275/277/347/224/250/346/214/207/345/215/227/index.html.js +65 -0
  272. package/template/zh-CN/.vuepress/.temp/pages/tag//344/275/277/347/224/250/346/214/207/345/215/227/index.html.vue +1 -0
  273. package/template/zh-CN/.vuepress/.temp/pages/tag//346/226/207/347/253/240/345/212/240/345/257/206/index.html.js +65 -0
  274. package/template/zh-CN/.vuepress/.temp/pages/tag//346/226/207/347/253/240/345/212/240/345/257/206/index.html.vue +1 -0
  275. package/template/zh-CN/.vuepress/.temp/pages/tag//347/246/201/347/224/250/index.html.js +65 -0
  276. package/template/zh-CN/.vuepress/.temp/pages/tag//347/246/201/347/224/250/index.html.vue +1 -0
  277. package/template/zh-CN/.vuepress/.temp/pages/tag//351/241/265/351/235/242/351/205/215/347/275/256/index.html.js +65 -0
  278. package/template/zh-CN/.vuepress/.temp/pages/tag//351/241/265/351/235/242/351/205/215/347/275/256/index.html.vue +1 -0
  279. package/template/zh-CN/.vuepress/.temp/pages/timeline/index.html.js +64 -0
  280. package/template/zh-CN/.vuepress/.temp/pages/timeline/index.html.vue +1 -0
  281. package/template/zh-CN/.vuepress/.temp/sass-palette/hope-config.scss +6 -0
  282. package/template/zh-CN/.vuepress/.temp/sass-palette/hope-inject.scss +29 -0
  283. package/template/zh-CN/.vuepress/.temp/sass-palette/hope-palette.scss +4 -0
  284. package/template/zh-CN/.vuepress/.temp/sass-palette/hope-style.scss +1 -0
  285. package/template/zh-CN/.vuepress/.temp/sass-palette/load-hope.js +1 -0
  286. package/template/zh-CN/.vuepress/.temp/theme-hope/theme-color.scss +1 -0
  287. package/template/zh-CN/.vuepress/.temp/vite-root/index.html +13 -0
  288. package/template/zh-CN/.vuepress/config.ts +28 -0
  289. package/template/zh-CN/.vuepress/navbar.ts +52 -0
  290. package/template/zh-CN/.vuepress/public/assets/icon/apple-icon-152.png +0 -0
  291. package/template/zh-CN/.vuepress/public/assets/icon/chrome-192.png +0 -0
  292. package/template/zh-CN/.vuepress/public/assets/icon/chrome-512.png +0 -0
  293. package/template/zh-CN/.vuepress/public/assets/icon/chrome-mask-192.png +0 -0
  294. package/template/zh-CN/.vuepress/public/assets/icon/chrome-mask-512.png +0 -0
  295. package/template/zh-CN/.vuepress/public/assets/icon/guide-maskable.png +0 -0
  296. package/template/zh-CN/.vuepress/public/assets/icon/guide-monochrome.png +0 -0
  297. package/template/zh-CN/.vuepress/public/assets/icon/ms-icon-144.png +0 -0
  298. package/template/zh-CN/.vuepress/public/favicon.ico +0 -0
  299. package/template/zh-CN/.vuepress/public/logo.png +0 -0
  300. package/template/zh-CN/.vuepress/public/logo.svg +1 -0
  301. package/template/zh-CN/.vuepress/sidebar.ts +45 -0
  302. package/template/zh-CN/.vuepress/styles/index.scss +0 -0
  303. package/template/zh-CN/.vuepress/styles/palette.scss +0 -0
  304. package/template/zh-CN/.vuepress/themeConfig.ts +154 -0
  305. package/template/zh-CN/README.md +38 -0
  306. package/template/zh-CN/guide/README.md +15 -0
  307. package/template/zh-CN/guide/disable.md +41 -0
  308. package/template/zh-CN/guide/encrypt.md +15 -0
  309. package/template/zh-CN/guide/markdown.md +302 -0
  310. package/template/zh-CN/guide/page.md +60 -0
  311. package/template/zh-CN/home.md +85 -0
  312. package/template/zh-CN/posts/article/article1.md +19 -0
  313. package/template/zh-CN/posts/article/article2.md +20 -0
  314. package/template/zh-CN/posts/article/article3.md +20 -0
  315. package/template/zh-CN/posts/article/article4.md +20 -0
  316. package/template/zh-CN/posts/article/article5.md +20 -0
  317. package/template/zh-CN/posts/article/article6.md +21 -0
  318. package/template/zh-CN/posts/article/article7.md +20 -0
  319. package/template/zh-CN/posts/article/article8.md +20 -0
  320. package/template/zh-CN/posts/article10.md +20 -0
  321. package/template/zh-CN/posts/article11.md +20 -0
  322. package/template/zh-CN/posts/article12.md +21 -0
  323. package/template/zh-CN/posts/article9.md +20 -0
  324. package/template/zh-CN/slide.md +429 -0
  325. package/template/.vuepress/config.ts +0 -212
  326. package/template/.vuepress/configs/index.ts +0 -2
  327. package/template/.vuepress/configs/navbar/en.ts +0 -52
  328. package/template/.vuepress/configs/navbar/zh.ts +0 -52
  329. package/template/.vuepress/configs/sidebar/en.ts +0 -64
  330. package/template/.vuepress/configs/sidebar/zh.ts +0 -67
package/CHANGELOG.md CHANGED
@@ -3,6 +3,32 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.0.0-alpha.28](https://github.com/vuepress-theme-hope/vuepress-theme-hope/compare/v2.0.0-alpha.27...v2.0.0-alpha.28) (2022-02-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **create:** fix command ([ee2c91d](https://github.com/vuepress-theme-hope/vuepress-theme-hope/commit/ee2c91d9b8eeb6af627457db889dccacb03835d8))
11
+
12
+ ### Features
13
+
14
+ - **create:** add i18n support ([4605db5](https://github.com/vuepress-theme-hope/vuepress-theme-hope/commit/4605db5261b442281ce1f80c7cdc3af122b22c90))
15
+
16
+ # [2.0.0-alpha.27](https://github.com/vuepress-theme-hope/vuepress-theme-hope/compare/v2.0.0-alpha.26...v2.0.0-alpha.27) (2022-02-16)
17
+
18
+ ### Bug Fixes
19
+
20
+ - **create:** fix template folder path ([3fcc980](https://github.com/vuepress-theme-hope/vuepress-theme-hope/commit/3fcc980865c14a74c54bc7950e93cadab3da2d00))
21
+
22
+ # [2.0.0-alpha.26](https://github.com/vuepress-theme-hope/vuepress-theme-hope/compare/v2.0.0-alpha.25...v2.0.0-alpha.26) (2022-02-16)
23
+
24
+ **Note:** Version bump only for package create-vuepress-theme-hope
25
+
26
+ # [2.0.0-alpha.25](https://github.com/vuepress-theme-hope/vuepress-theme-hope/compare/v2.0.0-alpha.24...v2.0.0-alpha.25) (2022-02-16)
27
+
28
+ ### Bug Fixes
29
+
30
+ - **create:** fix command ([cc9cb54](https://github.com/vuepress-theme-hope/vuepress-theme-hope/commit/cc9cb54f5b274c2e186e50ec53353caa3d997d33))
31
+
6
32
  # [2.0.0-alpha.24](https://github.com/vuepress-theme-hope/vuepress-theme-hope/compare/v2.0.0-alpha.23...v2.0.0-alpha.24) (2022-02-16)
7
33
 
8
34
  ### Features
package/lib/node/index.js CHANGED
@@ -1,2 +1,3 @@
1
- "use strict";var e=require("fs"),s=require("path"),r=require("@mr-hope/vuepress-shared"),t=require("cac"),a=require("inquirer"),n=require("execa"),o=require("@vuepress/utils"),i=require("https");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=c(n);const l=(e,s)=>{const r=o.path.dirname(s);o.fs.ensureDirSync(r);const t=o.fs.createReadStream(e),a=o.fs.createWriteStream(s);t.pipe(a)},u=(e,s)=>{o.fs.ensureDirSync(s);o.fs.readdirSync(e,{withFileTypes:!0}).forEach((r=>{r.isFile()?l(`${e}/${r.name}`,`${s}/${r.name}`):r.isDirectory()&&u(`${e}/${r.name}`,`${s}/${r.name}`)}))},d=e=>new Promise(((s,r)=>{i.get(`https://registry.npmjs.org/-/package/${e}/dist-tags`,(t=>{if(200===t.statusCode){let e="";t.on("data",(s=>e+=s)),t.on("end",(()=>{s(JSON.parse(e).next)}))}else r(new Error(`Get ${e} version failed, please check your network!`))})).on("error",(()=>{r(new Error(`Get ${e} version failed, please check your network!`))}))})),g={"zh-CN":{getVersion:"获取依赖的最新版本...",createPackage:"生成 package.json...",updatePackage:"更新 package.json...",template:"生成模板...",wait:"这可能需要数分钟,请耐心等待.\n我们无法正确输出子进程的进度条,所以进程可能会看似未响应",install:"安装依赖...",success:"模板已成功生成!",devServerAsk:"是否想要现在启动 Demo 查看?",devServer:"启动开发服务器...\n启动成功后,请在浏览器输入给出的开发服务器地址(默认为 'localhost:8080')",hint:'提示: 请使用 "yarn run docs:dev" 命令启动开发服务器',nameMessage:"设置应用名称",nameError:"应用名称应只包含小写字母、数字和连接线 (-)",versionMessage:"设置应用版本号",versionError:"此版本无效,版本号应为 'x.x.x'",descriptionMessage:"设置应用描述",licenseMessage:"设置协议"},"en-US":{getVersion:"Getting lastest version of deps...",createPackage:"Generating package.json...",updatePackage:"Updating package.json...",template:"Generating Template...",wait:"This may take a few minutes, please be patient.\nWe can not correctly output progress bar from child process, so the process may look stuck.",install:"Installing Deps...",success:"Successful Generated!",devServerAsk:"Would you like to preview template now?",devServer:"Staring dev server...\nAfter the dev server starts running, please visit the given server link ('localhost:8080' by default)",hint:'Hint: You should execute "yarn run docs:dev" to start dev server.',nameMessage:"Your project name",nameError:"package name should only contain lowercase characters, numbers and dash",versionMessage:"Your project version",versionError:"This version is not a valid one. Version should be like 'x.x.x'",descriptionMessage:"Your project description",licenseMessage:"Your project lincense"}},m=async(e,s)=>{const r=(e=>n.sync(e?"yarn":"npm",["config","get","registry"]).stdout)(s);if("en-US"===e||"https://registry.npmmirror.com/"===r)return r;const{registry:t}=await a.prompt([{name:"registry",type:"list",message:"选择你想使用的源",choices:["国内镜像源","当前源"]}]);return"国内镜像源"===t?"https://registry.npmmirror.com/":r},v=t.cac("vuepress-theme-hope"),h=(()=>{try{return n.sync("yarn --version",{stdio:"ignore"}),!0}catch(e){return!1}})()?"yarn":"npm";v.command("[dir]","Generate a new vuepress-theme-hope project").action((async t=>{if(!t)return v.outputHelp();const{lang:n,message:i}=await(async()=>{const{language:e}=await a.prompt([{name:"language",type:"list",message:"Select a language to display",choices:["en-US","zh-CN"]}]);return{lang:e,message:g[e]}})(),c=s.resolve(process.cwd(),t),y=s.resolve(process.cwd(),"package.json"),f={"docs:build":`vuepress build ${t}`,"docs:clean-dev":`vuepress dev ${t} --no-cache`,"docs:dev":`vuepress dev ${t}`,"docs:eject-theme":`vuepress eject-hope ${t}`};console.log(i.getVersion);const w={vuepress:`^${await d("vuepress")}`,"vuepress-theme-hope":`^${await d("vuepress-theme-hope")}`};if(e.existsSync(c)||e.mkdirSync(c),e.existsSync(y)){console.log(i.updatePackage);const s=JSON.parse(e.readFileSync(y,{encoding:"utf-8"}));r.deepAssign(s,{scripts:f,devDependencies:w}),e.writeFileSync(y,`${JSON.stringify(s,null,2)}\n`,{encoding:"utf-8"})}else{console.log(i.createPackage);const s={...await a.prompt([{name:"name",type:"input",message:i.nameMessage,default:"vuepress-theme-hope-project",validate:e=>!!/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u.exec(e)||i.nameError},{name:"version",type:"input",message:i.versionMessage,default:"1.0.0",validate:e=>!!/^[0-9]+\.[0-9]+\.(?:[0=9]+|[0-9]+-[a-z]+\.[0-9])$/u.exec(e)||i.versionError},{name:"description",type:"input",message:i.descriptionMessage,default:"A project of vuepress-theme-hope"},{name:"license",type:"input",message:i.licenseMessage,default:"MIT"}]),scripts:f,devDependencies:w};e.writeFileSync(y,`${JSON.stringify(s,null,2)}\n`,{encoding:"utf-8"})}var S,k;console.log(i.template),S=s.resolve(__dirname,"../template"),k=s.resolve(process.cwd(),t),o.fs.statSync(S).isDirectory()?u(S,k):o.fs.statSync(S).isFile()&&l(S,k),console.log(i.install),console.warn(i.wait);const $=await m(n,h);p.default.sync(h,["install","--registry",$],{stdout:"inherit"}),console.log(i.success);const{choise:j}=await a.prompt([{name:"choise",type:"list",message:i.devServerAsk,choices:["Yes","No"]}]);"Yes"===j?(console.log(i.devServer),await p.default(h,["run","docs:dev"],{stdout:"inherit"})):console.log(i.hint)})),v.help((()=>[{title:"yarn create vuepress-theme-hope <dir> / npm init vuepress-theme-hope <dir>",body:"Create a vuepress-theme-hope template in <dir>"}])),v.parse();
1
+ #!/usr/bin/env node
2
+ "use strict";var e=require("fs"),s=require("path"),r=require("cac"),t=require("inquirer"),a=require("execa"),n=require("https");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(a);const c=(e,...s)=>{if(0===s.length)return e;const r=s.shift()||{};return Object.keys(r).forEach((s=>{"object"!=typeof e[s]||Array.isArray(e[s])||"object"!=typeof r[s]||Array.isArray(r[s])?"object"==typeof r[s]?Array.isArray(r[s])?e[s]=[...r[s]]:e[s]={...r[s]}:e[s]=r[s]:c(e[s],r[s])})),c(e,...s)},p=s=>{try{e.readdirSync(s)}catch(r){e.mkdirSync(s)}},l=(r,t)=>{const a=s.dirname(t);p(a);const n=e.createReadStream(r),o=e.createWriteStream(t);n.pipe(o)},u=(s,r)=>{p(r);e.readdirSync(s,{withFileTypes:!0}).forEach((e=>{e.isFile()?l(`${s}/${e.name}`,`${r}/${e.name}`):e.isDirectory()&&u(`${s}/${e.name}`,`${r}/${e.name}`)}))},d=e=>new Promise(((s,r)=>{n.get(`https://registry.npmjs.org/-/package/${e}/dist-tags`,(t=>{if(200===t.statusCode){let e="";t.on("data",(s=>e+=s)),t.on("end",(()=>{s(JSON.parse(e).next)}))}else r(new Error(`Get ${e} version failed, please check your network!`))})).on("error",(()=>{r(new Error(`Get ${e} version failed, please check your network!`))}))})),g={"zh-CN":{getVersion:"获取依赖的最新版本...",createPackage:"生成 package.json...",updatePackage:"更新 package.json...",template:"生成模板...",wait:"这可能需要数分钟,请耐心等待.\n我们无法正确输出子进程的进度条,所以进程可能会看似未响应",install:"安装依赖...",success:"模板已成功生成!",devServerAsk:"是否想要现在启动 Demo 查看?",devServer:"启动开发服务器...\n启动成功后,请在浏览器输入给出的开发服务器地址(默认为 'localhost:8080')",hint:'提示: 请使用 "yarn run docs:dev" 命令启动开发服务器',nameMessage:"设置应用名称",nameError:"应用名称应只包含小写字母、数字和连接线 (-)",versionMessage:"设置应用版本号",versionError:"此版本无效,版本号应为 'x.x.x'",descriptionMessage:"设置应用描述",licenseMessage:"设置协议",i18nMessage:"项目需要用到多语言么?"},"en-US":{getVersion:"Getting lastest version of deps...",createPackage:"Generating package.json...",updatePackage:"Updating package.json...",template:"Generating Template...",wait:"This may take a few minutes, please be patient.\nWe can not correctly output progress bar from child process, so the process may look stuck.",install:"Installing Deps...",success:"Successful Generated!",devServerAsk:"Would you like to preview template now?",devServer:"Staring dev server...\nAfter the dev server starts running, please visit the given server link ('localhost:8080' by default)",hint:'Hint: You should execute "yarn run docs:dev" to start dev server.',nameMessage:"Your project name",nameError:"package name should only contain lowercase characters, numbers and dash",versionMessage:"Your project version",versionError:"This version is not a valid one. Version should be like 'x.x.x'",descriptionMessage:"Your project description",licenseMessage:"Your project lincense",i18nMessage:"Does the project need mutiple languages?"}},m=async()=>{const{language:e}=await t.prompt([{name:"language",type:"list",message:"Select a language to display",choices:["en-US","zh-CN"]}]);return{lang:e,message:g[e]}},v=async(e,s)=>{const r=(e=>a.sync(e?"yarn":"npm",["config","get","registry"]).stdout)(s);if("en-US"===e||"https://registry.npmmirror.com/"===r)return r;const{registry:n}=await t.prompt([{name:"registry",type:"list",message:"选择你想使用的源",choices:["国内镜像源","当前源"]}]);return"国内镜像源"===n?"https://registry.npmmirror.com/":r},y=r.cac("vuepress-theme-hope"),h=(()=>{try{return a.sync("yarn --version",{stdio:"ignore"}),!0}catch(e){return!1}})()?"yarn":"npm";y.command("[dir]","Generate a new vuepress-theme-hope project").action((async r=>{if(!r)return y.outputHelp();const{lang:a,message:n}=await m(),o=s.resolve(process.cwd(),r),p=s.resolve(process.cwd(),"package.json"),g={"docs:build":`vuepress build ${r}`,"docs:clean-dev":`vuepress dev ${r} --clean-cache`,"docs:dev":`vuepress dev ${r}`};console.log(n.getVersion);const f={vuepress:`^${await d("vuepress")}`,"vuepress-theme-hope":`^${await d("vuepress-theme-hope")}`};if(e.existsSync(o)||e.mkdirSync(o),e.existsSync(p)){console.log(n.updatePackage);const s=JSON.parse(e.readFileSync(p,{encoding:"utf-8"}));c(s,{scripts:g,devDependencies:f}),e.writeFileSync(p,`${JSON.stringify(s,null,2)}\n`,{encoding:"utf-8"})}else{console.log(n.createPackage);const s={...await t.prompt([{name:"name",type:"input",message:n.nameMessage,default:"vuepress-theme-hope-template",validate:e=>!!/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u.exec(e)||n.nameError},{name:"version",type:"input",message:n.versionMessage,default:"2.0.0",validate:e=>!!/^[0-9]+\.[0-9]+\.(?:[0=9]+|[0-9]+-[a-z]+\.[0-9])$/u.exec(e)||n.versionError},{name:"description",type:"input",message:n.descriptionMessage,default:"A project of vuepress-theme-hope"},{name:"license",type:"input",message:n.licenseMessage,default:"MIT"}]),scripts:g,devDependencies:f};e.writeFileSync(p,`${JSON.stringify(s,null,2)}\n`,{encoding:"utf-8"})}const{i18n:w}=await t.prompt([{name:"i18n",type:"list",message:n.licenseMessage,choices:["Yes","No"]}]);console.log(n.template);const k="Yes"===w?"i18n":a;var S,$;S=s.resolve(__dirname,"../../template",k),$=s.resolve(process.cwd(),r),e.statSync(S).isDirectory()?u(S,$):e.statSync(S).isFile()&&l(S,$),console.log(n.install),console.warn(n.wait);const j=await v(a,h);i.default.sync(h,["install","--registry",j],{stdout:"inherit"}),console.log(n.success);const{choise:M}=await t.prompt([{name:"choise",type:"list",message:n.devServerAsk,choices:["Yes","No"]}]);"Yes"===M?(console.log(n.devServer),await i.default(h,["run","docs:dev"],{stdout:"inherit"})):console.log(n.hint)})),y.help((()=>[{title:"yarn create vuepress-theme-hope <dir> / npm init vuepress-theme-hope <dir>",body:"Create a vuepress-theme-hope template in <dir>"}])),y.parse();
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/node/copy.ts","../../src/node/checkVersion.ts","../../src/node/i18n.ts","../../src/node/registry.ts","../../src/node/index.ts","../../src/node/hasYarn.ts"],"sourcesContent":[null,null,null,null,null,null],"names":["copyFile","srcFile","targetFile","targetDir","path","dirname","fs","ensureDirSync","rs","createReadStream","ws","createWriteStream","pipe","copyDir","srcDir","readdirSync","withFileTypes","forEach","file","isFile","name","isDirectory","checkForLatestVersion","packageName","Promise","resolve","reject","get","res","statusCode","body","on","data","JSON","parse","next","Error","i18n","getVersion","createPackage","updatePackage","template","wait","install","success","devServerAsk","devServer","hint","nameMessage","nameError","versionMessage","versionError","descriptionMessage","licenseMessage","getRegistry","async","lang","bin","userRegistry","sync","stdout","getUserRegistry","registry","prompt","type","message","choices","cli","cac","stdio","e","detectYarn","command","action","dir","outputHelp","language","getLanguage","targetFolder","process","cwd","packageJsonPath","scripts","console","log","devDependencies","vuepress","existsSync","mkdirSync","packageContent","readFileSync","encoding","deepAssign","writeFileSync","stringify","default","validate","input","exec","src","target","__dirname","statSync","warn","execa","choise","help","title"],"mappings":"sRAEA,MAAMA,EAAW,CAACC,EAAiBC,KACjC,MAAMC,EAAYC,OAAKC,QAAQH,GAE/BI,KAAGC,cAAcJ,GAEjB,MAAMK,EAAKF,KAAGG,iBAAiBR,GACzBS,EAAKJ,KAAGK,kBAAkBT,GAEhCM,EAAGI,KAAKF,IAGJG,EAAU,CAACC,EAAgBX,KAC/BG,KAAGC,cAAcJ,GAEHG,KAAGS,YAAYD,EAAQ,CAAEE,eAAe,IAEhDC,SAASC,IACTA,EAAKC,SACPnB,EAAS,GAAGc,KAAUI,EAAKE,OAAQ,GAAGjB,KAAae,EAAKE,QACjDF,EAAKG,eACZR,EAAQ,GAAGC,KAAUI,EAAKE,OAAQ,GAAGjB,KAAae,EAAKE,YCpBhDE,EAAyBC,GACpC,IAAIC,SAAQ,CAACC,EAASC,KACpBC,MACE,wCAAwCJ,eACvCK,IACC,GAAuB,MAAnBA,EAAIC,WAAoB,CAC1B,IAAIC,EAAO,GAEXF,EAAIG,GAAG,QAASC,GAAUF,GAAQE,IAClCJ,EAAIG,GAAG,OAAO,KAEZN,EAAQQ,KAAKC,MAAMJ,GAAMK,cAG3BT,EACE,IAAIU,MACF,OAAOb,oDAKfQ,GAAG,SAAS,KACZL,EACE,IAAIU,MACF,OAAOb,uDCHJc,EAAiC,CAC5C,QAAS,CACPC,WAAY,eACZC,cAAe,qBACfC,cAAe,qBACfC,SAAU,UACVC,KAAM,gDACNC,QAAS,UACTC,QAAS,WACTC,aAAc,oBACdC,UACE,4DACFC,KAAM,wCACNC,YAAa,SACbC,UAAW,0BACXC,eAAgB,UAChBC,aAAc,sBACdC,mBAAoB,SACpBC,eAAgB,QAEl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AYE,EAAMC,GAEzC+C,UAAM7C,KAAKF,EAAK,CAAC,UAAW,aAAcK,GAAW,CACnDF,OAAQ,YAGVuB,QAAQC,IAAInB,EAAQrB,SAEpB,MAAM6D,OAAEA,SAAiB1C,SAAiC,CACxD,CACE3C,KAAM,SACN4C,KAAM,OACNC,QAASA,EAAQpB,aACjBqB,QAAS,CAAC,MAAO,SAIN,QAAXuC,GACFtB,QAAQC,IAAInB,EAAQnB,iBAEd0D,UAAM/C,EAAK,CAAC,MAAO,YAAa,CACpCG,OAAQ,aAELuB,QAAQC,IAAInB,EAAQlB,SAG/BoB,EAAIuC,MAAK,IAAM,CACb,CACEC,MACE,6EACF7E,KAAM,qDAIVqC,EAAIjC"}
1
+ {"version":3,"file":"index.js","sources":["../../src/node/deepAssign.ts","../../src/node/copy.ts","../../src/node/checkVersion.ts","../../src/node/i18n.ts","../../src/node/registry.ts","../../src/node/index.ts","../../src/node/hasYarn.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":["deepAssign","originObject","assignObjects","length","assignObject","shift","Object","keys","forEach","property","Array","isArray","ensureDirExistSync","dirPath","readdirSync","err","mkdirSync","copyFile","srcFile","targetFile","targetDir","dirname","rs","createReadStream","ws","createWriteStream","pipe","copyDir","srcDir","withFileTypes","file","isFile","name","isDirectory","checkForNextVersion","packageName","Promise","resolve","reject","get","res","statusCode","body","on","data","JSON","parse","next","Error","i18n","getVersion","createPackage","updatePackage","template","wait","install","success","devServerAsk","devServer","hint","nameMessage","nameError","versionMessage","versionError","descriptionMessage","licenseMessage","i18nMessage","getLanguage","async","language","prompt","type","message","choices","lang","getRegistry","bin","userRegistry","sync","stdout","getUserRegistry","registry","cli","cac","stdio","e","detectYarn","command","action","dir","outputHelp","targetFolder","process","cwd","packageJsonPath","scripts","console","log","devDependencies","vuepress","existsSync","packageContent","readFileSync","encoding","writeFileSync","stringify","default","validate","input","exec","templateFolder","src","target","__dirname","statSync","warn","execa","choise","help","title"],"mappings":";mNAIO,MAAMA,EAA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M,OACNuC,KAAM,OACNC,QAASA,EAAQP,eACjBQ,QAAS,CAAC,MAAO,SAIrBuB,QAAQC,IAAIzB,EAAQnB,UAEpB,MAAMyD,EAA0B,QAAT7D,EAAiB,OAASyB,EJxFjC,IAACqC,EAAaC,EAAbD,EI2Ff1E,UAAQ4E,UAAW,iBAAkBH,GJ3FTE,EI4F5B3E,UAAQuD,QAAQC,MAAOJ,GJ3FvByB,WAASH,GAAK9E,cAAeN,EAAQoF,EAAKC,GACrCE,WAASH,GAAKhF,UAAUd,EAAS8F,EAAKC,GI6F7ChB,QAAQC,IAAIzB,EAAQjB,SACpByC,QAAQmB,KAAK3C,EAAQlB,MAErB,MAAM2B,QAAiBN,EAAYD,EAAME,GAEzCwC,UAAMtC,KAAKF,EAAK,CAAC,UAAW,aAAcK,GAAW,CACnDF,OAAQ,YAGViB,QAAQC,IAAIzB,EAAQhB,SAEpB,MAAM6D,OAAEA,SAAiB/C,SAAiC,CACxD,CACEtC,KAAM,SACNuC,KAAM,OACNC,QAASA,EAAQf,aACjBgB,QAAS,CAAC,MAAO,SAIN,QAAX4C,GACFrB,QAAQC,IAAIzB,EAAQd,iBAEd0D,UAAMxC,EAAK,CAAC,MAAO,YAAa,CACpCG,OAAQ,aAELiB,QAAQC,IAAIzB,EAAQb,SAG/BuB,EAAIoC,MAAK,IAAM,CACb,CACEC,MACE,6EACF7E,KAAM,qDAIVwC,EAAIpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vuepress-theme-hope",
3
- "version": "2.0.0-alpha.24",
3
+ "version": "2.0.0-alpha.28",
4
4
  "description": "Create vuepress-theme-hope demo project helper",
5
5
  "keywords": [
6
6
  "create",
@@ -32,12 +32,10 @@
32
32
  "dev:ts": "tsc -b tsconfig.build.json --watch"
33
33
  },
34
34
  "dependencies": {
35
- "@mr-hope/vuepress-shared": "2.0.0-alpha.24",
36
35
  "@types/inquirer": "^8.2.0",
37
- "@vuepress/utils": "2.0.0-beta.35",
38
36
  "cac": "^6.7.12",
39
37
  "execa": "^5.1.1",
40
38
  "inquirer": "^8.2.0"
41
39
  },
42
- "gitHead": "095aa332146400730b697b08063c45e72f514160"
40
+ "gitHead": "adb9f722674c63199108f0ff278ea48fcaf0c529"
43
41
  }
package/readme.md CHANGED
@@ -7,14 +7,14 @@ Create template shortcut for vuepress-theme-hope.
7
7
  ## Usage
8
8
 
9
9
  ```bash
10
- npm init vuepress-theme-hope <dir>
10
+ npm init vuepress-theme-hope@next <dir>
11
11
  ```
12
12
 
13
- Or
13
+ <!-- Or
14
14
 
15
15
  ```bash
16
16
  yarn create vuepress-theme-hope <dir>
17
- ```
17
+ ``` -->
18
18
 
19
19
  ---
20
20
 
@@ -23,11 +23,11 @@ yarn create vuepress-theme-hope <dir>
23
23
  ## 使用
24
24
 
25
25
  ```bash
26
- npm init vuepress-theme-hope <dir>
26
+ npm init vuepress-theme-hope@next <dir>
27
27
  ```
28
28
 
29
- 或
29
+ <!-- 或
30
30
 
31
31
  ```bash
32
32
  yarn create vuepress-theme-hope <dir>
33
- ```
33
+ ``` -->
package/rollup.config.js CHANGED
@@ -1,5 +1,14 @@
1
1
  import { rollupTypescript } from "../../scripts/rollup";
2
2
 
3
3
  export default rollupTypescript("node/index", {
4
- external: ["@mr-hope/vuepress-shared", "@vuepress/utils", "https"],
4
+ external: [
5
+ "@mr-hope/vuepress-shared",
6
+ "cac",
7
+ "execa",
8
+ "fs",
9
+ "https",
10
+ "inquirer",
11
+ "path",
12
+ ],
13
+ preserveShebang: true,
5
14
  });
@@ -1,6 +1,6 @@
1
1
  import { get } from "https";
2
2
 
3
- export const checkForLatestVersion = (packageName: string): Promise<string> =>
3
+ export const checkForNextVersion = (packageName: string): Promise<string> =>
4
4
  new Promise((resolve, reject) => {
5
5
  get(
6
6
  `https://registry.npmjs.org/-/package/${packageName}/dist-tags`,
package/src/node/copy.ts CHANGED
@@ -1,20 +1,35 @@
1
- import { fs, path } from "@vuepress/utils";
1
+ import {
2
+ createReadStream,
3
+ createWriteStream,
4
+ mkdirSync,
5
+ readdirSync,
6
+ statSync,
7
+ } from "fs";
8
+ import { dirname } from "path";
9
+
10
+ const ensureDirExistSync = (dirPath: string): void => {
11
+ try {
12
+ readdirSync(dirPath);
13
+ } catch (err) {
14
+ mkdirSync(dirPath);
15
+ }
16
+ };
2
17
 
3
18
  const copyFile = (srcFile: string, targetFile: string): void => {
4
- const targetDir = path.dirname(targetFile);
19
+ const targetDir = dirname(targetFile);
5
20
 
6
- fs.ensureDirSync(targetDir);
21
+ ensureDirExistSync(targetDir);
7
22
 
8
- const rs = fs.createReadStream(srcFile); // create read stream
9
- const ws = fs.createWriteStream(targetFile); // create write stream
23
+ const rs = createReadStream(srcFile); // create read stream
24
+ const ws = createWriteStream(targetFile); // create write stream
10
25
 
11
26
  rs.pipe(ws);
12
27
  };
13
28
 
14
29
  const copyDir = (srcDir: string, targetDir: string): void => {
15
- fs.ensureDirSync(targetDir);
30
+ ensureDirExistSync(targetDir);
16
31
 
17
- const files = fs.readdirSync(srcDir, { withFileTypes: true });
32
+ const files = readdirSync(srcDir, { withFileTypes: true });
18
33
 
19
34
  files.forEach((file) => {
20
35
  if (file.isFile())
@@ -25,6 +40,6 @@ const copyDir = (srcDir: string, targetDir: string): void => {
25
40
  };
26
41
 
27
42
  export const copy = (src: string, target: string): void => {
28
- if (fs.statSync(src).isDirectory()) copyDir(src, target);
29
- else if (fs.statSync(src).isFile()) copyFile(src, target);
43
+ if (statSync(src).isDirectory()) copyDir(src, target);
44
+ else if (statSync(src).isFile()) copyFile(src, target);
30
45
  };
@@ -0,0 +1,42 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
+ type IAnyObject = Record<string, any>;
3
+
4
+ /** Deep merge objects to the first one */
5
+ export const deepAssign = <
6
+ T extends IAnyObject,
7
+ U extends IAnyObject = T,
8
+ V extends IAnyObject = T
9
+ >(
10
+ originObject: T,
11
+ ...assignObjects: U[]
12
+ ): V => {
13
+ if (assignObjects.length === 0) return originObject as V;
14
+
15
+ /** Object being merged */
16
+ const assignObject = (assignObjects.shift() as IAnyObject) || {};
17
+
18
+ Object.keys(assignObject).forEach((property) => {
19
+ if (
20
+ typeof originObject[property] === "object" &&
21
+ !Array.isArray(originObject[property]) &&
22
+ typeof assignObject[property] === "object" &&
23
+ !Array.isArray(assignObject[property])
24
+ )
25
+ deepAssign(originObject[property], assignObject[property]);
26
+ else if (typeof assignObject[property] === "object")
27
+ if (Array.isArray(assignObject[property]))
28
+ (originObject as IAnyObject)[property] = [
29
+ ...(assignObject[property] as unknown[]),
30
+ ];
31
+ else
32
+ (originObject as IAnyObject)[property] = {
33
+ ...(assignObject[property] as Record<string, unknown>),
34
+ };
35
+ else
36
+ (originObject as IAnyObject)[property] = assignObject[
37
+ property
38
+ ] as unknown;
39
+ });
40
+
41
+ return deepAssign(originObject, ...assignObjects);
42
+ };
package/src/node/i18n.ts CHANGED
@@ -19,6 +19,7 @@ export interface CreateI18n {
19
19
  versionError: string;
20
20
  descriptionMessage: string;
21
21
  licenseMessage: string;
22
+ i18nMessage: string;
22
23
  }
23
24
 
24
25
  export const i18n: Record<Lang, CreateI18n> = {
@@ -40,6 +41,7 @@ export const i18n: Record<Lang, CreateI18n> = {
40
41
  versionError: "此版本无效,版本号应为 'x.x.x'",
41
42
  descriptionMessage: "设置应用描述",
42
43
  licenseMessage: "设置协议",
44
+ i18nMessage: "项目需要用到多语言么?",
43
45
  },
44
46
  "en-US": {
45
47
  getVersion: "Getting lastest version of deps...",
@@ -61,6 +63,7 @@ export const i18n: Record<Lang, CreateI18n> = {
61
63
  "This version is not a valid one. Version should be like 'x.x.x'",
62
64
  descriptionMessage: "Your project description",
63
65
  licenseMessage: "Your project lincense",
66
+ i18nMessage: "Does the project need mutiple languages?",
64
67
  },
65
68
  };
66
69
 
package/src/node/index.ts CHANGED
@@ -1,11 +1,12 @@
1
+ #!/usr/bin/env node
1
2
  import { existsSync, mkdirSync, writeFileSync, readFileSync } from "fs";
2
3
  import { resolve } from "path";
3
- import { deepAssign } from "@mr-hope/vuepress-shared";
4
+ import { deepAssign } from "./deepAssign";
4
5
  import { cac } from "cac";
5
6
  import { prompt } from "inquirer";
6
7
  import execa from "execa";
7
8
  import { copy } from "./copy";
8
- import { checkForLatestVersion } from "./checkVersion";
9
+ import { checkForNextVersion } from "./checkVersion";
9
10
  import { detectYarn } from "./hasYarn";
10
11
  import { getLanguage } from "./i18n";
11
12
  import { getRegistry } from "./registry";
@@ -24,15 +25,14 @@ cli
24
25
  const packageJsonPath = resolve(process.cwd(), "package.json");
25
26
  const scripts = {
26
27
  "docs:build": `vuepress build ${dir}`,
27
- "docs:clean-dev": `vuepress dev ${dir} --no-cache`,
28
+ "docs:clean-dev": `vuepress dev ${dir} --clean-cache`,
28
29
  "docs:dev": `vuepress dev ${dir}`,
29
- "docs:eject-theme": `vuepress eject-hope ${dir}`,
30
30
  };
31
31
 
32
32
  console.log(message.getVersion);
33
33
 
34
- const vuepressVersion = await checkForLatestVersion("vuepress");
35
- const themeVersion = await checkForLatestVersion("vuepress-theme-hope");
34
+ const vuepressVersion = await checkForNextVersion("vuepress");
35
+ const themeVersion = await checkForNextVersion("vuepress-theme-hope");
36
36
 
37
37
  const devDependencies = {
38
38
  vuepress: `^${vuepressVersion}`,
@@ -71,7 +71,7 @@ cli
71
71
  name: "name",
72
72
  type: "input",
73
73
  message: message.nameMessage,
74
- default: "vuepress-theme-hope-project",
74
+ default: "vuepress-theme-hope-template",
75
75
  validate: (input: string): true | string =>
76
76
  /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u.exec(
77
77
  input
@@ -83,7 +83,7 @@ cli
83
83
  name: "version",
84
84
  type: "input",
85
85
  message: message.versionMessage,
86
- default: "1.0.0",
86
+ default: "2.0.0",
87
87
  validate: (input: string): true | string =>
88
88
  /^[0-9]+\.[0-9]+\.(?:[0=9]+|[0-9]+-[a-z]+\.[0-9])$/u.exec(input)
89
89
  ? true
@@ -112,9 +112,27 @@ cli
112
112
  );
113
113
  }
114
114
 
115
+ interface I18nAnswer {
116
+ i18n: "Yes" | "No";
117
+ }
118
+
119
+ const { i18n } = await prompt<I18nAnswer>([
120
+ {
121
+ name: "i18n",
122
+ type: "list",
123
+ message: message.licenseMessage,
124
+ choices: ["Yes", "No"],
125
+ },
126
+ ]);
127
+
115
128
  console.log(message.template);
116
129
 
117
- copy(resolve(__dirname, "../template"), resolve(process.cwd(), dir));
130
+ const templateFolder = i18n === "Yes" ? "i18n" : lang;
131
+
132
+ copy(
133
+ resolve(__dirname, "../../template", templateFolder),
134
+ resolve(process.cwd(), dir)
135
+ );
118
136
 
119
137
  console.log(message.install);
120
138
  console.warn(message.wait);
@@ -0,0 +1,28 @@
1
+ import { defineHopeConfig } from "vuepress-theme-hope";
2
+ import themeConfig from "./themeConfig";
3
+
4
+ export default defineHopeConfig({
5
+ base: "/",
6
+
7
+ dest: "./dist",
8
+
9
+ head: [
10
+ [
11
+ "link",
12
+ {
13
+ rel: "stylesheet",
14
+ href: "//at.alicdn.com/t/font_2410206_mfj6e1vbwo.css",
15
+ },
16
+ ],
17
+ ],
18
+
19
+ locales: {
20
+ "/": {
21
+ lang: "en-US",
22
+ title: "Theme Demo",
23
+ description: "A demo for vuepress-theme-hope",
24
+ },
25
+ },
26
+
27
+ themeConfig,
28
+ });
@@ -0,0 +1,52 @@
1
+ import { defineNavbarConfig } from "vuepress-theme-hope";
2
+
3
+ export default defineNavbarConfig([
4
+ "/",
5
+ "/home",
6
+ { text: "Guide", icon: "creative", link: "/guide/" },
7
+ {
8
+ text: "Posts",
9
+ icon: "edit",
10
+ prefix: "/posts/",
11
+ children: [
12
+ {
13
+ text: "Articles 1-4",
14
+ icon: "edit",
15
+ prefix: "article/",
16
+ children: [
17
+ { text: "Article 1", icon: "edit", link: "article1" },
18
+ { text: "Article 2", icon: "edit", link: "article2" },
19
+ "article3",
20
+ "article4",
21
+ ],
22
+ },
23
+ {
24
+ text: "Articles 5-12",
25
+ icon: "edit",
26
+ children: [
27
+ {
28
+ text: "Article 5",
29
+ icon: "edit",
30
+ link: "article/article5",
31
+ },
32
+ {
33
+ text: "Article 6",
34
+ icon: "edit",
35
+ link: "article/article6",
36
+ },
37
+ "article/article7",
38
+ "article/article8",
39
+ ],
40
+ },
41
+ { text: "Article 9", icon: "edit", link: "article9" },
42
+ { text: "Article 10", icon: "edit", link: "article10" },
43
+ "article11",
44
+ "article12",
45
+ ],
46
+ },
47
+ {
48
+ text: "Theme Docs",
49
+ icon: "note",
50
+ link: "https://vuepress-theme-hope.github.io/v2/",
51
+ },
52
+ ]);
@@ -0,0 +1,47 @@
1
+ import { defineSidebarConfig } from "vuepress-theme-hope";
2
+
3
+ export default defineSidebarConfig([
4
+ "",
5
+ "home",
6
+ "slide",
7
+ {
8
+ icon: "creative",
9
+ text: "Guide",
10
+ collapsable: true,
11
+ prefix: "guide/",
12
+ link: "guide/",
13
+ children: ["page", "markdown", "disable", "encrypt"],
14
+ },
15
+ {
16
+ text: "Articles",
17
+ icon: "note",
18
+ prefix: "posts/",
19
+ children: [
20
+ {
21
+ text: "Articles 1-4",
22
+ icon: "note",
23
+ collapsable: true,
24
+ prefix: "article/",
25
+ children: ["article1", "article2", "article3", "article4"],
26
+ },
27
+ {
28
+ text: "Articles 5-12",
29
+ icon: "note",
30
+ children: [
31
+ {
32
+ text: "Articles 5-8",
33
+ icon: "note",
34
+ collapsable: true,
35
+ prefix: "article/",
36
+ children: ["article5", "article6", "article7", "article8"],
37
+ },
38
+ {
39
+ text: "Articles 9-12",
40
+ icon: "note",
41
+ children: ["article9", "article10", "article11", "article12"],
42
+ },
43
+ ],
44
+ },
45
+ ],
46
+ },
47
+ ]);