create-young-proj 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +13 -2
  3. package/dist/index.mjs +18 -18
  4. package/index.mjs +3 -3
  5. package/package.json +10 -12
  6. package/template-admin-server/.editorconfig +11 -0
  7. package/template-admin-server/.nvmrc +1 -0
  8. package/template-admin-server/.vscode/extensions.json +6 -0
  9. package/template-admin-server/.vscode/settings.json +4 -0
  10. package/template-admin-server/README.md +73 -0
  11. package/template-admin-server/_gitignore +15 -0
  12. package/template-admin-server/boot.mjs +11 -0
  13. package/template-admin-server/package.json +60 -0
  14. package/template-admin-server/rome.json +22 -0
  15. package/template-admin-server/src/config/config.default.ts +56 -0
  16. package/template-admin-server/src/configuration.ts +47 -0
  17. package/template-admin-server/src/controller/admin.controller.ts +397 -0
  18. package/template-admin-server/src/controller/api.controller.ts +98 -0
  19. package/template-admin-server/src/controller/base.controller.ts +70 -0
  20. package/template-admin-server/src/controller/dto/api.ts +47 -0
  21. package/template-admin-server/src/controller/dto/index.ts +36 -0
  22. package/template-admin-server/src/controller/dto/menu.ts +41 -0
  23. package/template-admin-server/src/controller/dto/role.ts +41 -0
  24. package/template-admin-server/src/controller/dto/user.ts +52 -0
  25. package/template-admin-server/src/controller/menu.controller.ts +138 -0
  26. package/template-admin-server/src/controller/role.controller.ts +116 -0
  27. package/template-admin-server/src/controller/user.controller.ts +108 -0
  28. package/template-admin-server/src/entities/Api.ts +29 -0
  29. package/template-admin-server/src/entities/BaseCreate.ts +30 -0
  30. package/template-admin-server/src/entities/Menu.ts +39 -0
  31. package/template-admin-server/src/entities/Role.ts +36 -0
  32. package/template-admin-server/src/entities/User.ts +35 -0
  33. package/template-admin-server/src/entities/index.ts +10 -0
  34. package/template-admin-server/src/filter/default.filter.ts +22 -0
  35. package/template-admin-server/src/filter/notfound.filter.ts +23 -0
  36. package/template-admin-server/src/middleware/helper.middleware.ts +28 -0
  37. package/template-admin-server/src/middleware/index.ts +9 -0
  38. package/template-admin-server/src/middleware/jwt.middleware.ts +32 -0
  39. package/template-admin-server/src/middleware/report.middleware.ts +26 -0
  40. package/template-admin-server/src/service/api.service.ts +174 -0
  41. package/template-admin-server/src/service/basic.ts +118 -0
  42. package/template-admin-server/src/service/index.ts +10 -0
  43. package/template-admin-server/src/service/menu.service.ts +139 -0
  44. package/template-admin-server/src/service/role.service.ts +286 -0
  45. package/template-admin-server/src/service/user.service.ts +124 -0
  46. package/template-admin-server/src/strategy/jwt.strategy.ts +26 -0
  47. package/template-admin-server/src/types/index.ts +42 -0
  48. package/template-admin-server/src/types/types.d.ts +31 -0
  49. package/template-admin-server/tsconfig.json +24 -0
  50. package/template-vue-admin/.vscode/extensions.json +10 -0
  51. package/template-vue-admin/.vscode/list-add.code-snippets +108 -0
  52. package/template-vue-admin/.vscode/list-export.code-snippets +72 -0
  53. package/template-vue-admin/.vscode/list.code-snippets +61 -0
  54. package/template-vue-admin/.vscode/settings.json +7 -0
  55. package/template-vue-admin/Dockerfile +42 -0
  56. package/template-vue-admin/README.md +75 -0
  57. package/template-vue-admin/_env +8 -0
  58. package/template-vue-admin/_gitignore +30 -0
  59. package/template-vue-admin/boot.mjs +16 -0
  60. package/template-vue-admin/config/.devrc +2 -0
  61. package/template-vue-admin/config/.onlinerc +2 -0
  62. package/template-vue-admin/config/.testrc +2 -0
  63. package/template-vue-admin/index.html +21 -0
  64. package/template-vue-admin/nitro.config.ts +19 -0
  65. package/template-vue-admin/package.json +50 -0
  66. package/template-vue-admin/plugins/env.ts +26 -0
  67. package/template-vue-admin/public/vite.svg +1 -0
  68. package/template-vue-admin/rome.json +26 -0
  69. package/template-vue-admin/routes/api/[...all].ts +49 -0
  70. package/template-vue-admin/routes/get/env.ts +18 -0
  71. package/template-vue-admin/src/App.vue +14 -0
  72. package/template-vue-admin/src/apis/delete.ts +36 -0
  73. package/template-vue-admin/src/apis/get.ts +84 -0
  74. package/template-vue-admin/src/apis/index.ts +10 -0
  75. package/template-vue-admin/src/apis/patch.ts +79 -0
  76. package/template-vue-admin/src/apis/post.ts +77 -0
  77. package/template-vue-admin/src/assets/img/login_background.jpg +0 -0
  78. package/template-vue-admin/src/auto-components.d.ts +36 -0
  79. package/template-vue-admin/src/auto-imports.d.ts +282 -0
  80. package/template-vue-admin/src/layouts/blank.vue +9 -0
  81. package/template-vue-admin/src/layouts/default/components/Link.vue +23 -0
  82. package/template-vue-admin/src/layouts/default/components/Logo.vue +20 -0
  83. package/template-vue-admin/src/layouts/default/components/Menu.vue +54 -0
  84. package/template-vue-admin/src/layouts/default/components/NavSearch.vue +52 -0
  85. package/template-vue-admin/src/layouts/default/components/ScrollPane.vue +79 -0
  86. package/template-vue-admin/src/layouts/default/components/TagsView.vue +137 -0
  87. package/template-vue-admin/src/layouts/default/components/TopMenu.vue +21 -0
  88. package/template-vue-admin/src/layouts/default/components/UserCenter.vue +50 -0
  89. package/template-vue-admin/src/layouts/default/index.vue +95 -0
  90. package/template-vue-admin/src/main.ts +44 -0
  91. package/template-vue-admin/src/modules/1-router.ts +66 -0
  92. package/template-vue-admin/src/modules/2-pinia.ts +10 -0
  93. package/template-vue-admin/src/modules/3-net.ts +75 -0
  94. package/template-vue-admin/src/modules/4-auth.ts +122 -0
  95. package/template-vue-admin/src/stores/index.ts +9 -0
  96. package/template-vue-admin/src/stores/local/index.ts +23 -0
  97. package/template-vue-admin/src/stores/session/index.ts +63 -0
  98. package/template-vue-admin/src/stores/tags.ts +109 -0
  99. package/template-vue-admin/src/typings/global.d.ts +70 -0
  100. package/template-vue-admin/src/typings/index.ts +50 -0
  101. package/template-vue-admin/src/views/403.vue +32 -0
  102. package/template-vue-admin/src/views/[...all_404].vue +556 -0
  103. package/template-vue-admin/src/views/base/login.vue +193 -0
  104. package/template-vue-admin/src/views/dashboard/[name].vue +23 -0
  105. package/template-vue-admin/src/views/index.vue +19 -0
  106. package/template-vue-admin/src/views/system/api.vue +161 -0
  107. package/template-vue-admin/src/views/system/hooks/useRole.ts +286 -0
  108. package/template-vue-admin/src/views/system/menuList.vue +195 -0
  109. package/template-vue-admin/src/views/system/role.vue +132 -0
  110. package/template-vue-admin/src/views/system/user.vue +193 -0
  111. package/template-vue-admin/src/vite-env.d.ts +52 -0
  112. package/template-vue-admin/tsconfig.json +21 -0
  113. package/template-vue-admin/tsconfig.node.json +9 -0
  114. package/template-vue-admin/unocss.config.ts +47 -0
  115. package/template-vue-admin/vite.config.ts +77 -0
  116. package/template-vue-thin/package.json +14 -13
  117. package/template-vue-thin/vite.config.ts +1 -6
@@ -0,0 +1,77 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2022-12-03 15:57:40
4
+ * @LastEditTime: 2023-01-05 14:14:02
5
+ * @Description:
6
+ */
7
+ import { fileURLToPath, URL } from 'node:url';
8
+ import { defineConfig, loadEnv } from 'vite';
9
+ import type { ConfigEnv, UserConfigExport } from 'vite';
10
+
11
+ import vue from '@vitejs/plugin-vue';
12
+ import vueJsx from '@vitejs/plugin-vue-jsx';
13
+ import legacy from '@vitejs/plugin-legacy';
14
+ import Unocss from 'unocss/vite';
15
+
16
+ // 自动导入
17
+ import AutoImport from 'unplugin-auto-import/vite';
18
+ import AutoComopnents from 'unplugin-vue-components/vite';
19
+ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
20
+
21
+ // 自动路由及布局
22
+ import Pages from 'vite-plugin-pages';
23
+ import Layouts from 'vite-plugin-vue-layouts';
24
+
25
+ // https://vitejs.dev/config/
26
+ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
27
+ const root = process.cwd();
28
+ const viteEnv = loadEnv(mode, root);
29
+ console.log('🚀 ~ file: vite.config.ts ~ line 36 ~ viteEnv', viteEnv);
30
+ return defineConfig({
31
+ base: './',
32
+ plugins: [
33
+ vue(),
34
+ vueJsx(),
35
+ Pages({
36
+ extensions: ['vue', 'tsx'],
37
+ dirs: 'src/views',
38
+ exclude: ['**/components/*.{vue,tsx}', '_*'],
39
+ }),
40
+ Layouts({ defaultLayout: 'default/index' }),
41
+ AutoComopnents({
42
+ dirs: ['src/components'],
43
+ dts: './src/auto-components.d.ts',
44
+ extensions: ['vue', 'tsx'],
45
+ resolvers: [ElementPlusResolver()],
46
+ }),
47
+ AutoImport({
48
+ dts: './src/auto-imports.d.ts',
49
+ imports: [
50
+ 'vue',
51
+ 'vue-router',
52
+ '@vueuse/core',
53
+ 'pinia',
54
+ {
55
+ 'element-plus': ['ElMessage', 'ElMessageBox', 'ElLoadingService'],
56
+ },
57
+ ],
58
+ }),
59
+ Unocss(),
60
+ legacy({
61
+ // 不生成同名 polyfill 文件,打包速度翻倍,如果出现兼容问题,可以删除此配置
62
+ // renderLegacyChunks: false
63
+ }),
64
+ ],
65
+ resolve: {
66
+ alias: {
67
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
68
+ },
69
+ },
70
+ server: {
71
+ host: true,
72
+ proxy: {
73
+ '/api': 'http://192.168.10.168:3000',
74
+ },
75
+ },
76
+ });
77
+ };
@@ -13,27 +13,28 @@
13
13
  "dependencies": {
14
14
  "@vueuse/core": "^9.4.0",
15
15
  "core-js": "^3.26.0",
16
- "regenerator-runtime": "^0.13.10",
17
16
  "pinia": "^2.0.23",
17
+ "regenerator-runtime": "^0.13.10",
18
18
  "vue": "^3.2.41",
19
19
  "vue-router": "^4.1.6"
20
20
  },
