@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.
- package/package.json +1 -1
- package/template-mobile-ts/README.md +1 -16
- package/template-mobile-ts/build/plugin/index.ts +13 -1
- package/template-mobile-ts/build/script/postBuild.ts +15 -0
- package/template-mobile-ts/package.json +12 -5
- package/template-mobile-ts/postcss.config.js +5 -8
- package/template-mobile-ts/src/components/PageContainer/index.tsx +1 -0
- package/template-mobile-ts/src/core/vant-design/index.ts +0 -5
- package/template-mobile-ts/src/hooks/web/usePageLoading.ts +5 -8
- package/template-mobile-ts/src/main.ts +3 -1
- package/template-mobile-ts/src/{views → pages}/home.vue +1 -12
- package/template-mobile-ts/src/router/index.ts +3 -4
- package/template-mobile-ts/src/router/routes.ts +1 -1
- package/template-mobile-ts/src/settings/index.ts +10 -0
- package/template-mobile-ts/src/store/modules/global.ts +1 -4
- package/template-mobile-ts/src/utils/cryptoJS.ts +31 -17
- package/template-mobile-ts/src/utils/{index.ts → env.ts} +1 -1
- package/template-mobile-ts/src/utils/request/XHR.ts +131 -0
- package/template-mobile-ts/src/utils/request/axiosCancel.ts +60 -0
- package/template-mobile-ts/src/utils/request/checkStatus.ts +11 -0
- package/template-mobile-ts/src/utils/request/index.ts +143 -0
- package/template-mobile-ts/src/utils/request/typings.ts +114 -0
- package/template-mobile-ts/src/utils/storage.ts +191 -0
- package/template-mobile-ts/src/utils/validate.ts +0 -264
- package/template-mobile-ts/types/global.d.ts +16 -0
- package/template-mobile-ts/vite.config.ts +16 -2
- package/template-mobile-ts/pnpm-lock.yaml +0 -3890
- package/template-mobile-ts/src/utils/request.ts +0 -105
- package/template-vue-ts/.vscode/extensions.json +0 -3
- package/template-vue-ts/README.md +0 -18
- package/template-vue-ts/index.html +0 -13
- package/template-vue-ts/package.json +0 -20
- package/template-vue-ts/public/vite.svg +0 -1
- package/template-vue-ts/src/App.vue +0 -30
- package/template-vue-ts/src/assets/vue.svg +0 -1
- package/template-vue-ts/src/components/HelloWorld.vue +0 -38
- package/template-vue-ts/src/main.ts +0 -5
- package/template-vue-ts/src/style.css +0 -81
- package/template-vue-ts/src/vite-env.d.ts +0 -1
- package/template-vue-ts/tsconfig.json +0 -18
- package/template-vue-ts/tsconfig.node.json +0 -9
- 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: '
|
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',
|