create-lupine 1.0.31 → 1.3.0

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 (269) hide show
  1. package/README.md +31 -0
  2. package/index.js +238 -112
  3. package/package.json +1 -1
  4. package/templates/common/.agents/skills/lupine-framework/SKILL.md +63 -0
  5. package/templates/common/.agents/skills/lupine-framework/references/backend-api.md +113 -0
  6. package/templates/common/.agents/skills/lupine-framework/references/icon-handling.md +71 -0
  7. package/templates/common/.agents/skills/lupine-framework/references/mobile-interactions.md +29 -0
  8. package/templates/common/.agents/skills/lupine-framework/references/native-apps.md +190 -0
  9. package/templates/common/.agents/skills/lupine-framework/references/navigation-and-routing.md +55 -0
  10. package/templates/common/.agents/skills/lupine-framework/references/reactivity-and-state.md +108 -0
  11. package/templates/common/.agents/skills/lupine-framework/references/styling-and-themes.md +121 -0
  12. package/templates/common/.env.mobile +4 -3
  13. package/templates/common/_env +10 -4
  14. package/templates/common/apps/server/README.md +10 -0
  15. package/templates/common/dev/cp-folder.js +9 -4
  16. package/templates/lupine-template-cv-starter/README.md +37 -0
  17. package/templates/lupine-template-cv-starter/app/package.json +20 -0
  18. package/templates/lupine-template-cv-starter/app/src/app.tsx +6 -0
  19. package/templates/lupine-template-cv-starter/app/src/index.native.tsx +4 -0
  20. package/templates/lupine-template-cv-starter/app/src/index.test.tsx +71 -0
  21. package/templates/lupine-template-cv-starter/app/src/index.web.tsx +28 -0
  22. package/templates/lupine-template-cv-starter/app/tsconfig.json +17 -0
  23. package/templates/lupine-template-cv-starter/lupine.json +8 -7
  24. package/templates/lupine-template-cv-starter/web/src/index.html +9 -2
  25. package/templates/lupine-template-cv-starter/web/src/index.tsx +9 -23
  26. package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.html +9 -2
  27. package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.tsx +4 -29
  28. package/templates/lupine-template-doc-starter/README.md +37 -0
  29. package/templates/lupine-template-doc-starter/app/package.json +20 -0
  30. package/templates/lupine-template-doc-starter/app/src/app.tsx +6 -0
  31. package/templates/lupine-template-doc-starter/app/src/index.native.tsx +4 -0
  32. package/templates/lupine-template-doc-starter/app/src/index.test.tsx +78 -0
  33. package/templates/lupine-template-doc-starter/app/src/index.web.tsx +28 -0
  34. package/templates/lupine-template-doc-starter/app/tsconfig.json +17 -0
  35. package/templates/lupine-template-doc-starter/lupine.json +8 -7
  36. package/templates/lupine-template-doc-starter/web/src/index.html +9 -2
  37. package/templates/lupine-template-doc-starter/web/src/index.tsx +9 -23
  38. package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.html +9 -2
  39. package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.tsx +4 -29
  40. package/templates/lupine-template-fullstack-note/README.md +83 -0
  41. package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/api/package.json +1 -1
  42. package/templates/lupine-template-fullstack-note/api/resources/install.mysql.sql +32 -0
  43. package/templates/lupine-template-fullstack-note/api/resources/install.sqlite.sql +27 -0
  44. package/templates/lupine-template-fullstack-note/api/src/service/answer.ts +39 -0
  45. package/templates/lupine-template-fullstack-note/api/src/service/api.ts +52 -0
  46. package/templates/lupine-template-fullstack-note/api/src/service/db.ts +78 -0
  47. package/templates/lupine-template-fullstack-note/api/src/service/notes-api.ts +86 -0
  48. package/templates/lupine-template-fullstack-note/api/src/service/root-api.ts +19 -0
  49. package/templates/lupine-template-fullstack-note/api/src/service/user-api.ts +182 -0
  50. package/templates/lupine-template-fullstack-note/app/package.json +19 -0
  51. package/templates/lupine-template-fullstack-note/app/src/app.tsx +75 -0
  52. package/templates/lupine-template-fullstack-note/app/src/index.native.tsx +4 -0
  53. package/templates/lupine-template-fullstack-note/app/src/index.test.tsx +373 -0
  54. package/templates/lupine-template-fullstack-note/app/src/index.web.tsx +20 -0
  55. package/templates/lupine-template-fullstack-note/app/src/pages/components.tsx +65 -0
  56. package/templates/lupine-template-fullstack-note/app/src/pages/details.tsx +38 -0
  57. package/templates/lupine-template-fullstack-note/app/src/pages/discover.tsx +25 -0
  58. package/templates/lupine-template-fullstack-note/app/src/pages/home.tsx +76 -0
  59. package/templates/lupine-template-fullstack-note/app/src/pages/inbox.tsx +49 -0
  60. package/templates/lupine-template-fullstack-note/app/src/pages/login.tsx +54 -0
  61. package/templates/lupine-template-fullstack-note/app/src/pages/me.tsx +32 -0
  62. package/templates/lupine-template-fullstack-note/app/src/pages/notes.tsx +128 -0
  63. package/templates/lupine-template-fullstack-note/app/src/pages/settings.tsx +45 -0
  64. package/templates/lupine-template-fullstack-note/app/src/shell/AppMenu.tsx +44 -0
  65. package/templates/lupine-template-fullstack-note/app/src/shell/api.ts +159 -0
  66. package/templates/lupine-template-fullstack-note/app/src/shell/data.ts +20 -0
  67. package/templates/lupine-template-fullstack-note/app/src/shell/locales/ja.ts +80 -0
  68. package/templates/lupine-template-fullstack-note/app/src/shell/locales/zh-CN.ts +80 -0
  69. package/templates/lupine-template-fullstack-note/app/src/shell/texts.ts +14 -0
  70. package/templates/lupine-template-fullstack-note/app/tsconfig.json +17 -0
  71. package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/lupine.json +4 -2
  72. package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/web/package.json +1 -1
  73. package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/web/src/index.html +10 -3
  74. package/templates/lupine-template-fullstack-note/web/src/index.tsx +15 -0
  75. package/templates/lupine-template-fullstack-starter/README.md +70 -0
  76. package/templates/lupine-template-fullstack-starter/api/package.json +10 -0
  77. package/templates/lupine-template-fullstack-starter/api/resources/install.mysql.sql +107 -0
  78. package/templates/lupine-template-fullstack-starter/api/resources/install.sqlite.sql +75 -0
  79. package/templates/lupine-template-fullstack-starter/api/src/lang/api-lang-en.ts +39 -0
  80. package/templates/lupine-template-fullstack-starter/api/src/lang/api-lang-zh-cn.ts +37 -0
  81. package/templates/lupine-template-fullstack-starter/api/src/service/admin-api.ts +139 -0
  82. package/templates/lupine-template-fullstack-starter/api/src/service/api.ts +111 -0
  83. package/templates/lupine-template-fullstack-starter/api/src/service/contact-api.ts +50 -0
  84. package/templates/lupine-template-fullstack-starter/api/src/service/file-api-base.ts +30 -0
  85. package/templates/lupine-template-fullstack-starter/api/src/service/root-api.ts +28 -0
  86. package/templates/lupine-template-fullstack-starter/api/src/service/send-email.ts +47 -0
  87. package/templates/lupine-template-fullstack-starter/api/src/service/setting-api.ts +60 -0
  88. package/templates/lupine-template-fullstack-starter/api/src/service/user-api.ts +1046 -0
  89. package/templates/lupine-template-fullstack-starter/app/assets/sample.png +0 -0
  90. package/templates/lupine-template-fullstack-starter/app/package.json +20 -0
  91. package/templates/lupine-template-fullstack-starter/app/src/app.tsx +76 -0
  92. package/templates/lupine-template-fullstack-starter/app/src/index.native.tsx +4 -0
  93. package/templates/lupine-template-fullstack-starter/app/src/index.test.tsx +276 -0
  94. package/templates/lupine-template-fullstack-starter/app/src/index.web.tsx +28 -0
  95. package/templates/lupine-template-fullstack-starter/app/src/pages/about.tsx +27 -0
  96. package/templates/lupine-template-fullstack-starter/app/src/pages/contact.tsx +41 -0
  97. package/templates/lupine-template-fullstack-starter/app/src/pages/favorite.tsx +27 -0
  98. package/templates/lupine-template-fullstack-starter/app/src/pages/home.tsx +63 -0
  99. package/templates/lupine-template-fullstack-starter/app/src/pages/login.tsx +63 -0
  100. package/templates/lupine-template-fullstack-starter/app/src/pages/mine.tsx +44 -0
  101. package/templates/lupine-template-fullstack-starter/app/src/pages/profile.tsx +58 -0
  102. package/templates/lupine-template-fullstack-starter/app/src/pages/register.tsx +48 -0
  103. package/templates/lupine-template-fullstack-starter/app/src/pages/reset-password.tsx +41 -0
  104. package/templates/lupine-template-fullstack-starter/app/src/pages/settings.tsx +33 -0
  105. package/templates/lupine-template-fullstack-starter/app/src/pages/story.tsx +46 -0
  106. package/templates/lupine-template-fullstack-starter/app/src/shell/api.ts +127 -0
  107. package/templates/lupine-template-fullstack-starter/app/src/shell/parts.tsx +100 -0
  108. package/templates/lupine-template-fullstack-starter/app/src/shell/stories.ts +65 -0
  109. package/templates/lupine-template-fullstack-starter/app/src/shell/texts.ts +79 -0
  110. package/templates/lupine-template-fullstack-starter/app/tsconfig.json +17 -0
  111. package/templates/lupine-template-fullstack-starter/lupine.json +31 -0
  112. package/templates/lupine-template-fullstack-starter/web/assets/android-chrome-192x192.png +0 -0
  113. package/templates/lupine-template-fullstack-starter/web/assets/apple-touch-icon.png +0 -0
  114. package/templates/lupine-template-fullstack-starter/web/assets/favicon-16x16.png +0 -0
  115. package/templates/lupine-template-fullstack-starter/web/assets/favicon-32x32.png +0 -0
  116. package/templates/lupine-template-fullstack-starter/web/assets/favicon.ico +0 -0
  117. package/templates/lupine-template-fullstack-starter/web/assets/icons-font/License-carbon-icons.txt +71 -0
  118. package/templates/lupine-template-fullstack-starter/web/assets/icons-font/License-material-design.txt +20 -0
  119. package/templates/lupine-template-fullstack-starter/web/assets/icons-font/i-font.woff2 +0 -0
  120. package/templates/lupine-template-fullstack-starter/web/assets/icons-font/sample.html +124 -0
  121. package/templates/lupine-template-fullstack-starter/web/assets/icons-font/style.css +103 -0
  122. package/templates/lupine-template-fullstack-starter/web/assets/lupine-flower.png +0 -0
  123. package/templates/lupine-template-fullstack-starter/web/assets/lupine.svg +71 -0
  124. package/templates/lupine-template-fullstack-starter/web/assets/site.webmanifest +14 -0
  125. package/templates/lupine-template-fullstack-starter/web/icons-font.config.js +129 -0
  126. package/templates/{lupine-template-responsive-starter/api → lupine-template-fullstack-starter/web}/package.json +1 -1
  127. package/templates/lupine-template-fullstack-starter/web/src/admin/admin-patch.tsx +34 -0
  128. package/templates/lupine-template-fullstack-starter/web/src/admin/components/home-search-component.tsx +125 -0
  129. package/templates/lupine-template-fullstack-starter/web/src/admin/components/story-card.tsx +105 -0
  130. package/templates/lupine-template-fullstack-starter/web/src/admin/components/story-list.tsx +105 -0
  131. package/templates/lupine-template-fullstack-starter/web/src/admin/components/story-props.ts +34 -0
  132. package/templates/lupine-template-fullstack-starter/web/src/admin/index.html +23 -0
  133. package/templates/lupine-template-fullstack-starter/web/src/admin/index.tsx +49 -0
  134. package/templates/lupine-template-fullstack-starter/web/src/admin/pages/admin-cfg.tsx +144 -0
  135. package/templates/lupine-template-fullstack-starter/web/src/admin/pages/admin-item-edit.tsx +20 -0
  136. package/templates/lupine-template-fullstack-starter/web/src/admin/pages/admin-item-list.tsx +23 -0
  137. package/templates/lupine-template-fullstack-starter/web/src/admin/pages/admin-user.tsx +145 -0
  138. package/templates/lupine-template-fullstack-starter/web/src/index.html +28 -0
  139. package/templates/lupine-template-fullstack-starter/web/src/index.tsx +16 -0
  140. package/templates/lupine-template-fullstack-starter/web/src/services/fetch-data.ts +37 -0
  141. package/templates/lupine-template-fullstack-starter/web/src/styles/base-css.ts +14 -0
  142. package/templates/{lupine-template-hello-world → lupine-template-fullstack-starter}/web/src/styles/global.css +10 -57
  143. package/templates/{lupine-template-hello-world → lupine-template-fullstack-starter}/web/src/styles/theme.ts +2 -1
  144. package/templates/lupine-template-responsive-starter/README.md +51 -0
  145. package/templates/lupine-template-responsive-starter/app/package.json +19 -0
  146. package/templates/lupine-template-responsive-starter/app/src/app.tsx +80 -0
  147. package/templates/lupine-template-responsive-starter/app/src/index.native.tsx +4 -0
  148. package/templates/lupine-template-responsive-starter/app/src/index.test.tsx +283 -0
  149. package/templates/lupine-template-responsive-starter/app/src/index.web.tsx +31 -0
  150. package/templates/lupine-template-responsive-starter/app/src/pages/about.tsx +23 -0
  151. package/templates/lupine-template-responsive-starter/app/src/pages/finance.tsx +48 -0
  152. package/templates/lupine-template-responsive-starter/app/src/pages/mine.tsx +60 -0
  153. package/templates/lupine-template-responsive-starter/app/src/pages/not-found.tsx +9 -0
  154. package/templates/lupine-template-responsive-starter/app/src/pages/note-detail.tsx +43 -0
  155. package/templates/lupine-template-responsive-starter/app/src/pages/note-edit.tsx +45 -0
  156. package/templates/lupine-template-responsive-starter/app/src/pages/note-search.tsx +62 -0
  157. package/templates/lupine-template-responsive-starter/app/src/pages/notes.tsx +71 -0
  158. package/templates/lupine-template-responsive-starter/app/src/pages/settings.tsx +55 -0
  159. package/templates/lupine-template-responsive-starter/app/src/pages/tools.tsx +112 -0
  160. package/templates/lupine-template-responsive-starter/app/src/shell/icons.ts +7 -0
  161. package/templates/lupine-template-responsive-starter/app/src/shell/layout.ts +18 -0
  162. package/templates/lupine-template-responsive-starter/app/src/shell/locales/zh-CN.ts +89 -0
  163. package/templates/lupine-template-responsive-starter/app/src/shell/menu.tsx +81 -0
  164. package/templates/lupine-template-responsive-starter/app/src/shell/nav.ts +12 -0
  165. package/templates/lupine-template-responsive-starter/app/src/shell/store.ts +72 -0
  166. package/templates/lupine-template-responsive-starter/app/src/shell/texts.ts +11 -0
  167. package/templates/lupine-template-responsive-starter/app/tsconfig.json +17 -0
  168. package/templates/lupine-template-responsive-starter/lupine.json +7 -6
  169. package/templates/lupine-template-responsive-starter/web/src/index.html +9 -2
  170. package/templates/lupine-template-responsive-starter/web/src/index.tsx +9 -34
  171. package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.html +12 -6
  172. package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.tsx +12 -31
  173. package/templates/common/AI_CONTEXT.md +0 -1002
  174. package/templates/common/apps/server/src/app-loader.ts +0 -4
  175. package/templates/lupine-template-cv-starter/api/package.json +0 -6
  176. package/templates/lupine-template-cv-starter/api/resources/install.sqlite.sql +0 -4
  177. package/templates/lupine-template-cv-starter/api/src/index.ts +0 -15
  178. package/templates/lupine-template-cv-starter/web/src/styles/base-css.ts +0 -15
  179. package/templates/lupine-template-doc-starter/api/package.json +0 -6
  180. package/templates/lupine-template-doc-starter/api/resources/config_default.json +0 -6
  181. package/templates/lupine-template-doc-starter/api/resources/install.sqlite.sql +0 -4
  182. package/templates/lupine-template-doc-starter/api/src/index.ts +0 -15
  183. package/templates/lupine-template-doc-starter/api/src/resources/config_default.json +0 -6
  184. package/templates/lupine-template-doc-starter/api/src/resources/install.sqlite.sql +0 -4
  185. package/templates/lupine-template-doc-starter/web/src/client-env-keys.ts +0 -5
  186. package/templates/lupine-template-doc-starter/web/src/styles/base-css.ts +0 -15
  187. package/templates/lupine-template-hello-world/api/resources/config_default.json +0 -6
  188. package/templates/lupine-template-hello-world/api/resources/install.sqlite.sql +0 -4
  189. package/templates/lupine-template-hello-world/api/src/service/root-api.ts +0 -18
  190. package/templates/lupine-template-hello-world/web/src/index.tsx +0 -73
  191. package/templates/lupine-template-hello-world/web/src/styles/app.css +0 -0
  192. package/templates/lupine-template-hello-world/web/src/styles/base-css.ts +0 -1
  193. package/templates/lupine-template-responsive-starter/api/resources/config_default.json +0 -6
  194. package/templates/lupine-template-responsive-starter/api/resources/install.sqlite.sql +0 -4
  195. package/templates/lupine-template-responsive-starter/api/src/service/root-api.ts +0 -18
  196. package/templates/lupine-template-responsive-starter/web/src/app-icons.ts +0 -76
  197. package/templates/lupine-template-responsive-starter/web/src/components/input-history-component.tsx +0 -93
  198. package/templates/lupine-template-responsive-starter/web/src/components/mine-about-page.tsx +0 -86
  199. package/templates/lupine-template-responsive-starter/web/src/components/mine-premium-page.tsx +0 -80
  200. package/templates/lupine-template-responsive-starter/web/src/components/mine-settings-page.tsx +0 -220
  201. package/templates/lupine-template-responsive-starter/web/src/components/mobile-top-search-menu.tsx +0 -119
  202. package/templates/lupine-template-responsive-starter/web/src/components/note-detail.tsx +0 -116
  203. package/templates/lupine-template-responsive-starter/web/src/components/note-edit.tsx +0 -154
  204. package/templates/lupine-template-responsive-starter/web/src/components/note-search-page.tsx +0 -193
  205. package/templates/lupine-template-responsive-starter/web/src/components/search-input.tsx +0 -95
  206. package/templates/lupine-template-responsive-starter/web/src/components/side-menu-content.tsx +0 -182
  207. package/templates/lupine-template-responsive-starter/web/src/frames/app-responsive-frame.tsx +0 -52
  208. package/templates/lupine-template-responsive-starter/web/src/pages/about-page.tsx +0 -43
  209. package/templates/lupine-template-responsive-starter/web/src/pages/finance-page.tsx +0 -46
  210. package/templates/lupine-template-responsive-starter/web/src/pages/home-page.tsx +0 -452
  211. package/templates/lupine-template-responsive-starter/web/src/pages/mine-page.tsx +0 -325
  212. package/templates/lupine-template-responsive-starter/web/src/pages/tools-page.tsx +0 -46
  213. package/templates/lupine-template-responsive-starter/web/src/services/local-notes-service.ts +0 -87
  214. package/templates/lupine-template-responsive-starter/web/src/services/mine-service.ts +0 -45
  215. package/templates/lupine-template-responsive-starter/web/src/styles/app.css +0 -0
  216. package/templates/lupine-template-responsive-starter/web/src/styles/base-css.ts +0 -65
  217. package/templates/lupine-template-responsive-starter/web/src/styles/global.css +0 -2130
  218. package/templates/lupine-template-responsive-starter/web/src/styles/theme.ts +0 -16
  219. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/01-experience/index.md +0 -0
  220. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/02-projects/index.md +0 -0
  221. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/03-skills/index.md +0 -0
  222. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/04-education/index.md +0 -0
  223. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/index.md +0 -0
  224. /package/templates/lupine-template-cv-starter/{web → app}/markdown/index.md +0 -0
  225. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/01-experience/index.md +0 -0
  226. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/02-projects/index.md +0 -0
  227. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/03-skills/index.md +0 -0
  228. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/04-education/index.md +0 -0
  229. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/index.md +0 -0
  230. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/01-experience/index.html +0 -0
  231. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/02-projects/index.html +0 -0
  232. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/03-skills/index.html +0 -0
  233. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/04-education/index.html +0 -0
  234. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/index.html +0 -0
  235. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/index.html +0 -0
  236. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/markdown-config.ts +0 -0
  237. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/01-experience/index.html +0 -0
  238. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/02-projects/index.html +0 -0
  239. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/03-skills/index.html +0 -0
  240. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/04-education/index.html +0 -0
  241. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/index.html +0 -0
  242. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/essentials/index.md +0 -0
  243. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/essentials/list.md +0 -0
  244. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/guide/install.md +0 -0
  245. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/guide/started.md +0 -0
  246. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/index.md +0 -0
  247. /package/templates/lupine-template-doc-starter/{web → app}/markdown/index.md +0 -0
  248. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/essentials/index.md +0 -0
  249. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/essentials/list.md +0 -0
  250. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/guide/install.md +0 -0
  251. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/guide/started.md +0 -0
  252. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/index.md +0 -0
  253. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/essentials/index.html +0 -0
  254. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/essentials/list.html +0 -0
  255. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/guide/install.html +0 -0
  256. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/guide/started.html +0 -0
  257. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/index.html +0 -0
  258. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/index.html +0 -0
  259. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/markdown-config.ts +0 -0
  260. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/essentials/index.html +0 -0
  261. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/essentials/list.html +0 -0
  262. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/guide/install.html +0 -0
  263. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/guide/started.html +0 -0
  264. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/index.html +0 -0
  265. /package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/api/src/index.ts +0 -0
  266. /package/templates/{lupine-template-hello-world → lupine-template-fullstack-note}/web/assets/favicon.ico +0 -0
  267. /package/templates/{lupine-template-cv-starter → lupine-template-fullstack-starter}/api/resources/config_default.json +0 -0
  268. /package/templates/{lupine-template-responsive-starter → lupine-template-fullstack-starter}/api/src/index.ts +0 -0
  269. /package/templates/{lupine-template-cv-starter/web/src → lupine-template-fullstack-starter/web/src/models}/client-env-keys.ts +0 -0
