diff --git a/.env b/.env new file mode 100644 index 0000000..825161b --- /dev/null +++ b/.env @@ -0,0 +1,8 @@ +# port +VITE_PORT = 3100 + +# spa-title +VITE_GLOB_APP_TITLE = Vue3 Admin + +# spa shortname +VITE_GLOB_APP_SHORT_NAME = vue3_admin diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..9236123 --- /dev/null +++ b/.env.development @@ -0,0 +1,22 @@ +# Whether to open mock +VITE_USE_MOCK = true + +# public path +VITE_PUBLIC_PATH = / + +# Cross-domain proxy, you can configure multiple +# Please note that no line breaks +VITE_PROXY = [["/basic-api","http://localhost:3000"],["/upload","http://localhost:3300/upload"]] +# VITE_PROXY=[["/api","https://vvbin.cn/test"]] + +# Delete console +VITE_DROP_CONSOLE = false + +# Basic interface address SPA +VITE_GLOB_API_URL=/basic-api + +# File upload address, optional +VITE_GLOB_UPLOAD_URL=/upload + +# Interface prefix +VITE_GLOB_API_URL_PREFIX= diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..a0bdfb7 --- /dev/null +++ b/.env.production @@ -0,0 +1,35 @@ +# Whether to open mock +VITE_USE_MOCK = true + +# public path +VITE_PUBLIC_PATH = / + +# Delete console +VITE_DROP_CONSOLE = true + +# Whether to enable gzip or brotli compression +# Optional: gzip | brotli | none +# If you need multiple forms, you can use `,` to separate +VITE_BUILD_COMPRESS = 'none' + +# Whether to delete origin files when using compress, default false +VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false + +# Basic interface address SPA +VITE_GLOB_API_URL=/basic-api + +# File upload address, optional +# It can be forwarded by nginx or write the actual address directly +VITE_GLOB_UPLOAD_URL=/upload + +# Interface prefix +VITE_GLOB_API_URL_PREFIX= + +# Whether to enable image compression +VITE_USE_IMAGEMIN= true + +# use pwa +VITE_USE_PWA = false + +# Is it compatible with older browsers +VITE_LEGACY = false diff --git a/.env.test b/.env.test new file mode 100644 index 0000000..469b307 --- /dev/null +++ b/.env.test @@ -0,0 +1,36 @@ +NODE_ENV=production +# Whether to open mock +VITE_USE_MOCK = true + +# public path +VITE_PUBLIC_PATH = / + +# Delete console +VITE_DROP_CONSOLE = true + +# Whether to enable gzip or brotli compression +# Optional: gzip | brotli | none +# If you need multiple forms, you can use `,` to separate +VITE_BUILD_COMPRESS = 'none' + +# Whether to delete origin files when using compress, default false +VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false + +# Basic interface address SPA +VITE_GLOB_API_URL=/basic-api + +# File upload address, optional +# It can be forwarded by nginx or write the actual address directly +VITE_GLOB_UPLOAD_URL=/upload + +# Interface prefix +VITE_GLOB_API_URL_PREFIX= + +# Whether to enable image compression +VITE_USE_IMAGEMIN= true + +# use pwa +VITE_USE_PWA = false + +# Is it compatible with older browsers +VITE_LEGACY = false diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..348631b --- /dev/null +++ b/.eslintignore @@ -0,0 +1,15 @@ + +*.sh +node_modules +*.md +*.woff +*.ttf +.vscode +.idea +dist +/public +/docs +.husky +.local +/bin +Dockerfile diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..7633bbe --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,80 @@ +// @ts-check +const { defineConfig } = require('eslint-define-config'); +module.exports = defineConfig({ + root: true, + env: { + browser: true, + node: true, + es6: true, + }, + parser: 'vue-eslint-parser', + parserOptions: { + parser: '@typescript-eslint/parser', + ecmaVersion: 2020, + sourceType: 'module', + jsxPragma: 'React', + ecmaFeatures: { + jsx: true, + }, + }, + extends: [ + 'plugin:vue/vue3-recommended', + 'plugin:@typescript-eslint/recommended', + 'prettier', + 'plugin:prettier/recommended', + 'plugin:jest/recommended', + ], + rules: { + 'vue/script-setup-uses-vars': 'error', + '@typescript-eslint/ban-ts-ignore': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-empty-function': 'off', + 'vue/custom-event-name-casing': 'off', + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + }, + ], + 'no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + }, + ], + 'space-before-function-paren': 'off', + + 'vue/attributes-order': 'off', + 'vue/v-on-event-hyphenation': 'off', + 'vue/multi-word-component-names': 'off', + 'vue/one-component-per-file': 'off', + 'vue/html-closing-bracket-newline': 'off', + 'vue/max-attributes-per-line': 'off', + 'vue/multiline-html-element-content-newline': 'off', + 'vue/singleline-html-element-content-newline': 'off', + 'vue/attribute-hyphenation': 'off', + 'vue/require-default-prop': 'off', + 'vue/html-self-closing': [ + 'error', + { + html: { + void: 'always', + normal: 'never', + component: 'always', + }, + svg: 'always', + math: 'always', + }, + ], + }, +}); diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a4b670d --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +node_modules +.DS_Store +dist +.npmrc +.cache + +tests/server/static +tests/server/static/upload + +.local +# local env files +.env.local +.env.*.local +.eslintcache + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.idea +# .vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw?