@gx-design-vue/create-gx-cli 0.1.12 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. package/bin/create-gx-cli +3 -2
  2. package/package.json +4 -4
  3. package/src/cli.js +9 -7
  4. package/src/git.js +8 -5
  5. package/src/main.js +29 -16
  6. package/template-mobile-vant-cli/package.json +5 -5
  7. package/template-gx-design-thin/.editorconfig +0 -19
  8. package/template-gx-design-thin/.env +0 -4
  9. package/template-gx-design-thin/.env.development +0 -15
  10. package/template-gx-design-thin/.env.production +0 -28
  11. package/template-gx-design-thin/.eslintignore +0 -16
  12. package/template-gx-design-thin/.prettierignore +0 -9
  13. package/template-gx-design-thin/LICENSE +0 -21
  14. package/template-gx-design-thin/README.md +0 -112
  15. package/template-gx-design-thin/build/constant.ts +0 -1
  16. package/template-gx-design-thin/build/generate/generateModifyVars.ts +0 -14
  17. package/template-gx-design-thin/build/rollupOptions/index.ts +0 -22
  18. package/template-gx-design-thin/build/util/hash.ts +0 -17
  19. package/template-gx-design-thin/build/util/index.ts +0 -131
  20. package/template-gx-design-thin/build/vite/cdn.ts +0 -63
  21. package/template-gx-design-thin/build/vite/optimizer.ts +0 -26
  22. package/template-gx-design-thin/build/vite/plugin/appConfig.ts +0 -91
  23. package/template-gx-design-thin/build/vite/plugin/autoImport.ts +0 -26
  24. package/template-gx-design-thin/build/vite/plugin/compress.ts +0 -31
  25. package/template-gx-design-thin/build/vite/plugin/html.ts +0 -39
  26. package/template-gx-design-thin/build/vite/plugin/index.ts +0 -75
  27. package/template-gx-design-thin/build/vite/plugin/mock.ts +0 -14
  28. package/template-gx-design-thin/build/vite/plugin/pwa.ts +0 -31
  29. package/template-gx-design-thin/build/vite/plugin/visualizer.ts +0 -14
  30. package/template-gx-design-thin/build/vite/plugin/viteMock/client.ts +0 -88
  31. package/template-gx-design-thin/build/vite/plugin/viteMock/createMockServer.ts +0 -271
  32. package/template-gx-design-thin/build/vite/plugin/viteMock/index.ts +0 -69
  33. package/template-gx-design-thin/build/vite/plugin/viteMock/types.ts +0 -48
  34. package/template-gx-design-thin/build/vite/plugin/viteMock/utils.ts +0 -48
  35. package/template-gx-design-thin/build/vite/plugin/viteNotice.ts +0 -40
  36. package/template-gx-design-thin/commitlint.config.cjs +0 -32
  37. package/template-gx-design-thin/config/default/defaultSettings.ts +0 -78
  38. package/template-gx-design-thin/config/default/network.ts +0 -10
  39. package/template-gx-design-thin/config/default/proxy.ts +0 -47
  40. package/template-gx-design-thin/config/default/theme.ts +0 -3
  41. package/template-gx-design-thin/config/index.ts +0 -11
  42. package/template-gx-design-thin/eslint.config.js +0 -51
  43. package/template-gx-design-thin/index.html +0 -42
  44. package/template-gx-design-thin/mock/_createProductionServer.ts +0 -19
  45. package/template-gx-design-thin/mock/_util.ts +0 -33
  46. package/template-gx-design-thin/mock/config/menu.ts +0 -21
  47. package/template-gx-design-thin/mock/config/user.ts +0 -123
  48. package/template-gx-design-thin/mock/datasSource/system/menu.ts +0 -10
  49. package/template-gx-design-thin/mock/datasSource/user/account.ts +0 -30
  50. package/template-gx-design-thin/mock/datasSource/user/index.ts +0 -47
  51. package/template-gx-design-thin/mock/util/crypto.ts +0 -23
  52. package/template-gx-design-thin/mock/util/table.ts +0 -92
  53. package/template-gx-design-thin/mock/util/utils.ts +0 -73
  54. package/template-gx-design-thin/package.json +0 -129
  55. package/template-gx-design-thin/pnpm-lock.yaml +0 -12575
  56. package/template-gx-design-thin/prettier.config.cjs +0 -18
  57. package/template-gx-design-thin/public/resource/css/index.css +0 -119
  58. package/template-gx-design-thin/public/resource/css/normalize.css +0 -396
  59. package/template-gx-design-thin/public/resource/img/favicon.ico +0 -0
  60. package/template-gx-design-thin/public/resource/img/logo.png +0 -0
  61. package/template-gx-design-thin/public/resource/img/pro_icon.svg +0 -1
  62. package/template-gx-design-thin/public/resource/img/pwa-192x192.png +0 -0
  63. package/template-gx-design-thin/public/resource/img/pwa-512x512.png +0 -0
  64. package/template-gx-design-thin/src/App.vue +0 -42
  65. package/template-gx-design-thin/src/assets/error_images/403.png +0 -0
  66. package/template-gx-design-thin/src/assets/error_images/404.png +0 -0
  67. package/template-gx-design-thin/src/assets/error_images/cloud.png +0 -0
  68. package/template-gx-design-thin/src/assets/login_images/login_background.svg +0 -1
  69. package/template-gx-design-thin/src/assets/logo.png +0 -0
  70. package/template-gx-design-thin/src/assets/menu_font/iconfont.css +0 -94
  71. package/template-gx-design-thin/src/assets/menu_font/iconfont.eot +0 -0
  72. package/template-gx-design-thin/src/assets/menu_font/iconfont.js +0 -1
  73. package/template-gx-design-thin/src/assets/menu_font/iconfont.json +0 -142
  74. package/template-gx-design-thin/src/assets/menu_font/iconfont.svg +0 -1
  75. package/template-gx-design-thin/src/assets/menu_font/iconfont.ttf +0 -0
  76. package/template-gx-design-thin/src/assets/menu_font/iconfont.woff +0 -0
  77. package/template-gx-design-thin/src/assets/menu_font/iconfont.woff2 +0 -0
  78. package/template-gx-design-thin/src/assets/menu_font/index.less +0 -94
  79. package/template-gx-design-thin/src/assets/public_icon/iconfont.css +0 -42
  80. package/template-gx-design-thin/src/assets/public_icon/iconfont.eot +0 -0
  81. package/template-gx-design-thin/src/assets/public_icon/iconfont.js +0 -1
  82. package/template-gx-design-thin/src/assets/public_icon/iconfont.json +0 -51
  83. package/template-gx-design-thin/src/assets/public_icon/iconfont.svg +0 -1
  84. package/template-gx-design-thin/src/assets/public_icon/iconfont.ttf +0 -0
  85. package/template-gx-design-thin/src/assets/public_icon/iconfont.woff +0 -0
  86. package/template-gx-design-thin/src/assets/public_icon/iconfont.woff2 +0 -0
  87. package/template-gx-design-thin/src/assets/public_icon/index.less +0 -42
  88. package/template-gx-design-thin/src/assets/public_images/nodata.svg +0 -1
  89. package/template-gx-design-thin/src/common/global.ts +0 -4
  90. package/template-gx-design-thin/src/components/GDesign/Result/index.tsx +0 -144
  91. package/template-gx-design-thin/src/components/GDesign/Result/style.less +0 -140
  92. package/template-gx-design-thin/src/components/GDesign/utils/index.ts +0 -7
  93. package/template-gx-design-thin/src/components/GlobalLayout/Confirm/index.ts +0 -21
  94. package/template-gx-design-thin/src/components/GlobalLayout/Empty/index.vue +0 -18
  95. package/template-gx-design-thin/src/components/GlobalLayout/RightContent/index.tsx +0 -126
  96. package/template-gx-design-thin/src/components/GlobalLayout/RightContent/style.ts +0 -77
  97. package/template-gx-design-thin/src/components/GlobalLayout/Spin/index.tsx +0 -30
  98. package/template-gx-design-thin/src/components/PageLoading/index.tsx +0 -51
  99. package/template-gx-design-thin/src/components/index.ts +0 -6
  100. package/template-gx-design-thin/src/core/ant-design/index.ts +0 -10
  101. package/template-gx-design-thin/src/core/gx-admin-design/index.ts +0 -6
  102. package/template-gx-design-thin/src/core/gx-design/index.ts +0 -6
  103. package/template-gx-design-thin/src/core/gx-pro-design/index.ts +0 -8
  104. package/template-gx-design-thin/src/core/index.ts +0 -84
  105. package/template-gx-design-thin/src/design/ant-design/index.less +0 -4
  106. package/template-gx-design-thin/src/design/ant-design/layout.less +0 -22
  107. package/template-gx-design-thin/src/design/ant-design/menu.less +0 -48
  108. package/template-gx-design-thin/src/design/ant-design/spin.less +0 -23
  109. package/template-gx-design-thin/src/design/ant-design/tooltip.less +0 -7
  110. package/template-gx-design-thin/src/design/color.less +0 -1
  111. package/template-gx-design-thin/src/design/config.less +0 -5
  112. package/template-gx-design-thin/src/design/imageEditor.less +0 -180
  113. package/template-gx-design-thin/src/design/index.less +0 -95
  114. package/template-gx-design-thin/src/design/mixin.less +0 -65
  115. package/template-gx-design-thin/src/design/normalize.less +0 -391
  116. package/template-gx-design-thin/src/design/root.less +0 -3
  117. package/template-gx-design-thin/src/hooks/core/index.ts +0 -3
  118. package/template-gx-design-thin/src/hooks/core/useRequest/index.ts +0 -118
  119. package/template-gx-design-thin/src/hooks/event/index.ts +0 -3
  120. package/template-gx-design-thin/src/hooks/event/useClipboard.ts +0 -15
  121. package/template-gx-design-thin/src/hooks/web/index.ts +0 -5
  122. package/template-gx-design-thin/src/hooks/web/useThemeStyle.ts +0 -16
  123. package/template-gx-design-thin/src/layout/BasicLayout.vue +0 -123
  124. package/template-gx-design-thin/src/layout/BlankLayout.vue +0 -5
  125. package/template-gx-design-thin/src/layout/ContentView.vue +0 -50
  126. package/template-gx-design-thin/src/layout/IframeView.vue +0 -1
  127. package/template-gx-design-thin/src/layout/UserLayout.vue +0 -7
  128. package/template-gx-design-thin/src/main.ts +0 -34
  129. package/template-gx-design-thin/src/plugins/index.ts +0 -2
  130. package/template-gx-design-thin/src/router/guard/index.ts +0 -83
  131. package/template-gx-design-thin/src/router/guard/permissions.ts +0 -70
  132. package/template-gx-design-thin/src/router/guard/stateGuard.ts +0 -10
  133. package/template-gx-design-thin/src/router/helper/routeHelper.ts +0 -223
  134. package/template-gx-design-thin/src/router/helper/utils.ts +0 -19
  135. package/template-gx-design-thin/src/router/index.ts +0 -31
  136. package/template-gx-design-thin/src/router/routes/index.ts +0 -86
  137. package/template-gx-design-thin/src/router/routes/modules/dataSource.ts +0 -12
  138. package/template-gx-design-thin/src/services/common/index.ts +0 -11
  139. package/template-gx-design-thin/src/services/systemCenter/index.ts +0 -1
  140. package/template-gx-design-thin/src/services/systemCenter/menu.ts +0 -9
  141. package/template-gx-design-thin/src/services/userCenter/account.ts +0 -42
  142. package/template-gx-design-thin/src/services/userCenter/index.ts +0 -28
  143. package/template-gx-design-thin/src/store/index.ts +0 -32
  144. package/template-gx-design-thin/src/store/modules/dict.ts +0 -28
  145. package/template-gx-design-thin/src/store/modules/global.ts +0 -42
  146. package/template-gx-design-thin/src/store/modules/permission.ts +0 -19
  147. package/template-gx-design-thin/src/store/modules/routes.ts +0 -113
  148. package/template-gx-design-thin/src/store/modules/tabsRouter.ts +0 -76
  149. package/template-gx-design-thin/src/store/modules/user.ts +0 -136
  150. package/template-gx-design-thin/src/utils/accessToken.ts +0 -80
  151. package/template-gx-design-thin/src/utils/crypto/base64.ts +0 -101
  152. package/template-gx-design-thin/src/utils/crypto/index.ts +0 -57
  153. package/template-gx-design-thin/src/utils/env.ts +0 -50
  154. package/template-gx-design-thin/src/utils/fetchFile.ts +0 -81
  155. package/template-gx-design-thin/src/utils/index.ts +0 -123
  156. package/template-gx-design-thin/src/utils/pageTitle.ts +0 -20
  157. package/template-gx-design-thin/src/utils/request/XHR.ts +0 -139
  158. package/template-gx-design-thin/src/utils/request/axiosCancel.ts +0 -69
  159. package/template-gx-design-thin/src/utils/request/checkStatus.ts +0 -25
  160. package/template-gx-design-thin/src/utils/request/index.ts +0 -144
  161. package/template-gx-design-thin/src/utils/request/typings.ts +0 -171
  162. package/template-gx-design-thin/src/utils/storage.ts +0 -199
  163. package/template-gx-design-thin/src/utils/uploadFile.ts +0 -27
  164. package/template-gx-design-thin/src/utils/util.ts +0 -198
  165. package/template-gx-design-thin/src/utils/validate.ts +0 -216
  166. package/template-gx-design-thin/src/views/Iframe/index.vue +0 -76
  167. package/template-gx-design-thin/src/views/Page/one.vue +0 -13
  168. package/template-gx-design-thin/src/views/Page/two.vue +0 -13
  169. package/template-gx-design-thin/src/views/exception/403/index.vue +0 -7
  170. package/template-gx-design-thin/src/views/exception/404/index.vue +0 -9
  171. package/template-gx-design-thin/src/views/user/login/index.vue +0 -109
  172. package/template-gx-design-thin/src/views/user/login/style.less +0 -38
  173. package/template-gx-design-thin/tsconfig.json +0 -46
  174. package/template-gx-design-thin/types/ant-design-import.d.ts +0 -99
  175. package/template-gx-design-thin/types/auto-imports.d.ts +0 -81
  176. package/template-gx-design-thin/types/components.d.ts +0 -24
  177. package/template-gx-design-thin/types/config.d.ts +0 -44
  178. package/template-gx-design-thin/types/global.d.ts +0 -97
  179. package/template-gx-design-thin/types/mock.d.ts +0 -16
  180. package/template-gx-design-thin/types/module.d.ts +0 -20
  181. package/template-gx-design-thin/types/response.d.ts +0 -15
  182. package/template-gx-design-thin/unocss.config.ts +0 -101
  183. package/template-gx-design-thin/vite.config.ts +0 -120
  184. package/template-gx-design-thin/yarn.lock +0 -9492