@@ -1,13 +1,17 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
3
 
4
- function copyRecursiveSync(src, dest) {
4
+ // never copied: files of the Finder and installed packages
5
+ const skipped = new Set(['.DS_Store', 'node_modules']);
6
+
7
+ function copyRecursiveSync(src, dest, skip = []) {
8
+ if (skipped.has(path.basename(src)) || skip.includes(path.basename(src))) return;
5
9
  const stats = fs.statSync(src);
6
10
  const isDirectory = stats.isDirectory();
7
11
  if (isDirectory) {
8
12
  fs.mkdirSync(dest, { recursive: true });
9
13
  fs.readdirSync(src).forEach((childItemName) => {
10
- copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName));
14
+ copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName), skip);
11
15
  });
12
16
  } else {
13
17
  // Ensure parent directory exists for file copy (just in case)
@@ -17,7 +21,8 @@ function copyRecursiveSync(src, dest) {
17
21
  }
18
22
  }
19
23
 
20
- function copyFolder(src, dest) {
24
+ // skip: names of files and folders that aren't copied either
25
+ function copyFolder(src, dest, skip = []) {
21
26
  if (!src || !dest) {
22
27
  console.error('Usage: node dev/cp-folder.js <source> <destination>');
23
28
  if (require.main === module) process.exit(1);
@@ -29,7 +34,7 @@ function copyFolder(src, dest) {
29
34
 
30
35
  if (fs.existsSync(srcPath)) {
31
36
  console.log(`Copying from ${src} to ${dest}...`);
32
- copyRecursiveSync(srcPath, destPath);
37
+ copyRecursiveSync(srcPath, destPath, skip);
33
38
  console.log('Copy complete.');
34
39
  } else {
35
40
  console.log(`Source directory ${src} does not exist. Skipping copy.`);
@@ -0,0 +1,37 @@
1
+ # CV Starter
2
+
3
+ A CV written in Markdown, one code base for the web, iOS, Android, macOS and Windows: several languages (`app/markdown/en`, `app/markdown/zh`), light and dark themes, its parts in a sidebar. The server renders each page, and the same app can be published to GitHub Pages. A template of `npx create-lupine` (`cv-starter`).
4
+
5
+ [Live demo](https://uuware.github.io/lupine-template-cv-starter/) · [Repository](https://github.com/uuware/lupine-template-cv-starter)
6
+
7
+ <!-- screenshots macos=1 windows=2 web=/ ios=1,3 android=2,4 -->
8
+ <table>
9
+ <tr><th>macOS</th><th>Windows</th><th>Web</th></tr>
10
+ <tr><td><a href="docs/macos-1-cv.png"><img src="docs/macos-1-cv.png" width="253" alt="macOS"></a></td><td><a href="docs/windows-2-experience.png"><img src="docs/windows-2-experience.png" width="253" alt="Windows"></a></td><td><a href="docs/web-1.png"><img src="docs/web-1.png" width="253" alt="Web"></a></td></tr>
11
+ </table>
12
+ <table>
13
+ <tr><th colspan="2">iOS</th><th colspan="2">Android</th></tr>
14
+ <tr><td><a href="docs/ios-1-cv.png"><img src="docs/ios-1-cv.png" width="183" alt="iOS"></a></td><td><a href="docs/ios-3-chinese.png"><img src="docs/ios-3-chinese.png" width="183" alt="iOS"></a></td><td><a href="docs/android-2-experience.png"><img src="docs/android-2-experience.png" width="183" alt="Android"></a></td><td><a href="docs/android-4-dark.png"><img src="docs/android-4-dark.png" width="183" alt="Android"></a></td></tr>
15
+ </table>
16
+ <!-- /screenshots -->
17
+
18
+ | Folder | |
19
+ | --- | --- |
20
+ | `app/markdown` | the CV. `index.md` lists the languages; `<lang>/index.md` is the first page and has the title and the `sidebar` of the other parts (`01-experience` ...) |
21
+ | `app/src` | the app: `PressApp` of `lupine.press/native` with the pages that the build makes of the markdown (`app/src/markdown-built`, don't edit) |
22
+ | `web/` | the page of the site, with the app in it; `web/src/lupine-template-cv-starter` is the page for GitHub Pages |
23
+ | `lupine.json` | what `npm run dev` builds; `"nativeApp": "app"` for the apps |
24
+ | no `api/` | the server is the default one of lupine-build: the web files and the pages rendered on the server. For routes of your own add `api/src/index.ts` and `"apiEntryPoint"` in `lupine.json` (as in the fullstack templates) |
25
+
26
+ In a project of create-lupine (and in the repository of this template) the same is in the scripts: `npm run run-mac`, `run-ios`, `run-android`, `run-exe`; `build-android` (the apk for the store), `bump` (the next version), `icons` (the icons of the site from the icon of the app), `release` (a folder for the server).
27
+
28
+ ```bash
29
+ npm run dev # the site, see the address it prints
30
+ npm run native -- macos --app=lupine-template-cv-starter --run
31
+ npm run native -- ios --app=lupine-template-cv-starter --run
32
+ npm run native -- android --app=lupine-template-cv-starter --run
33
+ npm run native -- windows --app=lupine-template-cv-starter --run
34
+ npm run native -- test macos --app=lupine-template-cv-starter # its tests (app/src/index.test.tsx)
35
+ ```
36
+
37
+ GitHub Pages: `npm run build`, then `npm run cp-docs` copies the page to `docs/`; in the settings of the repository, Pages from the `docs` folder. The folder of the page in `web/src` and the paths in its `index.tsx`, `index.html`, `404.html` and in `lupine.json` are the name of the repository: rename them to yours.
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "lupine-template-cv-starter-app",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "description": "A CV written in Markdown, as an app: iOS, Android, macOS, Windows and the web.",
6
+ "lupineNative": {
7
+ "name": "LupineCV",
8
+ "id": "com.uuware.lupine.cv",
9
+ "entry": {
10
+ "native": "src/index.native.tsx",
11
+ "test": "src/index.test.tsx",
12
+ "web": "src/index.web.tsx"
13
+ }
14
+ },
15
+ "dependencies": {
16
+ "lupine.native.components": "^1.1.0",
17
+ "lupine.native.core": "^1.1.0",
18
+ "lupine.press": "^1.3.0"
19
+ }
20
+ }
@@ -0,0 +1,6 @@
1
+ import { PressApp } from 'lupine.press/native';
2
+ // made by lupine-build (and lupine-native) from the files of app/markdown: "markdownEntryPoints" of lupine.json
3
+ import { markdownConfig } from './markdown-built/markdown-config';
4
+
5
+ /** The CV: its pages in the sidebar, languages, light and dark themes. */
6
+ export const App = () => <PressApp data={markdownConfig} />;
@@ -0,0 +1,4 @@
1
+ import { runApp } from 'lupine.native.core/native';
2
+ import { App } from './app';
3
+
4
+ runApp(App);
@@ -0,0 +1,71 @@
1
+ /// <reference path="../../../../node_modules/lupine.native.core/src/native-globals.d.ts" />
2
+ // Walks through the app inside a native shell built with --test: presses the real views.
3
+ // npm run native -- test macos --app=lupine-template-cv-starter
4
+ import { Platform, windowInfo } from 'lupine.native.core';
5
+ import { isWide, router, setLang, setThemePref, theme } from 'lupine.native.components';
6
+ import { runApp } from 'lupine.native.core/native';
7
+ import { App } from './app';
8
+
9
+ const native = globalThis.__lupine;
10
+ const act = (id: string, action: string, arg?: unknown) => native.test!(id, action, arg);
11
+ const text = (id: string) => act(id, 'text');
12
+ const sleep = (ms: number) => new Promise<void>((done) => setTimeout(done, ms));
13
+ const exists = (id: string) => act(id, 'x') !== '<missing>';
14
+
15
+ let passed = 0;
16
+ let failed = 0;
17
+ const check = (name: string, actual: unknown, expected: unknown) => {
18
+ const ok = actual === expected;
19
+ if (ok) passed++;
20
+ else failed++;
21
+ console.log(`TEST ${ok ? 'ok ' : 'FAIL'} ${name}${ok ? '' : ` -> ${JSON.stringify(actual)}, expected ${JSON.stringify(expected)}`}`);
22
+ };
23
+ const shot = async (name: string) => {
24
+ await sleep(250);
25
+ if (Platform.OS === 'macos' || Platform.OS === 'windows') act('', 'screenshot', `shot-${name}.png`);
26
+ console.log(`SHOT ${name}`);
27
+ await sleep(Platform.OS === 'macos' || Platform.OS === 'windows' ? 50 : 2500);
28
+ };
29
+ const press = async (id: string, wait = 600) => {
30
+ check(`press ${id}`, exists(id) && act(id, 'click'), true);
31
+ await sleep(wait);
32
+ };
33
+ /** a page of the sidebar: beside the text on wide windows, in the drawer of the menu button on phones */
34
+ const side = async (link: string) => {
35
+ if (!isWide()) await press('press-menu', 500);
36
+ await press(`press-side-${link}`, 800);
37
+ };
38
+
39
+ setThemePref('light');
40
+ setLang('en');
41
+ runApp(App);
42
+ console.log(`TEST window ${JSON.stringify(windowInfo())}`);
43
+
44
+ const main = async () => {
45
+ for (let i = 0; i < 100 && !(act('press-content', 'width') > 0); i++) await sleep(100);
46
+ await sleep(500);
47
+ check('the title of the site', text('press-title'), 'CV');
48
+ check('the CV', exists('press-text'), true);
49
+ await shot('1-cv');
50
+
51
+ await side('/en/01-experience/index');
52
+ check('Experience', router.path(), '/en/01-experience/index');
53
+ await shot('2-experience');
54
+
55
+ await press('press-lang');
56
+ await press('option-zh', 900);
57
+ check('the same page in Chinese', router.path(), '/zh/01-experience/index');
58
+ check('the title in Chinese', text('press-title'), '工作简历');
59
+ await shot('3-chinese');
60
+
61
+ await press('press-theme');
62
+ check('dark', theme().mode, 'dark');
63
+ await shot('4-dark');
64
+ await press('press-theme');
65
+
66
+ await press('press-title', 800);
67
+ check('the CV again', router.path(), '/');
68
+
69
+ console.log(`TEST RESULT ${failed ? 'FAILED' : 'PASSED'} ${passed} ok, ${failed} failed`);
70
+ };
71
+ main().catch((e) => console.log(`TEST RESULT FAILED ${e && e.stack}`));
@@ -0,0 +1,28 @@
1
+ import { onCleanup, serverRequest, View } from 'lupine.native.core';
2
+ import { router } from 'lupine.native.components';
3
+ import { runApp } from 'lupine.native.core/web';
4
+ import { App } from './app';
5
+
6
+ /** The app follows the address: the address bar shows its page (/en/01-experience/index), the buttons of the browser go back and forward. */
7
+ export const followAddress = (base?: string) => router.followUrl(base ? { paths: true, base } : undefined);
8
+
9
+ /** The app as a page of the site (web/src/index.tsx: pageRouter.use('*', AppPage, { keep: true })); in the browser it follows the address. */
10
+ export const AppPage = () => {
11
+ if (!serverRequest()) onCleanup(followAddress());
12
+ return (
13
+ <View style={{ height: '100%' }}>
14
+ <App />
15
+ </View>
16
+ );
17
+ };
18
+
19
+ // A page without the site: lupine-native web starts it in document.body; the page for GitHub Pages
20
+ // (web/src/lupine-template-cv-starter) in its folder.
21
+ export const start = (container: HTMLElement, base?: string) => {
22
+ const stop = followAddress(base);
23
+ const dispose = runApp(App, container);
24
+ return () => {
25
+ dispose();
26
+ stop();
27
+ };
28
+ };
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2020",
4
+ "lib": ["es2020"],
5
+ "types": [],
6
+ "jsx": "react-jsx",
7
+ "jsxImportSource": "lupine.native.core",
8
+ "module": "esnext",
9
+ "moduleResolution": "bundler",
10
+ "strict": true,
11
+ "noEmit": true,
12
+ "skipLibCheck": true
13
+ },
14
+ // the web entries are the only files that may use the DOM, so they aren't checked with these settings
15
+ "include": ["src"],
16
+ "exclude": ["src/**/*.web.tsx"]
17
+ }
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "lupine-template-cv-starter",
3
+ "nativeOut": "dist/native",
4
+ "nativeApp": "app",
3
5
  "markdownEntryPoints": {
4
- "indir": "web/markdown",
5
- "outdir": "web/src/markdown-built"
6
+ "indir": "app/markdown",
7
+ "outdir": "app/src/markdown-built"
6
8
  },
7
9
  "webEntryPoints": [
8
10
  {
@@ -16,9 +18,8 @@
16
18
  "outdir": "/lupine-template-cv-starter"
17
19
  }
18
20
  ],
19
- "apiEntryPoint": "api/src/index.ts",
20
21
  "watchFiles": [
21
- "web/markdown/**/*.md"
22
+ "app/markdown/**/*.md"
22
23
  ],
23
24
  "copyFiles": [
24
25
  {
@@ -33,8 +34,8 @@
33
34
  },
34
35
  {
35
36
  "env": "all",
36
- "from": "api/resources",
37
- "to": "data/resources"
37
+ "from": "web/src/lupine-template-cv-starter/assets",
38
+ "to": "web/lupine-template-cv-starter/assets"
38
39
  }
39
40
  ]
40
- }
41
+ }
@@ -3,11 +3,18 @@
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <title><!--META-TITLE--></title>
6
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
7
7
  <!--META-ENV-START-->
8
8
  <!--META-ENV-END-->
9
9
  <link rel="shortcut icon" href="{SUBDIR}/assets/favicon.ico?t={hash}" type="image/x-icon" />
10
- <link rel="stylesheet" type="text/css" href="{SUBDIR}/index.css?t={hash}" />
10
+ <style>
11
+ html,
12
+ body,
13
+ .lupine-root {
14
+ height: 100%;
15
+ margin: 0;
16
+ }
17
+ </style>
11
18
  <script defer src="{SUBDIR}/index.js?t={hash}"></script>
12
19
  </head>
13
20
  <body>
@@ -1,28 +1,14 @@
1
- import {
2
- bindRouter,
3
- PageRouter,
4
- bindTheme,
5
- setDefaultPageTitle,
6
- isFrontEnd,
7
- debugWatch,
8
- webEnv,
9
- bindAppGlobalStyle,
10
- } from 'lupine.components';
11
- import { bindPressData, PressPage, pressThemes } from 'lupine.press';
12
- import { markdownConfig } from './markdown-built/markdown-config';
13
- import { ClientEnvKeys } from './client-env-keys';
14
- import { baseCss } from './styles/base-css';
1
+ import { bindRouter, PageRouter, setDefaultPageTitle } from 'lupine.web';
2
+ import { AppPage } from '../../app/src/index.web';
3
+ // the primitives of the app in the page that the server renders
4
+ import 'lupine.native.core/web/server';
15
5
 
16
- if (isFrontEnd() && webEnv(ClientEnvKeys.NODE_ENV, '') === 'development') {
17
- debugWatch(webEnv(ClientEnvKeys.API_PORT, 0));
18
- }
19
- bindTheme('light', pressThemes);
20
- bindAppGlobalStyle('comm-css', baseCss, false, true);
21
- setDefaultPageTitle('Lupine.js Doc');
6
+ // The page of the site is the app (app/), in the same bundle: the server renders the page of the address (search
7
+ // engines see the text). keep: the app is made once and stays; when the address changes (its own pages, the back
8
+ // button) it follows the address itself. Pages of the site itself go into pageRouter before it.
22
9
 
23
- bindPressData(markdownConfig);
10
+ setDefaultPageTitle('CV Starter');
24
11
 
25
12
  const pageRouter = new PageRouter();
26
- pageRouter.use('*', PressPage);
27
-
13
+ pageRouter.use('*', AppPage, { keep: true });
28
14
  bindRouter(pageRouter);
@@ -49,7 +49,7 @@
49
49
  href="{SUBDIR}/assets/favicon.ico"
50
50
  type="image/x-icon"
51
51
  />
52
- <meta name="viewport" content="width=device-width, initial-scale=1" />
52
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
53
53
  <!--META-ENV-START-->
54
54
  <!--META-ENV-END-->
55
55
  <link
@@ -57,7 +57,14 @@
57
57
  href="{SUBDIR}/assets/favicon.ico?t={hash}"
58
58
  type="image/x-icon"
59
59
  />
60
- <link rel="stylesheet" type="text/css" href="{SUBDIR}/index.css?t={hash}" />
60
+ <style>
61
+ html,
62
+ body,
63
+ .lupine-root {
64
+ height: 100%;
65
+ margin: 0;
66
+ }
67
+ </style>
61
68
  <script defer src="{SUBDIR}/index.js?t={hash}"></script>
62
69
  <!-- Remove Cloudflare Web Analytics if you clone this project -->
63
70
  <script
@@ -1,30 +1,5 @@
1
- import {
2
- bindRouter,
3
- PageRouter,
4
- bindTheme,
5
- setDefaultPageTitle,
6
- isFrontEnd,
7
- debugWatch,
8
- webEnv,
9
- bindAppGlobalStyle,
10
- } from 'lupine.components';
11
- import { bindPressData, PressPage, pressThemes, setPressSubDir } from 'lupine.press';
12
- import { ClientEnvKeys } from '../client-env-keys';
13
- import { baseCss } from '../styles/base-css';
14
- import { markdownConfig } from '../markdown-built/markdown-config';
1
+ import { start } from '../../../app/src/index.web';
15
2
 
16
- if (isFrontEnd() && webEnv(ClientEnvKeys.NODE_ENV, '') === 'development') {
17
- debugWatch(webEnv(ClientEnvKeys.API_PORT, 0));
18
- }
19
- bindTheme('light', pressThemes);
20
- bindAppGlobalStyle('comm-css', baseCss, false, true);
21
- setDefaultPageTitle('Doc Starter');
22
-
23
- bindPressData(markdownConfig);
24
- setPressSubDir('/lupine-template-cv-starter');
25
-
26
- const pageRouter = new PageRouter();
27
- pageRouter.setSubDir('/lupine-template-cv-starter');
28
- pageRouter.use('*', PressPage);
29
-
30
- bindRouter(pageRouter);
3
+ // The page for GitHub Pages (https://<user>.github.io/lupine-template-cv-starter/): the app without the server, in the
4
+ // folder of the project. Its 404.html sends other addresses of the folder to this page. npm run build, then npm run cp-docs.
5
+ start(document.querySelector<HTMLElement>('.lupine-root') || document.body, '/lupine-template-cv-starter');
@@ -0,0 +1,37 @@
1
+ # Doc Starter
2
+
3
+ A documentation site from Markdown files, one code base for the web, iOS, Android, macOS and Windows: a sidebar from the folders, several languages (`app/markdown/en`, `app/markdown/zh`), light and dark themes. The server renders each page (search engines see the text), and the same app can be published to GitHub Pages. A template of `npx create-lupine` (`doc-starter`).
4
+
5
+ [Live demo](https://uuware.github.io/lupine-template-doc-starter/) · [Repository](https://github.com/uuware/lupine-template-doc-starter)
6
+
7
+ <!-- screenshots macos=1 windows=2 web=/ ios=2,3 android=4,5 -->
8
+ <table>
9
+ <tr><th>macOS</th><th>Windows</th><th>Web</th></tr>
10
+ <tr><td><a href="docs/macos-1-home.png"><img src="docs/macos-1-home.png" width="253" alt="macOS"></a></td><td><a href="docs/windows-2-page.png"><img src="docs/windows-2-page.png" width="253" alt="Windows"></a></td><td><a href="docs/web-1.png"><img src="docs/web-1.png" width="253" alt="Web"></a></td></tr>
11
+ </table>
12
+ <table>
13
+ <tr><th colspan="2">iOS</th><th colspan="2">Android</th></tr>
14
+ <tr><td><a href="docs/ios-2-page.png"><img src="docs/ios-2-page.png" width="183" alt="iOS"></a></td><td><a href="docs/ios-3-sidebar.png"><img src="docs/ios-3-sidebar.png" width="183" alt="iOS"></a></td><td><a href="docs/android-4-chinese.png"><img src="docs/android-4-chinese.png" width="183" alt="Android"></a></td><td><a href="docs/android-5-dark.png"><img src="docs/android-5-dark.png" width="183" alt="Android"></a></td></tr>
15
+ </table>
16
+ <!-- /screenshots -->
17
+
18
+ | Folder | |
19
+ | --- | --- |
20
+ | `app/markdown` | the pages. `index.md` lists the languages; `<lang>/index.md` has the title, `nav`, `sidebar`, `github-link` and the home page (`layout: home`, `hero`, `features`) |
21
+ | `app/src` | the app: `PressApp` of `lupine.press/native` with the pages that the build makes of the markdown (`app/src/markdown-built`, don't edit) |
22
+ | `web/` | the page of the site, with the app in it; `web/src/lupine-template-doc-starter` is the page for GitHub Pages |
23
+ | `lupine.json` | what `npm run dev` builds; `"nativeApp": "app"` for the apps |
24
+ | no `api/` | the server is the default one of lupine-build: the web files and the pages rendered on the server. For routes of your own add `api/src/index.ts` and `"apiEntryPoint"` in `lupine.json` (as in the fullstack templates) |
25
+
26
+ In a project of create-lupine (and in the repository of this template) the same is in the scripts: `npm run run-mac`, `run-ios`, `run-android`, `run-exe`; `build-android` (the apk for the store), `bump` (the next version), `icons` (the icons of the site from the icon of the app), `release` (a folder for the server).
27
+
28
+ ```bash
29
+ npm run dev # the site, see the address it prints
30
+ npm run native -- macos --app=lupine-template-doc-starter --run
31
+ npm run native -- ios --app=lupine-template-doc-starter --run
32
+ npm run native -- android --app=lupine-template-doc-starter --run
33
+ npm run native -- windows --app=lupine-template-doc-starter --run
34
+ npm run native -- test macos --app=lupine-template-doc-starter # its tests (app/src/index.test.tsx)
35
+ ```
36
+
37
+ GitHub Pages: `npm run build`, then `npm run cp-docs` copies the page to `docs/`; in the settings of the repository, Pages from the `docs` folder. The folder of the page in `web/src` and the paths in its `index.tsx`, `index.html`, `404.html` and in `lupine.json` are the name of the repository: rename them to yours.
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "lupine-template-doc-starter-app",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "description": "A documentation site from Markdown files as an app: iOS, Android, macOS, Windows and the web.",
6
+ "lupineNative": {
7
+ "name": "LupineDocs",
8
+ "id": "com.uuware.lupine.docs",
9
+ "entry": {
10
+ "native": "src/index.native.tsx",
11
+ "test": "src/index.test.tsx",
12
+ "web": "src/index.web.tsx"
13
+ }
14
+ },
15
+ "dependencies": {
16
+ "lupine.native.components": "^1.1.0",
17
+ "lupine.native.core": "^1.1.0",
18
+ "lupine.press": "^1.3.0"
19
+ }
20
+ }
@@ -0,0 +1,6 @@
1
+ import { PressApp } from 'lupine.press/native';
2
+ // made by lupine-build (and lupine-native) from the files of app/markdown: "markdownEntryPoints" of lupine.json
3
+ import { markdownConfig } from './markdown-built/markdown-config';
4
+
5
+ /** The site: a home page, pages with a sidebar, languages, light and dark themes. */
6
+ export const App = () => <PressApp data={markdownConfig} />;
@@ -0,0 +1,4 @@
1
+ import { runApp } from 'lupine.native.core/native';
2
+ import { App } from './app';
3
+
4
+ runApp(App);
@@ -0,0 +1,78 @@
1
+ /// <reference path="../../../../node_modules/lupine.native.core/src/native-globals.d.ts" />
2
+ // Walks through the app inside a native shell built with --test: presses the real views.
3
+ // npm run native -- test macos --app=lupine-template-doc-starter
4
+ import { Platform, windowInfo } from 'lupine.native.core';
5
+ import { isWide, router, setLang, setThemePref, theme } from 'lupine.native.components';
6
+ import { runApp } from 'lupine.native.core/native';
7
+ import { App } from './app';
8
+
9
+ const native = globalThis.__lupine;
10
+ const act = (id: string, action: string, arg?: unknown) => native.test!(id, action, arg);
11
+ const text = (id: string) => act(id, 'text');
12
+ const sleep = (ms: number) => new Promise<void>((done) => setTimeout(done, ms));
13
+ const exists = (id: string) => act(id, 'x') !== '<missing>';
14
+
15
+ let passed = 0;
16
+ let failed = 0;
17
+ const check = (name: string, actual: unknown, expected: unknown) => {
18
+ const ok = actual === expected;
19
+ if (ok) passed++;
20
+ else failed++;
21
+ console.log(`TEST ${ok ? 'ok ' : 'FAIL'} ${name}${ok ? '' : ` -> ${JSON.stringify(actual)}, expected ${JSON.stringify(expected)}`}`);
22
+ };
23
+ const shot = async (name: string) => {
24
+ await sleep(250);
25
+ if (Platform.OS === 'macos' || Platform.OS === 'windows') act('', 'screenshot', `shot-${name}.png`);
26
+ console.log(`SHOT ${name}`);
27
+ await sleep(Platform.OS === 'macos' || Platform.OS === 'windows' ? 50 : 2500);
28
+ };
29
+ const press = async (id: string, wait = 600) => {
30
+ check(`press ${id}`, exists(id) && act(id, 'click'), true);
31
+ await sleep(wait);
32
+ };
33
+ /** a page of the sidebar: beside the text on wide windows, in the drawer of the menu button on phones */
34
+ const side = async (link: string) => {
35
+ if (!isWide()) await press('press-menu', 500);
36
+ await press(`press-side-${link}`, 800);
37
+ };
38
+
39
+ setThemePref('light');
40
+ setLang('en');
41
+ runApp(App);
42
+ console.log(`TEST window ${JSON.stringify(windowInfo())}`);
43
+
44
+ const main = async () => {
45
+ for (let i = 0; i < 100 && !(act('press-content', 'width') > 0); i++) await sleep(100);
46
+ await sleep(500);
47
+ check('the title of the site', text('press-title'), 'Doc Starter');
48
+ check('the home page', text('press-hero-name'), 'Doc Starter');
49
+ await shot('1-home');
50
+
51
+ await press('press-action-0', 900);
52
+ check('Get Started', router.path(), '/en/guide/started');
53
+ await shot('2-page');
54
+
55
+ await side('/en/guide/install');
56
+ check('a page of the sidebar', router.path(), '/en/guide/install');
57
+ await shot('3-sidebar');
58
+
59
+ await press('press-lang');
60
+ await press('option-zh', 900);
61
+ check('the same page in Chinese', router.path(), '/zh/guide/install');
62
+ check('the title in Chinese', text('press-title'), '文档演示');
63
+ await shot('4-chinese');
64
+
65
+ await press('press-theme');
66
+ check('dark', theme().mode, 'dark');
67
+ await shot('5-dark');
68
+ await press('press-theme');
69
+
70
+ router.back();
71
+ await sleep(600);
72
+ check('back', router.path(), '/en/guide/started');
73
+ await press('press-title', 800);
74
+ check('home again', router.path(), '/');
75
+
76
+ console.log(`TEST RESULT ${failed ? 'FAILED' : 'PASSED'} ${passed} ok, ${failed} failed`);
77
+ };
78
+ main().catch((e) => console.log(`TEST RESULT FAILED ${e && e.stack}`));
@@ -0,0 +1,28 @@
1
+ import { onCleanup, serverRequest, View } from 'lupine.native.core';
2
+ import { router } from 'lupine.native.components';
3
+ import { runApp } from 'lupine.native.core/web';
4
+ import { App } from './app';
5
+
6
+ /** The app follows the address: the address bar shows its page (/en/guide/started), the buttons of the browser go back and forward. */
7
+ export const followAddress = (base?: string) => router.followUrl(base ? { paths: true, base } : undefined);
8
+
9
+ /** The app as a page of the site (web/src/index.tsx: pageRouter.use('*', AppPage, { keep: true })); in the browser it follows the address. */
10
+ export const AppPage = () => {
11
+ if (!serverRequest()) onCleanup(followAddress());
12
+ return (
13
+ <View style={{ height: '100%' }}>
14
+ <App />
15
+ </View>
16
+ );
17
+ };
18
+
19
+ // A page without the site: lupine-native web starts it in document.body; the page for GitHub Pages
20
+ // (web/src/lupine-template-doc-starter) in its folder.
21
+ export const start = (container: HTMLElement, base?: string) => {
22
+ const stop = followAddress(base);
23
+ const dispose = runApp(App, container);
24
+ return () => {
25
+ dispose();
26
+ stop();
27
+ };
28
+ };
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2020",
4
+ "lib": ["es2020"],
5
+ "types": [],
6
+ "jsx": "react-jsx",
7
+ "jsxImportSource": "lupine.native.core",
8
+ "module": "esnext",
9
+ "moduleResolution": "bundler",
10
+ "strict": true,
11
+ "noEmit": true,
12
+ "skipLibCheck": true
13
+ },
14
+ // the web entries are the only files that may use the DOM, so they aren't checked with these settings
15
+ "include": ["src"],
16
+ "exclude": ["src/**/*.web.tsx"]
17
+ }
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "lupine-template-doc-starter",
3
+ "nativeOut": "dist/native",
4
+ "nativeApp": "app",
3
5
  "markdownEntryPoints": {
4
- "indir": "web/markdown",
5
- "outdir": "web/src/markdown-built"
6
+ "indir": "app/markdown",
7
+ "outdir": "app/src/markdown-built"
6
8
  },
7
9
  "webEntryPoints": [
8
10
  {
@@ -16,9 +18,8 @@
16
18
  "outdir": "/lupine-template-doc-starter"
17
19
  }
18
20
  ],
19
- "apiEntryPoint": "api/src/index.ts",
20
21
  "watchFiles": [
21
- "web/markdown/**/*.md"
22
+ "app/markdown/**/*.md"
22
23
  ],
23
24
  "copyFiles": [
24
25
  {
@@ -33,8 +34,8 @@
33
34
  },
34
35
  {
35
36
  "env": "all",
36
- "from": "api/resources",
37
- "to": "data/resources"
37
+ "from": "web/src/lupine-template-doc-starter/assets",
38
+ "to": "web/lupine-template-doc-starter/assets"
38
39
  }
39
40
  ]
40
- }
41
+ }