@lark-apaas/coding-template-nestjs-react-fullstack 0.1.0-alpha.1

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 (250) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +41 -0
  3. package/hooks/after-install.mjs +3 -0
  4. package/hooks/after-render.mjs +3 -0
  5. package/hooks/before-render.mjs +3 -0
  6. package/package.json +36 -0
  7. package/template/.codebase/pipelines/ci.yaml +34 -0
  8. package/template/.codebase/pipelines/coco-code-review.yaml +21 -0
  9. package/template/.prettierrc +8 -0
  10. package/template/.spark_project +16 -0
  11. package/template/.stylelintrc.js +12 -0
  12. package/template/_env.local +38 -0
  13. package/template/_gitignore +64 -0
  14. package/template/_npmrc +1 -0
  15. package/template/client/index.html +23 -0
  16. package/template/client/public/favicon.svg +40 -0
  17. package/template/client/src/api/index.ts +19 -0
  18. package/template/client/src/app.tsx +22 -0
  19. package/template/client/src/components/Layout.tsx +11 -0
  20. package/template/client/src/components/business-ui/README.md +519 -0
  21. package/template/client/src/components/business-ui/api/chats/queries.ts +39 -0
  22. package/template/client/src/components/business-ui/api/chats/service.ts +29 -0
  23. package/template/client/src/components/business-ui/api/departments/queries.ts +42 -0
  24. package/template/client/src/components/business-ui/api/departments/service.ts +18 -0
  25. package/template/client/src/components/business-ui/api/files/service.ts +28 -0
  26. package/template/client/src/components/business-ui/api/user-profiles/queries.ts +42 -0
  27. package/template/client/src/components/business-ui/api/user-profiles/service.ts +23 -0
  28. package/template/client/src/components/business-ui/api/users/queries.ts +34 -0
  29. package/template/client/src/components/business-ui/api/users/service.ts +40 -0
  30. package/template/client/src/components/business-ui/chat-select/README.md +128 -0
  31. package/template/client/src/components/business-ui/chat-select/chat-item.tsx +85 -0
  32. package/template/client/src/components/business-ui/chat-select/chat-select-tag.tsx +83 -0
  33. package/template/client/src/components/business-ui/chat-select/chat-select.tsx +197 -0
  34. package/template/client/src/components/business-ui/chat-select/index.tsx +12 -0
  35. package/template/client/src/components/business-ui/chat-select/types.ts +102 -0
  36. package/template/client/src/components/business-ui/chat-select/use-chat-value.ts +180 -0
  37. package/template/client/src/components/business-ui/chat-select/utils.ts +81 -0
  38. package/template/client/src/components/business-ui/department-select/department-item.tsx +55 -0
  39. package/template/client/src/components/business-ui/department-select/department-select-field.tsx +86 -0
  40. package/template/client/src/components/business-ui/department-select/department-select-tag.tsx +56 -0
  41. package/template/client/src/components/business-ui/department-select/department-select.tsx +168 -0
  42. package/template/client/src/components/business-ui/department-select/icon-department.tsx +22 -0
  43. package/template/client/src/components/business-ui/department-select/index.tsx +7 -0
  44. package/template/client/src/components/business-ui/department-select/types.ts +15 -0
  45. package/template/client/src/components/business-ui/department-select/utils.ts +17 -0
  46. package/template/client/src/components/business-ui/entity-combobox/base-combobox-content.tsx +35 -0
  47. package/template/client/src/components/business-ui/entity-combobox/base-combobox-empty.tsx +28 -0
  48. package/template/client/src/components/business-ui/entity-combobox/base-combobox-error.tsx +35 -0
  49. package/template/client/src/components/business-ui/entity-combobox/base-combobox-item.tsx +55 -0
  50. package/template/client/src/components/business-ui/entity-combobox/base-combobox-list.tsx +174 -0
  51. package/template/client/src/components/business-ui/entity-combobox/base-combobox-loading.tsx +19 -0
  52. package/template/client/src/components/business-ui/entity-combobox/base-combobox-search.tsx +31 -0
  53. package/template/client/src/components/business-ui/entity-combobox/base-combobox-trigger.tsx +281 -0
  54. package/template/client/src/components/business-ui/entity-combobox/base-combobox.tsx +132 -0
  55. package/template/client/src/components/business-ui/entity-combobox/context.tsx +19 -0
  56. package/template/client/src/components/business-ui/entity-combobox/entity-combobox.tsx +145 -0
  57. package/template/client/src/components/business-ui/entity-combobox/highlight-text.tsx +52 -0
  58. package/template/client/src/components/business-ui/entity-combobox/hooks.tsx +21 -0
  59. package/template/client/src/components/business-ui/entity-combobox/index.tsx +31 -0
  60. package/template/client/src/components/business-ui/entity-combobox/item-pill.tsx +179 -0
  61. package/template/client/src/components/business-ui/entity-combobox/popover-wrapper.tsx +149 -0
  62. package/template/client/src/components/business-ui/entity-combobox/search-trigger.tsx +262 -0
  63. package/template/client/src/components/business-ui/entity-combobox/shared-types.ts +296 -0
  64. package/template/client/src/components/business-ui/entity-combobox/size-variants.tsx +322 -0
  65. package/template/client/src/components/business-ui/entity-combobox/types.ts +246 -0
  66. package/template/client/src/components/business-ui/entity-combobox/use-fetch-data.tsx +81 -0
  67. package/template/client/src/components/business-ui/entity-combobox/use-infinite-scroll.tsx +99 -0
  68. package/template/client/src/components/business-ui/entity-combobox/use-popover-outside-click.tsx +32 -0
  69. package/template/client/src/components/business-ui/form/checkbox-field.tsx +83 -0
  70. package/template/client/src/components/business-ui/form/context.tsx +38 -0
  71. package/template/client/src/components/business-ui/form/field-layout.tsx +91 -0
  72. package/template/client/src/components/business-ui/form/form.tsx +54 -0
  73. package/template/client/src/components/business-ui/form/hooks/form-context.tsx +4 -0
  74. package/template/client/src/components/business-ui/form/hooks/form-utils.ts +23 -0
  75. package/template/client/src/components/business-ui/form/hooks/form.tsx +40 -0
  76. package/template/client/src/components/business-ui/form/index.tsx +4 -0
  77. package/template/client/src/components/business-ui/form/input-field.tsx +74 -0
  78. package/template/client/src/components/business-ui/form/radio-group-field.tsx +138 -0
  79. package/template/client/src/components/business-ui/form/select-field.tsx +155 -0
  80. package/template/client/src/components/business-ui/form/switch-field.tsx +66 -0
  81. package/template/client/src/components/business-ui/form/textarea-field.tsx +72 -0
  82. package/template/client/src/components/business-ui/form/types.ts +32 -0
  83. package/template/client/src/components/business-ui/tiptap-editor/README.md +324 -0
  84. package/template/client/src/components/business-ui/tiptap-editor/components/attachment-toolbar-button.tsx +74 -0
  85. package/template/client/src/components/business-ui/tiptap-editor/components/blockquote-toolbar-button.tsx +41 -0
  86. package/template/client/src/components/business-ui/tiptap-editor/components/code-block-toolbar-button.tsx +41 -0
  87. package/template/client/src/components/business-ui/tiptap-editor/components/color-highlight-toolbar-button.tsx +141 -0
  88. package/template/client/src/components/business-ui/tiptap-editor/components/heading-toolbar-button.tsx +99 -0
  89. package/template/client/src/components/business-ui/tiptap-editor/components/horizontal-rule-toolbar-button.tsx +39 -0
  90. package/template/client/src/components/business-ui/tiptap-editor/components/image-upload-toolbar-button.tsx +65 -0
  91. package/template/client/src/components/business-ui/tiptap-editor/components/link-edit-form.tsx +127 -0
  92. package/template/client/src/components/business-ui/tiptap-editor/components/link-hover-toolbar.tsx +380 -0
  93. package/template/client/src/components/business-ui/tiptap-editor/components/link-toolbar-button.tsx +96 -0
  94. package/template/client/src/components/business-ui/tiptap-editor/components/list-toolbar-button.tsx +75 -0
  95. package/template/client/src/components/business-ui/tiptap-editor/components/mark-toolbar-button.tsx +118 -0
  96. package/template/client/src/components/business-ui/tiptap-editor/components/text-align-toolbar-button.tsx +84 -0
  97. package/template/client/src/components/business-ui/tiptap-editor/components/undo-redo-toolbar-button.tsx +54 -0
  98. package/template/client/src/components/business-ui/tiptap-editor/extensions/attachment.tsx +539 -0
  99. package/template/client/src/components/business-ui/tiptap-editor/extensions/code-block-shiki.tsx +236 -0
  100. package/template/client/src/components/business-ui/tiptap-editor/extensions/complete-kit.ts +260 -0
  101. package/template/client/src/components/business-ui/tiptap-editor/extensions/image.tsx +456 -0
  102. package/template/client/src/components/business-ui/tiptap-editor/hooks/use-tiptap-editor.ts +47 -0
  103. package/template/client/src/components/business-ui/tiptap-editor/index.ts +38 -0
  104. package/template/client/src/components/business-ui/tiptap-editor/tiptap-editor-complete.tsx +112 -0
  105. package/template/client/src/components/business-ui/tiptap-editor/tiptap-editor.tsx +169 -0
  106. package/template/client/src/components/business-ui/types/user.ts +74 -0
  107. package/template/client/src/components/business-ui/user-display/index.tsx +2 -0
  108. package/template/client/src/components/business-ui/user-display/overflow-tooltip-text.tsx +90 -0
  109. package/template/client/src/components/business-ui/user-display/type.ts +27 -0
  110. package/template/client/src/components/business-ui/user-display/user-display.tsx +99 -0
  111. package/template/client/src/components/business-ui/user-display/user-with-avatar.tsx +158 -0
  112. package/template/client/src/components/business-ui/user-display/utils.ts +37 -0
  113. package/template/client/src/components/business-ui/user-profile/error-image.tsx +302 -0
  114. package/template/client/src/components/business-ui/user-profile/user-external-script.ts +73 -0
  115. package/template/client/src/components/business-ui/user-profile/user-profile.tsx +370 -0
  116. package/template/client/src/components/business-ui/user-select/index.tsx +28 -0
  117. package/template/client/src/components/business-ui/user-select/types.ts +109 -0
  118. package/template/client/src/components/business-ui/user-select/use-user-value.ts +160 -0
  119. package/template/client/src/components/business-ui/user-select/user-item.tsx +98 -0
  120. package/template/client/src/components/business-ui/user-select/user-pill.tsx +140 -0
  121. package/template/client/src/components/business-ui/user-select/user-select-tag.tsx +82 -0
  122. package/template/client/src/components/business-ui/user-select/user-select.tsx +359 -0
  123. package/template/client/src/components/business-ui/user-select/utils.tsx +188 -0
  124. package/template/client/src/components/business-ui/utils/user.ts +72 -0
  125. package/template/client/src/components/ui/README.md +134 -0
  126. package/template/client/src/components/ui/accordion.tsx +66 -0
  127. package/template/client/src/components/ui/alert-dialog.tsx +157 -0
  128. package/template/client/src/components/ui/alert.tsx +71 -0
  129. package/template/client/src/components/ui/aspect-ratio.tsx +11 -0
  130. package/template/client/src/components/ui/avatar.tsx +53 -0
  131. package/template/client/src/components/ui/badge.tsx +42 -0
  132. package/template/client/src/components/ui/breadcrumb.tsx +109 -0
  133. package/template/client/src/components/ui/button-group.tsx +83 -0
  134. package/template/client/src/components/ui/button.tsx +69 -0
  135. package/template/client/src/components/ui/calendar.tsx +213 -0
  136. package/template/client/src/components/ui/card.tsx +82 -0
  137. package/template/client/src/components/ui/carousel.tsx +241 -0
  138. package/template/client/src/components/ui/chart.tsx +357 -0
  139. package/template/client/src/components/ui/checkbox.tsx +32 -0
  140. package/template/client/src/components/ui/collapsible.tsx +33 -0
  141. package/template/client/src/components/ui/command.tsx +208 -0
  142. package/template/client/src/components/ui/context-menu.tsx +324 -0
  143. package/template/client/src/components/ui/dialog.tsx +143 -0
  144. package/template/client/src/components/ui/drawer.tsx +135 -0
  145. package/template/client/src/components/ui/dropdown-menu.tsx +329 -0
  146. package/template/client/src/components/ui/empty.tsx +104 -0
  147. package/template/client/src/components/ui/field.tsx +248 -0
  148. package/template/client/src/components/ui/form.tsx +167 -0
  149. package/template/client/src/components/ui/hover-card.tsx +44 -0
  150. package/template/client/src/components/ui/icons/file-ae-colorful-icon.tsx +21 -0
  151. package/template/client/src/components/ui/icons/file-ai-colorful-icon.tsx +36 -0
  152. package/template/client/src/components/ui/icons/file-android-colorful-icon.tsx +33 -0
  153. package/template/client/src/components/ui/icons/file-audio-colorful-icon.tsx +21 -0
  154. package/template/client/src/components/ui/icons/file-code-colorful-icon.tsx +28 -0
  155. package/template/client/src/components/ui/icons/file-csv-colorful-icon.tsx +21 -0
  156. package/template/client/src/components/ui/icons/file-eml-colorful-icon.tsx +29 -0
  157. package/template/client/src/components/ui/icons/file-ios-colorful-icon.tsx +25 -0
  158. package/template/client/src/components/ui/icons/file-keynote-colorful-icon.tsx +29 -0
  159. package/template/client/src/components/ui/icons/file-pages-colorful-icon.tsx +29 -0
  160. package/template/client/src/components/ui/icons/file-ps-colorful-icon.tsx +21 -0
  161. package/template/client/src/components/ui/icons/file-sketch-colorful-icon.tsx +21 -0
  162. package/template/client/src/components/ui/icons/file-slide-colorful-icon.tsx +21 -0
  163. package/template/client/src/components/ui/icons/file-vcf-colorful-icon.tsx +29 -0
  164. package/template/client/src/components/ui/icons/file-wiki-excel-colorful-icon.tsx +23 -0
  165. package/template/client/src/components/ui/icons/file-wiki-image-colorful-icon.tsx +27 -0
  166. package/template/client/src/components/ui/icons/file-wiki-pdf-colorful-icon.tsx +20 -0
  167. package/template/client/src/components/ui/icons/file-wiki-ppt-colorful-icon.tsx +21 -0
  168. package/template/client/src/components/ui/icons/file-wiki-text-colorful-icon.tsx +12 -0
  169. package/template/client/src/components/ui/icons/file-wiki-unknown-colorful-icon.tsx +14 -0
  170. package/template/client/src/components/ui/icons/file-wiki-video-colorful-icon.tsx +23 -0
  171. package/template/client/src/components/ui/icons/file-wiki-word-colorful-icon.tsx +38 -0
  172. package/template/client/src/components/ui/icons/file-wiki-zip-colorful-icon.tsx +21 -0
  173. package/template/client/src/components/ui/image.tsx +183 -0
  174. package/template/client/src/components/ui/input-group.tsx +166 -0
  175. package/template/client/src/components/ui/input-otp.tsx +77 -0
  176. package/template/client/src/components/ui/input.tsx +21 -0
  177. package/template/client/src/components/ui/item.tsx +193 -0
  178. package/template/client/src/components/ui/kbd.tsx +28 -0
  179. package/template/client/src/components/ui/label.tsx +24 -0
  180. package/template/client/src/components/ui/menubar.tsx +348 -0
  181. package/template/client/src/components/ui/native-select.tsx +48 -0
  182. package/template/client/src/components/ui/navigation-menu.tsx +168 -0
  183. package/template/client/src/components/ui/pagination.tsx +127 -0
  184. package/template/client/src/components/ui/popover.tsx +48 -0
  185. package/template/client/src/components/ui/progress.tsx +31 -0
  186. package/template/client/src/components/ui/radio-group.tsx +45 -0
  187. package/template/client/src/components/ui/resizable.tsx +56 -0
  188. package/template/client/src/components/ui/scroll-area.tsx +58 -0
  189. package/template/client/src/components/ui/select.tsx +243 -0
  190. package/template/client/src/components/ui/separator.tsx +28 -0
  191. package/template/client/src/components/ui/sheet.tsx +139 -0
  192. package/template/client/src/components/ui/sidebar.tsx +727 -0
  193. package/template/client/src/components/ui/skeleton.tsx +13 -0
  194. package/template/client/src/components/ui/slider.tsx +87 -0
  195. package/template/client/src/components/ui/sonner.tsx +67 -0
  196. package/template/client/src/components/ui/spinner.tsx +16 -0
  197. package/template/client/src/components/ui/streamdown.tsx +186 -0
  198. package/template/client/src/components/ui/switch.tsx +31 -0
  199. package/template/client/src/components/ui/table.tsx +116 -0
  200. package/template/client/src/components/ui/tabs.tsx +66 -0
  201. package/template/client/src/components/ui/textarea.tsx +18 -0
  202. package/template/client/src/components/ui/toggle-group.tsx +83 -0
  203. package/template/client/src/components/ui/toggle.tsx +47 -0
  204. package/template/client/src/components/ui/tooltip.tsx +61 -0
  205. package/template/client/src/hooks/use-example.ts +52 -0
  206. package/template/client/src/hooks/use-mobile.ts +19 -0
  207. package/template/client/src/index.css +7 -0
  208. package/template/client/src/index.tsx +36 -0
  209. package/template/client/src/lib/shiki.ts +92 -0
  210. package/template/client/src/lib/utils.ts +6 -0
  211. package/template/client/src/pages/ExamplePage/ExamplePage.tsx +37 -0
  212. package/template/client/src/pages/NotFound/NotFound.tsx +11 -0
  213. package/template/client/src/tailwind-theme.css +257 -0
  214. package/template/client/src/types/common.ts +34 -0
  215. package/template/client/src/types/global.d.ts +53 -0
  216. package/template/client/src/types/index.ts +4 -0
  217. package/template/client/src/typography.css +41 -0
  218. package/template/client/src/utils/img-resources/avatar-placeholders.ts +12 -0
  219. package/template/client/src/utils/img-resources/banner-placeholders.ts +29 -0
  220. package/template/client/src/utils/img-resources/cover-placeholders.ts +47 -0
  221. package/template/components.json +21 -0
  222. package/template/eslint.config.js +50 -0
  223. package/template/nest-cli.json +25 -0
  224. package/template/package-lock.json +29195 -0
  225. package/template/package.json +202 -0
  226. package/template/postcss.config.js +10 -0
  227. package/template/scripts/build.sh +120 -0
  228. package/template/scripts/dev.js +295 -0
  229. package/template/scripts/dev.sh +2 -0
  230. package/template/scripts/lint.js +150 -0
  231. package/template/scripts/prune-smart.js +281 -0
  232. package/template/scripts/run.sh +5 -0
  233. package/template/server/app.module.ts +27 -0
  234. package/template/server/common/constants/api_response_code.ts +54 -0
  235. package/template/server/common/filters/exception.filter.ts +78 -0
  236. package/template/server/common/interfaces/api_response.interface.ts +21 -0
  237. package/template/server/common/interfaces/exception.interface.ts +19 -0
  238. package/template/server/database/schema.ts +90 -0
  239. package/template/server/main.ts +31 -0
  240. package/template/server/modules/hello/hello.controller.ts +16 -0
  241. package/template/server/modules/hello/hello.module.ts +10 -0
  242. package/template/server/modules/hello/hello.service.ts +28 -0
  243. package/template/server/modules/view/view.controller.ts +17 -0
  244. package/template/server/modules/view/view.module.ts +8 -0
  245. package/template/shared/api.interface.ts +1 -0
  246. package/template/tailwind.config.ts +9 -0
  247. package/template/tsconfig.app.json +23 -0
  248. package/template/tsconfig.json +8 -0
  249. package/template/tsconfig.node.json +16 -0
  250. package/template/vite.config.ts +10 -0