package/bin/create-gx-cli CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require = require('esm')(module /*, options*/);
4
- require('../src/cli.js').cli();
3
+ import { cli } from '../src/cli.js'
4
+
5
+ cli()
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@gx-design-vue/create-gx-cli",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "license": "MIT",
5
+ "type": "module",
5
6
  "description": "a cli to bootstrap gx project",
6
- "main": "src/index.js",
7
+ "main": "bin/create-gx-cli",
7
8
  "bin": "bin/create-gx-cli",
8
9
  "publishConfig": {
9
10
  "access": "public"
@@ -16,7 +17,6 @@
16
17
  "dependencies": {
17
18
  "chalk": "^2.4.2",
18
19
  "child_process": "^1.0.2",
19
- "esm": "^3.2.18",
20
20
  "execa": "^8.0.1",
21
21
  "inquirer": "^6.2.2",
22
22
  "kolorist": "^1.6.0",
@@ -25,7 +25,7 @@
25
25
  "nanospinner": "^1.1.0",
26
26
  "ncp": "^2.0.0",
27
27
  "prompts": "^2.4.1",
28
- "rimraf": "^3.0.2"
28
+ "rimraf": "^6.0.1"
29
29
  },
30
30
  "files": [
31
31
  "bin/",
package/src/cli.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import chalk from 'chalk'
2
+ import fs from 'node:fs'
3
+ import path from 'node:path'
2
4
  import minimist from 'minimist'
3
5
  import prompts from 'prompts'
4
- import { yellow, reset, blue, red, green } from 'kolorist'
5
- import { createProject } from './main'
6
+ import { blue, green, red, reset, yellow } from 'kolorist'
7
+ import { createProject } from './main.js'
6
8
 
7
- import pag from '../package.json'
8
-
9
- const { version } = pag
9
+ let packageJSON = fs.readFileSync(path.join('../package.json'), 'utf-8')
10
+ packageJSON = JSON.parse(packageJSON)
11
+ const { version } = packageJSON
10
12
 
11
13
  const defaultTargetDir = 'vue3-project'
12
14
 
@@ -16,7 +18,7 @@ const FRAMEWORKS = [
16
18
  color: red
17
19
  },
18
20
  {
19
- name: 'gx-design-thin',
21
+ name: 'gx-design-pro-thin',
20
22
  color: blue
21
23
  },
22
24
  {
@@ -30,7 +32,7 @@ const FRAMEWORKS = [
30
32
  ]
31
33
 
32
34
  const TEMPLATES = FRAMEWORKS.map(
33
- (f) => (f.variants && f.variants.map((v) => v.name)) || [f.name]
35
+ f => (f.variants && f.variants.map(v => v.name)) || [f.name]
34
36
  ).reduce((a, b) => a.concat(b), [])
35
37
 
36
38
  function formatTargetDir(targetDir) {
package/src/git.js CHANGED
@@ -1,5 +1,6 @@
1
+ // eslint-disable-next-line unicorn/prefer-node-protocol
1
2
  import { spawn } from 'child_process'
2
- import rimraf from 'rimraf'
3
+ import { rimraf } from 'rimraf'
3
4
 
4
5
  function git(opts) {
5
6
  return opts.git || 'git'
@@ -10,7 +11,7 @@ function buildCloneCommand(repo, targetPath, opts) {
10
11
  const userArgs = opts.args || []
11
12
 
12
13
  if (opts.shallow) {
13
- if (userArgs.indexOf('--depth') >= 0) {
14
+ if (userArgs.includes('--depth')) {
14
15
  throw new Error('\'--depth\' cannot be specified when shallow is set to \'true\'')
15
16
  }
16
17
  args.push('--depth', '1')
@@ -40,11 +41,13 @@ export function clone(repo, targetPath, opts, onSuccess, onError) {
40
41
  if (line.match(/Receiving objects:\s+(\d+)%/)) {
41
42
  opts.progress({
42
43
  phase: 'receivingObjects',
44
+ // eslint-disable-next-line regexp/no-legacy-features
43
45
  percent: Number(RegExp.$1)
44
46
  })
45
47
  } else if (line.match(/Resolving deltas:\s+(\d+)%/)) {
46
48
  opts.progress({
47
49
  phase: 'resolvingDeltas',
50
+ // eslint-disable-next-line regexp/no-legacy-features
48
51
  percent: Number(RegExp.$1)
49
52
  })
50
53
  }
@@ -52,11 +55,11 @@ export function clone(repo, targetPath, opts, onSuccess, onError) {
52
55
  }
53
56
 
54
57
  proc.on('close', (status) => {
55
- if (status == 0) {
58
+ if (status === 0) {
56
59
  if (opts.checkout) {
57
60
  _checkout()
58
61
  } else {
59
- rimraf(`${targetPath}/.git`, () => {})
62
+ rimraf(`${targetPath}/.git`)
60
63
  onSuccess()
61
64
  }
62
65
  } else {
@@ -68,7 +71,7 @@ export function clone(repo, targetPath, opts, onSuccess, onError) {
68
71
  const [ cmd, args ] = buildCheckoutCommand(opts.checkout, opts)
69
72
  const proc = spawn(cmd, args, { cwd: targetPath })
70
73
  proc.on('close', function (status) {
71
- if (status == 0) {
74
+ if (status === 0) {
72
75
  onSuccess()
73
76
  } else {
74
77
  onError(new Error('\'git checkout\' failed with status ' + status))
package/src/main.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import chalk from 'chalk'
2
- import fs from 'fs'
2
+ import fs from 'node:fs'
3
3
  import { reset } from 'kolorist'
4
4
  import prompts from 'prompts'
5
- import { fileURLToPath } from 'url'
5
+ import { fileURLToPath } from 'node:url'
6
6
  import Listr from 'listr'
7
7
  import ncp from 'ncp'
8
- import path from 'path'
9
- import { promisify } from 'util'
8
+ import path from 'node:path'
9
+ import { promisify } from 'node:util'
10
10
  import { createSpinner } from 'nanospinner'
11
- import { clone } from './git'
11
+ import { clone } from './git.js'
12
12
 
13
13
  const copy = promisify(ncp)
14
14
 
@@ -18,11 +18,24 @@ const gitRepositoryList = [
18
18
  children: [
19
19
  {
20
20
  name: 'Gitee',
21
- url: 'https://gitee.com/gx12358/vue3-antd-admin.git',
21
+ url: 'https://gitee.com/gx12358/vue3-antd-admin.git'
22
22
  },
23
23
  {
24
24
  name: 'Github',
25
- url: 'https://github.com/gx12358/vue3-antd-admin.git',
25
+ url: 'https://github.com/gx12358/vue3-antd-admin.git'
26
+ }
27
+ ]
28
+ },
29
+ {
30
+ name: 'gx-design-pro-thin',
31
+ children: [
32
+ {
33
+ name: 'Gitee',
34
+ url: 'https://github.com/gx12358/vue3-antd-admin-thin.git'
35
+ },
36
+ {
37
+ name: 'Github',
38
+ url: 'https://github.com/gx12358/vue3-antd-admin-thin.git'
26
39
  }
27
40
  ]
28
41
  }
@@ -33,9 +46,9 @@ async function copyTemplateFiles(templateDir, root) {
33
46
  return copy(templateDir, root, {
34
47
  clobber: false,
35
48
  filter: (sourcePath) => {
36
- const relativePath = path.relative(templateDir, sourcePath);
37
- const folders = relativePath.split(path.sep);
38
- const folderToCheck = folders.length > 1 ? folders[1] : folders[0];
49
+ const relativePath = path.relative(templateDir, sourcePath)
50
+ const folders = relativePath.split(path.sep)
51
+ const folderToCheck = folders.length > 1 ? folders[1] : folders[0]
39
52
  return !exclusions.includes(folderToCheck)
40
53
  }
41
54
  })
@@ -89,7 +102,7 @@ function download(url, root, projectName) {
89
102
  text: '项目创建成功,请依次执行以下命令'
90
103
  })
91
104
  doneLog(process.cwd(), root)
92
- },async function (err) {
105
+ }, async function (err) {
93
106
  console.log(err)
94
107
  spinner.error({ text: '下载失败' })
95
108
  })
@@ -117,7 +130,7 @@ export async function createProject(options) {
117
130
  }
118
131
  }
119
132
 
120
- //目录是否已经存在
133
+ // 目录是否已经存在
121
134
  const dirIsExists = fs.existsSync(root)
122
135
 
123
136
  if (dirIsExists) {
@@ -139,7 +152,7 @@ export async function createProject(options) {
139
152
  }
140
153
  })
141
154
  }
142
- ]).then(answers => {
155
+ ]).then((answers) => {
143
156
  if (answers.url) download(answers.url, root, options.projectName)
144
157
  })
145
158
  } else if (downloadGit.url) {
@@ -150,7 +163,7 @@ export async function createProject(options) {
150
163
  {
151
164
  title: '项目创建',
152
165
  task: () => copyTemplateFiles(templateDir, root)
153
- },
166
+ }
154
167
  ]
155
168
  if (options.template !== 'mobile-vant-html') {
156
169
  listr.push({
@@ -158,7 +171,8 @@ export async function createProject(options) {
158
171
  task: () => editPackageJson(root, options.projectName || getProjectName(options.projectName))
159
172
  })
160
173
  }
161
- const tasks = new Listr(listr,
174
+ const tasks = new Listr(
175
+ listr,
162
176
  {
163
177
  exitOnError: false
164
178
  }
@@ -170,7 +184,6 @@ export async function createProject(options) {
170
184
  doneLog(cwd, root)
171
185
  } else {
172
186
  console.log(chalk.blueBright(`init success`))
173
-
174
187
  }
175
188
  }
176
189
  return true
@@ -10,8 +10,8 @@
10
10
  "preview": "vite preview"
11
11
  },
12
12
  "dependencies": {
13
- "@gx-design-vue/pro-hooks": "^0.2.0-beta.19",
14
- "@gx-design-vue/pro-utils": "^0.2.0-beta.27",
13
+ "@gx-design-vue/pro-hooks": "^0.2.0-beta.20",
14
+ "@gx-design-vue/pro-utils": "^0.2.0-beta.28",
15
15
  "@vueuse/core": "^10.7.2",
16
16
  "@vueuse/shared": "^10.7.2",
17
17
  "axios": "^1.6.7",
@@ -21,7 +21,8 @@
21
21
  "pinia": "2.1.7",
22
22
  "qs": "^6.11.0",
23
23
  "vant": "^4.8.8",
24
- "vue": "^3.3.7",
24
+ "unocss": "^0.58.5",
25
+ "vue": "^3.5.0",
25
26
  "vue-router": "^4.1.6"
26
27
  },
27
28
  "devDependencies": {
@@ -33,7 +34,6 @@
33
34
  "@vitejs/plugin-vue": "^5.0.4",
34
35
  "@vitejs/plugin-vue-jsx": "^3.1.0",
35
36
  "autoprefixer": "^10.4.13",
36
- "unocss": "^0.58.5",
37
37
  "mockjs": "^1.1.0",
38
38
  "cross-env": "^7.0.3",
39
39
  "connect": "^3.7.0",
@@ -54,4 +54,4 @@
54
54
  "vite-plugin-vue-setup-extend": "^0.4.0",
55
55
  "vue-tsc": "^1.8.27"
56
56
  }
57
- }
57
+ }
@@ -1,19 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset=utf-8
5
- end_of_line=lf
6
- insert_final_newline=true
7
- indent_style=space
8
- indent_size=2
9
- max_line_length = 100
10
-
11
- [*.{yml,yaml,json}]
12
- indent_style = space
13
- indent_size = 2
14
-
15
- [*.md]
16
- trim_trailing_whitespace = false
17
-
18
- [Makefile]
19
- indent_style = tab
@@ -1,4 +0,0 @@
1
- VITE_HOME_PAGE=https://gx12358.cn
2
- VITE_HOME_PAGE_DOC=https://gx12358.cn/doc
3
- VITE_GITHUB_PAGE=https://github.com/gx12358/vue3-antd-admin
4
- VITE_GITEE_PAGE=https://gitee.com/gx12358/vue3-antd-admin
@@ -1,15 +0,0 @@
1
- # 实际执行环境 development
2
- VITE_NODE_ENV= development
3
-
4
- # environment 代码环境
5
- VITE_USE_MODE = development
6
-
7
- # 是否开启mock
8
- VITE_USE_MOCK = true
9
-
10
- # 是否删除console
11
- VITE_DROP_CONSOLE = false
12
-
13
- # api前缀
14
- VITE_BASE_URL=/api
15
-
@@ -1,28 +0,0 @@
1
- # 项目启动执行环境
2
- VITE_NODE_ENV= production
3
-
4
- # 代码运行环境
5
- VITE_USE_MODE = production
6
-
7
- # 是否开启mock
8
- VITE_USE_MOCK = true
9
-
10
- # 是否删除console
11
- VITE_DROP_CONSOLE = false
12
-
13
- # Whether to enable gzip or brotli compression
14
- # Optional: gzip | brotli | none
15
- # If you need multiple forms, you can use `,` to separate
16
- VITE_BUILD_COMPRESS = 'none'
17
-
18
- # 使用压缩时是否删除源文件,默认为false
19
- VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
20
-
21
- # 是否使用pwa
22
- VITE_USE_PWA = false
23
-
24
- # 是否为打包后的文件提供传统浏览器兼容性支持
25
- VITE_LEGACY = false
26
-
27
- # api前缀
28
- VITE_BASE_URL=/mock-server
@@ -1,16 +0,0 @@
1
-
2
- *.sh
3
- node_modules
4
- *.md
5
- *.woff
6
- *.ttf
7
- .vscode
8
- .idea
9
- dist
10
- /public
11
- /docs
12
- .husky
13
- .local
14
- .history
15
- /bin
16
- Dockerfile
@@ -1,9 +0,0 @@
1
- /dist/*
2
- .local
3
- .output.js
4
- /node_modules/**
5
-
6
- **/*.svg
7
- **/*.sh
8
-
9
- /public/*
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 gx12358
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,112 +0,0 @@
1
- <div align="center"> <a href="https://github.com/gx12358/vue3-antd-admin"> <img alt="VbenAdmin Logo" width="200" src="https://gx12358.cn/resource/img/favicon.ico"> </a> <br> <br>
2
-
3
- <h1>GX Pro Admin(Ant Design Vue)</h1>
4
- </div>
5
-
6
- ## 简介
7
-
8
- GX Pro Admin 是一个免费开源的中后台模版。使用了最新的`vue3.0+`,`vite5`,`TypeScript`, `Ant Design Vue4.0+`, `Unocss`等主流技术开发,开箱即用的中后台前端解决方案,也可用于学习参考。
9
- 如果大家喜欢的话,给个start!
10
-
11
- ## 特性
12
-
13
- - **最新技术栈**:使用 Vue3、vite5、ant-design-vue4、unocss 等前端前沿技术开发
14
- - **TypeScript**: 应用程序级 JavaScript 的语言
15
- - **主题**:可配置定制化的主题
16
- - **Mock 数据** 内置 Mock 数据方案
17
- - **权限** 内置完善的动态路由权限生成方案
18
- - **组件** 二次封装了多个pro企业级的组件
19
-
20
- ## 预览
21
-
22
- - [🚀 pro 版演示地址](https://gx12358.cn/)
23
- 测试账号: admin/gx.design
24
-
25
- - [🚀 系统文档地址](https://gx12358.cn/doc/)
26
- - [🚀 pro 组件文档地址](https://gx12358.cn/procomponents/)
27
-
28
-
29
- ## 准备
30
-
31
- - [node](http://nodejs.org/) 和 [git](https://git-scm.com/) -项目开发环境
32
- - [Vite](https://vitejs.dev/) - 熟悉 vite 特性
33
- - [Vue3](https://v3.vuejs.org/) - 熟悉 Vue 基础语法
34
- - [TypeScript](https://www.typescriptlang.org/) - 熟悉`TypeScript`基本语法
35
- - [Es6+](http://es6.ruanyifeng.com/) - 熟悉 es6 基本语法
36
- - [Vue-Router-Next](https://next.router.vuejs.org/) - 熟悉 vue-router 基本使用
37
- - [Ant-Design-Vue](https://next.antdv.com/components/overview-cn/) - ui 基本使用
38
- - [Mock.js](https://github.com/nuysoft/Mock) - mockjs 基本语法
39
-
40
- ## 安装使用
41
-
42
- - 获取项目代码
43
-
44
- ```bash
45
- git clone https://gitee.com/gx12358/vite-admin-pro
46
- ```
47
-
48
- - 安装依赖
49
-
50
- ```bash
51
- cd gx-admin-pro
52
-
53
- pnpm install
54
-
55
- ```
56
-
57
- - 运行
58
-
59
- ```bash
60
- pnpm run serve
61
- ```
62
-
63
- - 打包
64
-
65
- ```bash
66
- pnpm run build
67
- ```
68
-
69
- ## Git 贡献提交规范
70
-
71
- - 参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 规范
72
- - `feat` 增加新功能
73
- - `fix` 修复问题/BUG
74
- - `style` 代码风格相关无影响运行结果的
75
- - `perf` 优化/性能提升
76
- - `refactor` 重构
77
- - `revert` 撤销修改
78
- - `test` 测试相关
79
- - `docs` 文档/注释
80
- - `chore` 依赖更新/脚手架配置修改等
81
- - `workflow` 工作流改进
82
- - `ci` 持续集成
83
- - `types` 类型定义文件更改
84
- - `wip` 开发中
85
-
86
- ## 浏览器支持
87
-
88
- 本地开发推荐使用`Chrome 80+` 浏览器
89
-
90
- 支持现代浏览器, 不支持 IE
91
-
92
- ## 相关仓库
93
-
94
- 如果这些插件对你有帮助,可以给一个 star 支持下
95
-
96
- - [vite-plugin-html](https://github.com/anncwb/vite-plugin-html) - 用于 html 模版转换及压缩
97
- - [vite-plugin-compression](https://github.com/anncwb/vite-plugin-compression) - 用于打包输出.gz|.brotil 文件
98
- - [vite-plugin-svg-icons](https://github.com/anncwb/vite-plugin-svg-icons) - 用于快速生成 svg 雪碧图
99
-
100
- ## 维护者
101
-
102
- [@gx12358](https://github.com/gx12358/vue3-antd-admin)
103
-
104
- ## 交流
105
-
106
- `Vue3-Antd-Admin` 是完全开源免费的项目,在帮助开发者更方便地进行中大型管理系统开发,同时也提供 QQ 交流群使用问题欢迎在群内提问。
107
-
108
- - QQ 群 `871430530`
109
-
110
- ## License
111
-
112
- [MIT © gx12358-2021](./LICENSE)
@@ -1 +0,0 @@
1
- export const GLOB_CONFIG_FILE_NAME = '_app.config.js'
@@ -1,14 +0,0 @@
1
- import { resolve } from 'node:path'
2
- import { theme } from 'ant-design-vue'
3
-
4
- export function generateModifyVars() {
5
- const { defaultAlgorithm, defaultSeed } = theme
6
-
7
- const mapToken = defaultAlgorithm(defaultSeed)
8
- const modifyVarsParams = {
9
- ...mapToken,
10
- hack: `true; @import (reference) "${resolve('src/design/config.less')}";`
11
- }
12
-
13
- return modifyVarsParams
14
- }
@@ -1,22 +0,0 @@
1
- import type { RollupOptions } from 'rollup'
2
- import externalGlobals from 'rollup-plugin-external-globals'
3
- import { pathResolve } from '../util'
4
- import { configManualChunk } from '../vite/optimizer'
5
- import { getExternalMap } from '../vite/cdn'
6
-
7
- export default function (useCdn: boolean) {
8
- return {
9
- input: {
10
- index: pathResolve('index.html')
11
- },
12
- // 静态资源分类打包
13
- output: {
14
- manualChunks: configManualChunk,
15
- chunkFileNames: 'static/js/[name]-[hash].js',
16
- entryFileNames: 'static/js/[name]-[hash].js',
17
- assetFileNames: 'static/[ext]/[name]-[hash].[ext]'
18
- },
19
- external: useCdn ? Object.keys(getExternalMap()) : [],
20
- plugins: useCdn ? [ externalGlobals(getExternalMap()) ] : []
21
- } as RollupOptions
22
- }
@@ -1,17 +0,0 @@
1
- import { createHash } from 'node:crypto'
2
-
3
- function createContentHash(content: string, hashLSize = 12) {
4
- const hash = createHash('sha256').update(content)
5
- return hash.digest('hex').slice(0, hashLSize)
6
- }
7
-
8
- function strToHex(str: string) {
9
- const result: string[] = []
10
- for (let i = 0; i < str.length; ++i) {
11
- const hex = str.charCodeAt(i).toString(16)
12
- result.push((`000${hex}`).slice(-4))
13
- }
14
- return result.join('').toUpperCase()
15
- }
16
-
17
- export { createContentHash, strToHex }