@gx-design-vue/create-gx-cli 0.1.22 → 0.1.23
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-vite-project/.env +3 -0
- package/template-vite-project/eslint.config.js +58 -0
- package/template-vite-project/internal/vite/vite/plugin/index.ts +1 -26
- package/template-vite-project/internal/vite/vite/plugin/viteNotice.ts +1 -4
- package/template-vite-project/node_modules/.bin/eslint +21 -0
- package/template-vite-project/node_modules/.bin/eslint-config +21 -0
- package/template-vite-project/node_modules/.bin/vite +2 -2
- package/template-vite-project/node_modules/.vite/deps/@vueuse_core.js +8256 -0
- package/template-vite-project/node_modules/.vite/deps/@vueuse_core.js.map +1 -0
- package/template-vite-project/node_modules/.vite/deps/_metadata.json +38 -0
- package/template-vite-project/node_modules/.vite/deps/dayjs.js +308 -0
- package/template-vite-project/node_modules/.vite/deps/dayjs.js.map +1 -0
- package/template-vite-project/node_modules/.vite/deps/package.json +3 -0
- package/template-vite-project/node_modules/.vite/deps/vue-router.js +2755 -0
- package/template-vite-project/node_modules/.vite/deps/vue-router.js.map +1 -0
- package/template-vite-project/node_modules/.vite/deps/vue.js +3 -0
- package/template-vite-project/node_modules/.vite/deps/vue.runtime.esm-bundler-Czi1PEVY.js +8318 -0
- package/template-vite-project/node_modules/.vite/deps/vue.runtime.esm-bundler-Czi1PEVY.js.map +1 -0
- package/template-vite-project/package.json +5 -1
- package/template-vite-project/src/App.vue +3 -3
- package/template-vite-project/src/components/HelloWorld.vue +8 -7
- package/template-vite-project/src/design/index.less +79 -0
- package/template-vite-project/types/ant-design-import.d.ts +15 -0
- package/template-vite-project/types/auto-imports.d.ts +78 -0
- package/template-vite-project/types/global.d.ts +3 -0
- package/template-vite-project/internal/vite/vite/plugin/compress.ts +0 -31
- package/template-vite-project/internal/vite/vite/plugin/html.ts +0 -24
package/package.json
CHANGED
@@ -0,0 +1,58 @@
|
|
1
|
+
import antFuEslint from '@antfu/eslint-config'
|
2
|
+
|
3
|
+
export default antFuEslint({
|
4
|
+
vue: true,
|
5
|
+
vueJsx: true,
|
6
|
+
typescript: true,
|
7
|
+
gitignore: true,
|
8
|
+
markdown: true,
|
9
|
+
ignores: [
|
10
|
+
'src/assets/**/*.js',
|
11
|
+
'public'
|
12
|
+
]
|
13
|
+
}, {
|
14
|
+
rules: {
|
15
|
+
'no-unmodified-loop-condition': 0,
|
16
|
+
'curly': 0,
|
17
|
+
'perfectionist/sort-exports': 0,
|
18
|
+
'no-new': 0,
|
19
|
+
'vue/eqeqeq': 0,
|
20
|
+
'no-console': 0,
|
21
|
+
'vue/no-unused-refs': 0,
|
22
|
+
'no-template-curly-in-string': 0,
|
23
|
+
'vue/prop-name-casing': 0,
|
24
|
+
'vue/html-comment-content-spacing': 0,
|
25
|
+
'style/indent-binary-ops': 0,
|
26
|
+
'antfu/if-newline': 0,
|
27
|
+
'import/order': 0,
|
28
|
+
'style/quote-props': 0,
|
29
|
+
'style/brace-style': 0,
|
30
|
+
'style/comma-dangle': 0,
|
31
|
+
'style/multiline-ternary': 0,
|
32
|
+
'prefer-regex-literals': 0,
|
33
|
+
'antfu/top-level-function': 0,
|
34
|
+
'vue/array-bracket-spacing': 0,
|
35
|
+
'style/array-bracket-spacing': 0,
|
36
|
+
'node/prefer-global/process': 0,
|
37
|
+
'style/indent': 0,
|
38
|
+
'prefer-template': 0,
|
39
|
+
'dot-notation': 0,
|
40
|
+
'no-cond-assign': 0,
|
41
|
+
'no-useless-computed-key': 0,
|
42
|
+
'node/no-deprecated-api': 0,
|
43
|
+
'antfu/consistent-list-newline': 0,
|
44
|
+
'import/no-mutable-exports': 0,
|
45
|
+
'style/member-delimiter-style': 0,
|
46
|
+
'unused-imports/no-unused-imports': 0,
|
47
|
+
'eslint-comments/no-unlimited-disable': 0,
|
48
|
+
'no-async-promise-executor': 0,
|
49
|
+
'unicorn/escape-case': 0,
|
50
|
+
'ts/ban-ts-comment': 0,
|
51
|
+
'ts/prefer-ts-expect-error': 0,
|
52
|
+
'ts/method-signature-style': 0,
|
53
|
+
'style/no-trailing-spaces': 0,
|
54
|
+
'ts/consistent-type-imports': 0,
|
55
|
+
'style/type-generic-spacing': 0,
|
56
|
+
'prefer-promise-reject-errors': 0
|
57
|
+
}
|
58
|
+
})
|
@@ -4,24 +4,15 @@ import vue from '@vitejs/plugin-vue'
|
|
4
4
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
5
5
|
import Unocss from 'unocss/vite'
|
6
6
|
import TurboConsole from 'unplugin-turbo-console/vite'
|
7
|
-
import { vitePluginFakeServer } from 'vite-plugin-fake-server'
|
8
7
|
import DevTools from 'vite-plugin-vue-devtools'
|
9
8
|
|
10
9
|
import { createAppConfigPlugin } from './appConfig'
|
11
10
|
import { createAutoImport } from './autoImport'
|
12
|
-
import { configCompressPlugin } from './compress'
|
13
|
-
import { configHtmlPlugin } from './html'
|
14
11
|
import { configVisualizerConfig } from './visualizer'
|
15
12
|
import viteNotice from './viteNotice'
|
16
13
|
|
17
14
|
export async function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
|
18
|
-
const {
|
19
|
-
VITE_APP_ENV,
|
20
|
-
VITE_USE_MOCK,
|
21
|
-
VITE_LEGACY,
|
22
|
-
VITE_BUILD_COMPRESS,
|
23
|
-
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE
|
24
|
-
} = viteEnv
|
15
|
+
const { VITE_APP_ENV, VITE_LEGACY } = viteEnv
|
25
16
|
|
26
17
|
const isDev = VITE_APP_ENV === 'dev'
|
27
18
|
|
@@ -43,16 +34,8 @@ export async function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
|
|
43
34
|
isDev && vitePlugins.push(TurboConsole())
|
44
35
|
// @vitejs/plugin-legacy
|
45
36
|
VITE_LEGACY && isBuild && vitePlugins.push(legacy())
|
46
|
-
// vite-plugin-html
|
47
|
-
vitePlugins.push(configHtmlPlugin(viteEnv, isBuild))
|
48
37
|
// vite-plugin-build-info
|
49
38
|
vitePlugins.push(await viteNotice())
|
50
|
-
// vite-plugin-mock
|
51
|
-
const useMock = isDev || VITE_USE_MOCK
|
52
|
-
useMock && vitePlugins.push(vitePluginFakeServer({
|
53
|
-
include: 'mock',
|
54
|
-
enableProd: VITE_USE_MOCK
|
55
|
-
}))
|
56
39
|
|
57
40
|
// rollup-plugin-visualizer
|
58
41
|
vitePlugins.push(configVisualizerConfig())
|
@@ -60,13 +43,5 @@ export async function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
|
|
60
43
|
// unplugin-auto-import/vite
|
61
44
|
vitePlugins.push(createAutoImport())
|
62
45
|
|
63
|
-
// The following plugins only work in the production environment
|
64
|
-
if (isBuild) {
|
65
|
-
// rollup-plugin-gzip
|
66
|
-
vitePlugins.push(
|
67
|
-
configCompressPlugin(VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE)
|
68
|
-
)
|
69
|
-
}
|
70
|
-
|
71
46
|
return vitePlugins
|
72
47
|
}
|
@@ -1,11 +1,8 @@
|
|
1
1
|
import type { Plugin } from 'vite'
|
2
2
|
import chalk from 'chalk'
|
3
3
|
import { readPackageJSON } from 'pkg-types'
|
4
|
-
import { defaultSettings } from '../../../../config'
|
5
4
|
import { getPackageSize, getRootPath, rootPath } from '../../util'
|
6
5
|
|
7
|
-
const { build } = defaultSettings
|
8
|
-
|
9
6
|
export default async function viteNotice(): Promise<Plugin> {
|
10
7
|
let config: { command: string }
|
11
8
|
const { name = '' } = await readPackageJSON(rootPath)
|
@@ -29,7 +26,7 @@ export default async function viteNotice(): Promise<Plugin> {
|
|
29
26
|
closeBundle() {
|
30
27
|
if (config.command === 'build') {
|
31
28
|
getPackageSize({
|
32
|
-
folder: getRootPath(
|
29
|
+
folder: getRootPath('dist'),
|
33
30
|
callBack: (size: string) => {
|
34
31
|
console.log(chalk.bold(chalk.green(`✨ ${chalk.blue(`[${name}]`)} all build successfully, Total files ${size}`)))
|
35
32
|
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
3
|
+
|
4
|
+
case `uname` in
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
8
|
+
fi
|
9
|
+
;;
|
10
|
+
esac
|
11
|
+
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
13
|
+
export NODE_PATH="/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/eslint@9.33.0_jiti@2.5.1/node_modules/eslint/bin/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/eslint@9.33.0_jiti@2.5.1/node_modules/eslint/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/eslint@9.33.0_jiti@2.5.1/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/node_modules"
|
14
|
+
else
|
15
|
+
export NODE_PATH="/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/eslint@9.33.0_jiti@2.5.1/node_modules/eslint/bin/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/eslint@9.33.0_jiti@2.5.1/node_modules/eslint/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/eslint@9.33.0_jiti@2.5.1/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/node_modules:$NODE_PATH"
|
16
|
+
fi
|
17
|
+
if [ -x "$basedir/node" ]; then
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/eslint@9.33.0_jiti@2.5.1/node_modules/eslint/bin/eslint.js" "$@"
|
19
|
+
else
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/eslint@9.33.0_jiti@2.5.1/node_modules/eslint/bin/eslint.js" "$@"
|
21
|
+
fi
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
3
|
+
|
4
|
+
case `uname` in
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
8
|
+
fi
|
9
|
+
;;
|
10
|
+
esac
|
11
|
+
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
13
|
+
export NODE_PATH="/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/@antfu+eslint-config@5.2.1_@vue+compiler-sfc@3.5.18_eslint@9.33.0_jiti@2.5.1__typescript@5.8.3/node_modules/@antfu/eslint-config/bin/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/@antfu+eslint-config@5.2.1_@vue+compiler-sfc@3.5.18_eslint@9.33.0_jiti@2.5.1__typescript@5.8.3/node_modules/@antfu/eslint-config/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/@antfu+eslint-config@5.2.1_@vue+compiler-sfc@3.5.18_eslint@9.33.0_jiti@2.5.1__typescript@5.8.3/node_modules/@antfu/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/@antfu+eslint-config@5.2.1_@vue+compiler-sfc@3.5.18_eslint@9.33.0_jiti@2.5.1__typescript@5.8.3/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/node_modules"
|
14
|
+
else
|
15
|
+
export NODE_PATH="/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/@antfu+eslint-config@5.2.1_@vue+compiler-sfc@3.5.18_eslint@9.33.0_jiti@2.5.1__typescript@5.8.3/node_modules/@antfu/eslint-config/bin/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/@antfu+eslint-config@5.2.1_@vue+compiler-sfc@3.5.18_eslint@9.33.0_jiti@2.5.1__typescript@5.8.3/node_modules/@antfu/eslint-config/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/@antfu+eslint-config@5.2.1_@vue+compiler-sfc@3.5.18_eslint@9.33.0_jiti@2.5.1__typescript@5.8.3/node_modules/@antfu/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/@antfu+eslint-config@5.2.1_@vue+compiler-sfc@3.5.18_eslint@9.33.0_jiti@2.5.1__typescript@5.8.3/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/node_modules:$NODE_PATH"
|
16
|
+
fi
|
17
|
+
if [ -x "$basedir/node" ]; then
|
18
|
+
exec "$basedir/node" "$basedir/../@antfu/eslint-config/bin/index.js" "$@"
|
19
|
+
else
|
20
|
+
exec node "$basedir/../@antfu/eslint-config/bin/index.js" "$@"
|
21
|
+
fi
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
10
10
|
esac
|
11
11
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
13
|
-
export NODE_PATH="/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/vite@7.1.
|
13
|
+
export NODE_PATH="/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/rolldown-vite@7.1.4_@types+node@24.3.0_esbuild@0.25.9_jiti@2.5.1_less@4.4.1_terser@5.43.1_yaml@2.8.1/node_modules/rolldown-vite/bin/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/rolldown-vite@7.1.4_@types+node@24.3.0_esbuild@0.25.9_jiti@2.5.1_less@4.4.1_terser@5.43.1_yaml@2.8.1/node_modules/rolldown-vite/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/rolldown-vite@7.1.4_@types+node@24.3.0_esbuild@0.25.9_jiti@2.5.1_less@4.4.1_terser@5.43.1_yaml@2.8.1/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/node_modules"
|
14
14
|
else
|
15
|
-
export NODE_PATH="/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/vite@7.1.
|
15
|
+
export NODE_PATH="/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/rolldown-vite@7.1.4_@types+node@24.3.0_esbuild@0.25.9_jiti@2.5.1_less@4.4.1_terser@5.43.1_yaml@2.8.1/node_modules/rolldown-vite/bin/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/rolldown-vite@7.1.4_@types+node@24.3.0_esbuild@0.25.9_jiti@2.5.1_less@4.4.1_terser@5.43.1_yaml@2.8.1/node_modules/rolldown-vite/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/rolldown-vite@7.1.4_@types+node@24.3.0_esbuild@0.25.9_jiti@2.5.1_less@4.4.1_terser@5.43.1_yaml@2.8.1/node_modules:/Users/gaoxiang/Documents/工作/工作项目/gx12358/vue/github/pro-components-vue-v2/node_modules/.pnpm/node_modules:$NODE_PATH"
|
16
16
|
fi
|
17
17
|
if [ -x "$basedir/node" ]; then
|
18
18
|
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|