package/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Lark Technologies Pte. Ltd. and/or its affiliates
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted,provided that the above copyright notice and this permission notice appear in all copies.
6
+
7
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
8
+ IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
9
+ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
10
+ EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
11
+ CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
12
+ DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
13
+ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @lark-apaas/coding-template-nestjs-react-fullstack
2
+
3
+ 妙搭 (Miaoda) NestJS + React 全栈应用模板。`archType: 3`(application scene)。
4
+
5
+ ## 用法
6
+
7
+ 通过 `miaoda app init` 渲染:
8
+
9
+ ```bash
10
+ MIAODA_APP_TYPE=3 npx @lark-apaas/miaoda-cli@<latest> app init \
11
+ --template nestjs-react-fullstack \
12
+ --app-id app_xxx
13
+ ```
14
+
15
+ ## 本地开发(`npm run dev:local`)
16
+
17
+ 依赖 SDK 自带的 dotenv 加载(`@lark-apaas/fullstack-{vite-preset,nestjs-core}` ≥ 对应 alpha 版本)。在新生成的应用目录里:
18
+
19
+ 1. 填 `.env.local`(从 `_env.local` 模板渲染而来,注释里写了每个 env 的获取方式)
20
+ 2. `npm run dev:local`
21
+
22
+ 关键 env:
23
+
24
+ - `MIAODA_LOCAL_DEV=1` —— 由 `scripts/dev-local.sh` 自动 export
25
+ - `FORCE_AUTHN_PREVIEW_SESSION_ID` —— 后端下发的 session id(替代浏览器手抠 cookie)
26
+ - `SUDA_WEBUSER` —— webuser JSON
27
+ - `SANDBOX_PUBLIC_URL` —— 沙箱公网域
28
+ - `CLIENT_BASE_PATH=/app/<app_id>/` —— React Router basename + Vite base
29
+
30
+ ## 包结构
31
+
32
+ ```
33
+ .
34
+ ├── package.json ← 本模板包的发包元数据
35
+ ├── hooks/ ← miaoda-cli 在 init 阶段调用的 hook(v0.1 全 no-op)
36
+ └── template/ ← 渲染到用户应用目录的内容
37
+ ```
38
+
39
+ `template/` 内以下划线开头的占位文件(`_gitignore` / `_npmrc` / `_env.local`)在 `miaoda app init`
40
+ 渲染时会按 RENAME 映射改回正常名(npm pack 会特殊处理 `.gitignore`、且 `.npmrc` 直接放
41
+ 在包里会污染用户 `npm install` 行为,所以都要 underscore 前缀)。
@@ -0,0 +1,3 @@
1
+ export default async function afterInstall(ctx) {
2
+ // no-op for v0.1
3
+ }
@@ -0,0 +1,3 @@
1
+ export default async function afterRender(ctx) {
2
+ // no-op for v0.1
3
+ }
@@ -0,0 +1,3 @@
1
+ export default async function beforeRender(ctx) {
2
+ // no-op for v0.1
3
+ }
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@lark-apaas/coding-template-nestjs-react-fullstack",
3
+ "version": "0.1.0-alpha.1",
4
+ "description": "NestJS + React fullstack template for miaoda coding",
5
+ "type": "module",
6
+ "files": [
7
+ "template",
8
+ "hooks"
9
+ ],
10
+ "scripts": {
11
+ "validate-manifest": "node ../../../scripts/validate-template.mjs .",
12
+ "smoke": "echo 'smoke skipped: template build.sh prompts interactively for plugin scaffolding (fullstack-cli action-plugin add). Re-enable once build.sh supports non-interactive mode or smoke runs typecheck-only.' && exit 0",
13
+ "prepublishOnly": "pnpm validate-manifest"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public",
17
+ "registry": "https://registry.npmjs.org/"
18
+ },
19
+ "keywords": [
20
+ "miaoda",
21
+ "coding-template",
22
+ "nestjs",
23
+ "react",
24
+ "fullstack"
25
+ ],
26
+ "license": "MIT",
27
+ "miaodaTemplate": {
28
+ "schemaVersion": 1,
29
+ "archType": 3,
30
+ "hooks": {
31
+ "beforeRender": "hooks/before-render.mjs",
32
+ "afterRender": "hooks/after-render.mjs",
33
+ "afterInstall": "hooks/after-install.mjs"
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,34 @@
1
+ name: CI
2
+ trigger:
3
+ manual:
4
+ change:
5
+ types: [create, push, restore]
6
+ notification:
7
+ when: failure
8
+ jobs:
9
+ run_all:
10
+ runs-on:
11
+ env: online
12
+ spec: m1.2xlarge
13
+ name: CI Check
14
+ timeout: 30
15
+ image: hub.byted.org/compile/toutiao.compile_nodejs.v24:226b14276e1aa1db07ccc1e6d6055e8c
16
+ envs:
17
+ CI: 'true'
18
+ NODE_OPTIONS: '--max-old-space-size=8192'
19
+ steps:
20
+ - id: Checkout
21
+ uses: actions/checkout
22
+ inputs:
23
+ depth: 1
24
+ - name: Install dependencies
25
+ commands:
26
+ - npm config set registry=https://registry.npmmirror.com
27
+ - npm install --no-package-lock
28
+ - name: ESLint (应用模式)
29
+ parallel-with-next-step: true
30
+ commands:
31
+ - npm run eslint
32
+ - name: TypeScript Check
33
+ commands:
34
+ - npm run type:check
@@ -0,0 +1,21 @@
1
+ name: Code Review
2
+ trigger:
3
+ manual:
4
+ change:
5
+ branches: ['master']
6
+ types: [create, push]
7
+ jobs:
8
+ run_cr:
9
+ runs-on:
10
+ env: online
11
+ name: Coco Code Review
12
+ if: '${{ Event.Change.IsPreSubmit == false }}'
13
+ image: hub.byted.org/base/lbpe-code-review:latest
14
+ timeout: 30
15
+ envs:
16
+ MR_SOURCE_BRANCH: ${{Event.Change.Source.Branch}}
17
+ MR_TARGET_BRANCH: ${{Event.Change.Target.Branch}}
18
+ steps:
19
+ - name: Code Review
20
+ commands:
21
+ - mr-review ${{Event.Change.URL}}
@@ -0,0 +1,8 @@
1
+ {
2
+ "semi": true,
3
+ "trailingComma": "all",
4
+ "singleQuote": true,
5
+ "printWidth": 80,
6
+ "tabWidth": 2,
7
+ "useTabs": false
8
+ }
@@ -0,0 +1,16 @@
1
+ run = ["npm", "run", "dev"] # 默认 spark-cli dev
2
+ hidden = [".config", ".git", "scripts", "node_modules", "dist", ".spark", ".agent", ".agents", "tmp", ".spark_project", ".playwright-cli"]
3
+ lint = ["npm", "run", "lint"]
4
+ test = ["npm", "run", "test"]
5
+ genDbSchema = ["npm", "run", "gen:db-schema"]
6
+ genOpenApiClient = ["echo", "'SKIP GEN API CLIENT, WRITE CODE BY YOURSELF'"]
7
+
8
+ [deployment]
9
+ build = ["npm", "run", "build"]
10
+ run = ["npm", "run", "start"]
11
+
12
+ [files]
13
+ [files.restrict]
14
+ pathPatterns = ["client/src/api/gen", "package.json", ".spark_project"]
15
+ [files.hidden]
16
+ pathPatterns = [".config", ".git", "scripts", "node_modules", "dist", ".spark", ".agent", ".agents", "tmp", ".spark_project", ".playwright-cli"]
@@ -0,0 +1,12 @@
1
+ const { stylelintPresetsOfSimple } = require('@lark-apaas/fullstack-presets');
2
+
3
+ module.exports = {
4
+ extends: [ stylelintPresetsOfSimple ],
5
+ ignoreFiles: [
6
+ 'node_modules/**',
7
+ 'dist/**',
8
+ 'build/**',
9
+ 'coverage/**',
10
+ '*.min.css',
11
+ ],
12
+ };
@@ -0,0 +1,38 @@
1
+ # =================================================
2
+ # 妙搭本地开发 — .env.local
3
+ # 优先级:shell env > .env.local > .env
4
+ # SDK(fullstack-vite-preset / fullstack-nestjs-core)在 module init 通过 dotenv 自动加载
5
+ # =================================================
6
+
7
+ # ───── 应用上下文 ─────
8
+ # app_id=app_xxx
9
+ # CLIENT_BASE_PATH=/app/app_xxx/ # React Router basename + Vite base
10
+ # FORCE_FRAMEWORK_DOMAIN_MAIN=https://miaoda.feishu-boe.cn
11
+ # FORCE_FRAMEWORK_ENVIRONMENT=boe
12
+
13
+ # ───── 端口(缺省即使用 SDK 默认 8080 / 3000,本地推荐 8001 / 3000)─────
14
+ # CLIENT_DEV_PORT=8001
15
+ # SERVER_PORT=3000
16
+ # SERVER_HOST=localhost
17
+ # CLIENT_DEV_HOST=0.0.0.0
18
+
19
+ # ───── 业务 DB(BOE PG 公网 endpoint,本地可直连)─────
20
+ # SUDA_DATABASE_URL=postgresql://<user>:<pass>@<host>.miaoda-pg-staging.aiforce.cloud:5432/<db>?sslmode=require&schema=workspace_<id>
21
+
22
+ # ───── 沙箱反代(本地 dev 兜底;MIAODA_LOCAL_DEV=1 由 scripts/dev-local.sh 自动 export)─────
23
+ # SANDBOX_PUBLIC_URL=https://ai-tenant-<app_id>-<sandbox_id>.aiforce-boe-preview.bytedance.net
24
+
25
+ # 后端下发的单值 session id(新流,推荐)
26
+ # FORCE_AUTHN_PREVIEW_SESSION_ID=<后端给的 session 值>
27
+
28
+ # webuser 身份(JSON,必须单行无空格)
29
+ # SUDA_WEBUSER={"user_id":"...","tenant_id":...,"app_id":"app_xxx","env":"preview","login_url":"","roles":null,"user_type":"_employee","user_name":{"zh_cn":"..."}}
30
+
31
+ # ───── 日志 ─────
32
+ LOG_DIR=./logs
33
+ LOG_REQUEST_BODY=true
34
+ LOG_RESPONSE_BODY=true
35
+
36
+ # ───── 构建期 ─────
37
+ FORCE_FRAMEWORK_BUILD_LOOSE_MODE=false
38
+ FORCE_FRAMEWORK_LINT_LOOSE_MODE=false
@@ -0,0 +1,64 @@
1
+ # Dependencies
2
+ node_modules/
3
+ */node_modules/
4
+
5
+ # Production builds
6
+ dist/
7
+ */dist/
8
+ build/
9
+ */build/
10
+
11
+ # Environment files
12
+ .env.local
13
+
14
+ # Logs
15
+ npm-debug.log*
16
+ yarn-debug.log*
17
+ yarn-error.log*
18
+ lerna-debug.log*
19
+ /logs/
20
+
21
+ # Runtime data
22
+ pids
23
+ *.pid
24
+ *.seed
25
+ *.pid.lock
26
+
27
+ # Coverage directory used by tools like istanbul
28
+ coverage/
29
+ *.lcov
30
+
31
+ # IDE files
32
+ .vscode/
33
+ .idea/
34
+ *.swp
35
+ *.swo
36
+ *~
37
+
38
+ # OS generated files
39
+ .DS_Store
40
+ .DS_Store?
41
+ ._*
42
+ .Spotlight-V100
43
+ .Trashes
44
+ ehthumbs.db
45
+ Thumbs.db
46
+
47
+ # Temporary folders
48
+ tmp/
49
+ temp/
50
+ .playwright-cli/
51
+
52
+ # Lock files (keep package-lock.json for consistent installs)
53
+ yarn.lock
54
+ pnpm-lock.yaml
55
+
56
+ # Cache files
57
+ .eslintcache
58
+ *.tsbuildinfo
59
+
60
+ # swc wasm
61
+ .swc
62
+
63
+ # Agent files
64
+ .agent/
@@ -0,0 +1 @@
1
+ registry=https://registry.npmmirror.com/
@@ -0,0 +1,23 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <link rel="icon" href="/favicon.svg">
8
+ <title>妙搭</title>
9
+ <script>
10
+ try {
11
+ window.__platform__ = JSON.parse('{{{__platform__}}}');
12
+ } catch (e) {
13
+ console.error('Failed to parse __platform__', e);
14
+ }
15
+ </script>
16
+ </head>
17
+
18
+ <body>
19
+ <div id="root"></div>
20
+ <script type="module" src="/client/src/index.tsx"></script>
21
+ </body>
22
+
23
+ </html>
@@ -0,0 +1,40 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14.2129 25.336V19.653C14.2129 16.5158 16.756 13.9727 19.8932 13.9727H24.8207V14.178C24.8207 14.8678 24.5661 15.5358 24.1062 16.0504L15.4037 25.7904C14.9849 26.2585 14.2129 25.9629 14.2129 25.336Z" fill="url(#paint0_linear_8585_129329)"/>
3
+ <path d="M14.2129 25.336V19.653C14.2129 16.5158 16.756 13.9727 19.8932 13.9727H24.8207V14.178C24.8207 14.8678 24.5661 15.5358 24.1062 16.0504L15.4037 25.7904C14.9849 26.2585 14.2129 25.9629 14.2129 25.336Z" fill="url(#paint1_linear_8585_129329)"/>
4
+ <path d="M20.0485 7.85156H14.683C14.4229 7.85156 14.2148 8.06235 14.2148 8.31967C14.2148 11.4568 16.758 14 19.8952 14H23.8043C24.2341 14.1232 24.5544 14.5584 24.5544 15.0813C24.5544 15.2592 24.516 15.4235 24.4531 15.5713C24.694 15.1497 24.8226 14.6542 24.8226 14.1478V12.6258C24.8226 9.98955 22.6847 7.85156 20.0485 7.85156Z" fill="url(#paint2_linear_8585_129329)"/>
5
+ <path d="M13.7875 2.6645V8.34754C13.7875 11.4847 11.2444 14.0278 8.10718 14.0278H3.17969V13.8225C3.17969 13.1327 3.43427 12.4647 3.89417 11.9501L12.5967 2.21007C13.0155 1.74196 13.7875 2.03761 13.7875 2.6645Z" fill="url(#paint3_linear_8585_129329)"/>
6
+ <path d="M13.7875 2.6645V8.34754C13.7875 11.4847 11.2444 14.0278 8.10718 14.0278H3.17969V13.8225C3.17969 13.1327 3.43427 12.4647 3.89417 11.9501L12.5967 2.21007C13.0155 1.74196 13.7875 2.03761 13.7875 2.6645Z" fill="url(#paint4_linear_8585_129329)"/>
7
+ <path d="M13.7875 2.6645V8.34754C13.7875 11.4847 11.2444 14.0278 8.10718 14.0278H3.17969V13.8225C3.17969 13.1327 3.43427 12.4647 3.89417 11.9501L12.5967 2.21007C13.0155 1.74196 13.7875 2.03761 13.7875 2.6645Z" fill="url(#paint5_linear_8585_129329)"/>
8
+ <path d="M7.95388 20.1485H13.3194C13.5794 20.1485 13.7875 19.9377 13.7875 19.6803C13.7875 16.5432 11.2444 14 8.10718 14H4.19804C3.76825 13.8768 3.44796 13.4416 3.44796 12.9187C3.44796 12.7408 3.48629 12.5765 3.54925 12.4287C3.30835 12.8503 3.17969 13.3458 3.17969 13.8522V15.3743C3.17969 18.0105 5.31767 20.1485 7.95388 20.1485Z" fill="url(#paint6_linear_8585_129329)"/>
9
+ <defs>
10
+ <linearGradient id="paint0_linear_8585_129329" x1="23.7284" y1="12.519" x2="14.1922" y2="21.9925" gradientUnits="userSpaceOnUse">
11
+ <stop offset="0.196503" stop-color="#2C68FF"/>
12
+ <stop offset="1" stop-color="#9CB5FF"/>
13
+ </linearGradient>
14
+ <linearGradient id="paint1_linear_8585_129329" x1="23.7453" y1="13.9669" x2="21.0235" y2="27.7848" gradientUnits="userSpaceOnUse">
15
+ <stop offset="0.0917703" stop-color="#1E7DFF"/>
16
+ <stop offset="0.82106" stop-color="#91AEFD"/>
17
+ </linearGradient>
18
+ <linearGradient id="paint2_linear_8585_129329" x1="13.3286" y1="7.4164" x2="26.5839" y2="15.5456" gradientUnits="userSpaceOnUse">
19
+ <stop stop-color="#2880FF"/>
20
+ <stop offset="0.602642" stop-color="#AA93FE"/>
21
+ <stop offset="0.925066" stop-color="#D0C0FF"/>
22
+ </linearGradient>
23
+ <linearGradient id="paint3_linear_8585_129329" x1="-2.17936" y1="16.9699" x2="16.1938" y2="3.20926" gradientUnits="userSpaceOnUse">
24
+ <stop offset="0.293542" stop-color="#FFEDDC"/>
25
+ <stop offset="0.848516" stop-color="#50AAFF"/>
26
+ </linearGradient>
27
+ <linearGradient id="paint4_linear_8585_129329" x1="5.25082" y1="14.0444" x2="7.59094" y2="-1.34504" gradientUnits="userSpaceOnUse">
28
+ <stop stop-color="#2075FF"/>
29
+ <stop offset="0.837223" stop-color="#A892FE"/>
30
+ </linearGradient>
31
+ <linearGradient id="paint5_linear_8585_129329" x1="5.71682" y1="13.4748" x2="8.41257" y2="0.832496" gradientUnits="userSpaceOnUse">
32
+ <stop offset="0.0917703" stop-color="#1E7DFF"/>
33
+ <stop offset="0.82106" stop-color="#91AEFD"/>
34
+ </linearGradient>
35
+ <linearGradient id="paint6_linear_8585_129329" x1="14.5191" y1="20.827" x2="2.32534" y2="13.3709" gradientUnits="userSpaceOnUse">
36
+ <stop offset="0.085229" stop-color="#1683FC"/>
37
+ <stop offset="0.721235" stop-color="#ADA8FF"/>
38
+ </linearGradient>
39
+ </defs>
40
+ </svg>
@@ -0,0 +1,19 @@
1
+ import { logger } from '@lark-apaas/client-toolkit/logger';
2
+ import { axiosForBackend } from '@lark-apaas/client-toolkit/utils/getAxiosForBackend';
3
+
4
+
5
+ // Add more API functions here, use axios instance (`axiosForBackend`) to make requests.
6
+ //
7
+ // 使用示例:
8
+ // export async function getUserData(userId: string) {
9
+ // try {
10
+ // const response = await axiosForBackend({
11
+ // url: `/api/users/${userId}`,
12
+ // method: 'GET'
13
+ // });
14
+ // return response.data;
15
+ // } catch (error) {
16
+ // logger.error('获取用户数据失败', error);
17
+ // throw error;
18
+ // }
19
+ // }
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { Route, Routes } from 'react-router-dom';
3
+
4
+ // This is a temporary placeholder component from spark-framework
5
+ import { Welcome } from '@lark-apaas/client-toolkit/components/Welcome';
6
+
7
+ import Layout from './components/Layout';
8
+ import NotFound from './pages/NotFound/NotFound';
9
+
10
+ const RoutesComponent = () => {
11
+ return (
12
+ <Routes>
13
+ <Route element={<Layout />}>
14
+ {/* This Welcome component should be replaced with the actual home page content */}
15
+ <Route index element={<Welcome />} />
16
+ </Route>
17
+ <Route path="*" element={<NotFound />} />
18
+ </Routes>
19
+ );
20
+ };
21
+
22
+ export default RoutesComponent;
@@ -0,0 +1,11 @@
1
+ import { Outlet } from "react-router-dom";
2
+
3
+ const Layout = () => {
4
+ return (
5
+ <div className="w-screen h-screen">
6
+ <Outlet />
7
+ </div>
8
+ );
9
+ };
10
+
11
+ export default Layout;