@gx-design-vue/create-gx-cli 0.0.1 → 0.0.2

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 (42) hide show
  1. package/package.json +1 -1
  2. package/template-mobile-ts/README.md +1 -16
  3. package/template-mobile-ts/build/plugin/index.ts +13 -1
  4. package/template-mobile-ts/build/script/postBuild.ts +15 -0
  5. package/template-mobile-ts/package.json +12 -5
  6. package/template-mobile-ts/postcss.config.js +5 -8
  7. package/template-mobile-ts/src/components/PageContainer/index.tsx +1 -0
  8. package/template-mobile-ts/src/core/vant-design/index.ts +0 -5
  9. package/template-mobile-ts/src/hooks/web/usePageLoading.ts +5 -8
  10. package/template-mobile-ts/src/main.ts +3 -1
  11. package/template-mobile-ts/src/{views → pages}/home.vue +1 -12
  12. package/template-mobile-ts/src/router/index.ts +3 -4
  13. package/template-mobile-ts/src/router/routes.ts +1 -1
  14. package/template-mobile-ts/src/settings/index.ts +10 -0
  15. package/template-mobile-ts/src/store/modules/global.ts +1 -4
  16. package/template-mobile-ts/src/utils/cryptoJS.ts +31 -17
  17. package/template-mobile-ts/src/utils/{index.ts → env.ts} +1 -1
  18. package/template-mobile-ts/src/utils/request/XHR.ts +131 -0
  19. package/template-mobile-ts/src/utils/request/axiosCancel.ts +60 -0
  20. package/template-mobile-ts/src/utils/request/checkStatus.ts +11 -0
  21. package/template-mobile-ts/src/utils/request/index.ts +143 -0
  22. package/template-mobile-ts/src/utils/request/typings.ts +114 -0
  23. package/template-mobile-ts/src/utils/storage.ts +191 -0
  24. package/template-mobile-ts/src/utils/validate.ts +0 -264
  25. package/template-mobile-ts/types/global.d.ts +16 -0
  26. package/template-mobile-ts/vite.config.ts +16 -2
  27. package/template-mobile-ts/pnpm-lock.yaml +0 -3890
  28. package/template-mobile-ts/src/utils/request.ts +0 -105
  29. package/template-vue-ts/.vscode/extensions.json +0 -3
  30. package/template-vue-ts/README.md +0 -18
  31. package/template-vue-ts/index.html +0 -13
  32. package/template-vue-ts/package.json +0 -20
  33. package/template-vue-ts/public/vite.svg +0 -1
  34. package/template-vue-ts/src/App.vue +0 -30
  35. package/template-vue-ts/src/assets/vue.svg +0 -1
  36. package/template-vue-ts/src/components/HelloWorld.vue +0 -38
  37. package/template-vue-ts/src/main.ts +0 -5
  38. package/template-vue-ts/src/style.css +0 -81
  39. package/template-vue-ts/src/vite-env.d.ts +0 -1
  40. package/template-vue-ts/tsconfig.json +0 -18
  41. package/template-vue-ts/tsconfig.node.json +0 -9
  42. package/template-vue-ts/vite.config.ts +0 -7
@@ -1,6 +1,22 @@
1
1
  import type { PropType as VuePropType } from 'vue'
2
2
 
3
3
  declare global {
4
+ const __APP_INFO__: {
5
+ pkg: {
6
+ name: string;
7
+ version: string;
8
+ dependencies: Recordable<string>;
9
+ devDependencies: Recordable<string>;
10
+ };
11
+ lastBuildTime: string;
12
+ }
13
+
14
+ declare type LocalResult = {
15
+ value: any;
16
+ time: string;
17
+ expired: number;
18
+ }
19
+
4
20
  declare type PropType<T> = VuePropType<T>;
5
21
 
6
22
  declare type RecordType<T = string, K = any> = Record<string, any>;
@@ -1,10 +1,20 @@
1
1
  import type { UserConfig, ConfigEnv, ProxyOptions } from 'vite'
2
2
  import { loadEnv } from 'vite'
3
3
  import { resolve } from 'path'
4
+ import dayjs from 'dayjs'
4
5
 
5
6
  import { configManualChunk } from './build/optimizer'
6
7
  import { createVitePlugins } from './build/plugin'
7
8
 
9
+ import pkg from './package.json'
10
+
11
+ const { dependencies, devDependencies, name, version } = pkg
12
+
13
+ const __APP_INFO__ = {
14
+ pkg: { dependencies, devDependencies, name, version },
15
+ lastBuildTime: dayjs().format('YYYY-MM-DD HH:mm:ss')
16
+ }
17
+
8
18
  function pathResolve(dir: string) {
9
19
  return resolve(process.cwd(), '.', dir)
10
20
  }
@@ -12,10 +22,10 @@ function pathResolve(dir: string) {
12
22
  function createProxy(prefix) {
13
23
  const ret: RecordType = {}
14
24
  const proxy: ProxyOptions = {
15
- target: 'http://127.0.0.1:3000',
25
+ target: 'https://127.0.0.1',
16
26
  changeOrigin: true,
17
27
  ws: true,
18
- rewrite: (path) => path.replace(new RegExp(`^${prefix}`), '')
28
+ rewrite: (path) => path.replace(new RegExp(`^${prefix}`), `${prefix}`)
19
29
  }
20
30
  ret[prefix] = proxy
21
31
  return ret
@@ -71,6 +81,10 @@ export default ({ mode, command }: ConfigEnv): UserConfig => {
71
81
  proxy: createProxy(VITE_BASE_URL)
72
82
  },
73
83
  plugins: createVitePlugins(viteEnv, isBuild),
84
+ define: {
85
+ __INTLIFY_PROD_DEVTOOLS__: false,
86
+ __APP_INFO__: JSON.stringify(__APP_INFO__)
87
+ },
74
88
  build: {
75
89
  assetsDir: 'assets',
76
90
  target: 'es2015',