21
21
  "devDependencies": {
22
- "@vitejs/plugin-vue-jsx": "^2.1.0",
23
- "@vitejs/plugin-vue": "^3.2.0",
24
- "typescript": "^4.8.4",
25
- "@unocss/reset": "^0.46.3",
26
- "@vitejs/plugin-legacy": "^2.3.0",
27
- "unocss": "^0.46.3",
22
+ "@types/node": "16",
23
+ "@unocss/reset": "^0.48.0",
24
+ "@vitejs/plugin-legacy": "^3.0.1",
25
+ "@vitejs/plugin-vue": "^4.0.0",
26
+ "@vitejs/plugin-vue-jsx": "^3.0.0",
28
27
  "bumpp": "^8.2.1",
29
28
  "changelogen": "^0.4.0",
30
29
  "less": "^4.1.3",
31
- "rome": "^10.0.1",
30
+ "rome": "^11.0.0",
32
31
  "terser": "^5.15.1",
33
- "unplugin-auto-import": "^0.11.4",
32
+ "typescript": "^4.8.4",
33
+ "unocss": "^0.48.0",
34
+ "unplugin-auto-import": "^0.12.1",
34
35
  "unplugin-vue-components": "^0.22.9",
35
- "vite-plugin-pages": "^0.27.1",
36
- "vite-plugin-vue-layouts": "^0.7.0",
37
- "vite": "^3.2.3"
36
+ "vite": "^4.0.4",
37
+ "vite-plugin-pages": "^0.28.0",
38
+ "vite-plugin-vue-layouts": "^0.7.0"
38
39
  }
39
- }
40
+ }
@@ -44,12 +44,7 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
44
44
  }),
45
45
  AutoImport({
46
46
  dts: './src/auto-imports.d.ts',
47
- imports: [
48
- 'vue',
49
- 'vue-router',
50
- '@vueuse/core',
51
- 'pinia'
52
- ],
47
+ imports: ['vue', 'vue-router', '@vueuse/core', 'pinia'],
53
48
  }),
54
49
  Unocss(),
55
50
  legacy({