diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..c435345 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,34 @@ +module.exports = { + root: true, + env: { + es6: true, + node: true, + browser: true, + }, + extends: ['eslint:recommended'], + parser: 'vue-eslint-parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + ecmaFeatures: { + jsx: true, + impliedStrict: true, + }, + }, + rules: { + 'no-undef': 'error', + 'no-alert': 'warn', + 'no-debugger': 'warn', + 'no-else-return': 'error', + indent: [0, 4], + eqeqeq: [2, 'always'], + semi: [2, 'always'], + quotes: [2, 'single'], + }, + globals: { + arguments: true, + defineProps: true, + defineEmits: true, + defineExpose: true, + }, +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..7d2e0d6 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["johnsoncodehk.volar", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..7db672d --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..dc6ac7e --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "russia-block", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "vue": "^3.2.25" + }, + "devDependencies": { + "@originjs/vite-plugin-global-style": "^1.0.2", + "@types/node": "^17.0.21", + "@vitejs/plugin-legacy": "^1.7.1", + "@vitejs/plugin-vue": "^2.2.0", + "@vitejs/plugin-vue-jsx": "^1.3.8", + "consola": "^2.15.3", + "less": "^4.1.2", + "unplugin-auto-import": "^0.6.4", + "unplugin-vue-components": "^0.18.0", + "vite": "^2.8.0", + "vite-plugin-remove-console": "^0.0.6", + "vite-plugin-style-import": "^2.0.0", + "vite-plugin-svg-icons": "^2.0.1" + } +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..df36fcf Binary files /dev/null and b/public/favicon.ico differ diff --git a/src/.eslintrc.json b/src/.eslintrc.json new file mode 100644 index 0000000..d5c3f94 --- /dev/null +++ b/src/.eslintrc.json @@ -0,0 +1,56 @@ +{ + "globals": { + "_": true, + "axios": true, + "computed": true, + "createApp": true, + "customRef": true, + "dayjs": true, + "defineAsyncComponent": true, + "defineComponent": true, + "effectScope": true, + "EffectScope": true, + "getCurrentInstance": true, + "getCurrentScope": true, + "h": true, + "inject": true, + "isReadonly": true, + "isRef": true, + "markRaw": true, + "nextTick": true, + "onActivated": true, + "onBeforeMount": true, + "onBeforeUnmount": true, + "onBeforeUpdate": true, + "onDeactivated": true, + "onErrorCaptured": true, + "onMounted": true, + "onRenderTracked": true, + "onRenderTriggered": true, + "onScopeDispose": true, + "onServerPrefetch": true, + "onUnmounted": true, + "onUpdated": true, + "provide": true, + "reactive": true, + "readonly": true, + "ref": true, + "resolveComponent": true, + "shallowReactive": true, + "shallowReadonly": true, + "shallowRef": true, + "toRaw": true, + "toRef": true, + "toRefs": true, + "triggerRef": true, + "unref": true, + "useAttrs": true, + "useCssModule": true, + "useCssVars": true, + "useRoute": true, + "useRouter": true, + "useSlots": true, + "watch": true, + "watchEffect": true + } +} \ No newline at end of file diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..efb3918 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,12 @@ + + + + + diff --git a/src/assets/logo.png b/src/assets/logo.png new file mode 100644 index 0000000..f3d2503 Binary files /dev/null and b/src/assets/logo.png differ diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts new file mode 100644 index 0000000..660d329 --- /dev/null +++ b/src/auto-imports.d.ts @@ -0,0 +1,57 @@ +// Generated by 'unplugin-auto-import' +// We suggest you to commit this file into source control +declare global { + const _: typeof import('lodash') + const axios: typeof import('axios')['default'] + const computed: typeof import('vue')['computed'] + const createApp: typeof import('vue')['createApp'] + const customRef: typeof import('vue')['customRef'] + const dayjs: typeof import('dayjs') + const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] + const defineComponent: typeof import('vue')['defineComponent'] + const effectScope: typeof import('vue')['effectScope'] + const EffectScope: typeof import('vue')['EffectScope'] + const getCurrentInstance: typeof import('vue')['getCurrentInstance'] + const getCurrentScope: typeof import('vue')['getCurrentScope'] + const h: typeof import('vue')['h'] + const inject: typeof import('vue')['inject'] + const isReadonly: typeof import('vue')['isReadonly'] + const isRef: typeof import('vue')['isRef'] + const markRaw: typeof import('vue')['markRaw'] + const nextTick: typeof import('vue')['nextTick'] + const onActivated: typeof import('vue')['onActivated'] + const onBeforeMount: typeof import('vue')['onBeforeMount'] + const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] + const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] + const onDeactivated: typeof import('vue')['onDeactivated'] + const onErrorCaptured: typeof import('vue')['onErrorCaptured'] + const onMounted: typeof import('vue')['onMounted'] + const onRenderTracked: typeof import('vue')['onRenderTracked'] + const onRenderTriggered: typeof import('vue')['onRenderTriggered'] + const onScopeDispose: typeof import('vue')['onScopeDispose'] + const onServerPrefetch: typeof import('vue')['onServerPrefetch'] + const onUnmounted: typeof import('vue')['onUnmounted'] + const onUpdated: typeof import('vue')['onUpdated'] + const provide: typeof import('vue')['provide'] + const reactive: typeof import('vue')['reactive'] + const readonly: typeof import('vue')['readonly'] + const ref: typeof import('vue')['ref'] + const resolveComponent: typeof import('vue')['resolveComponent'] + const shallowReactive: typeof import('vue')['shallowReactive'] + const shallowReadonly: typeof import('vue')['shallowReadonly'] + const shallowRef: typeof import('vue')['shallowRef'] + const toRaw: typeof import('vue')['toRaw'] + const toRef: typeof import('vue')['toRef'] + const toRefs: typeof import('vue')['toRefs'] + const triggerRef: typeof import('vue')['triggerRef'] + const unref: typeof import('vue')['unref'] + const useAttrs: typeof import('vue')['useAttrs'] + const useCssModule: typeof import('vue')['useCssModule'] + const useCssVars: typeof import('vue')['useCssVars'] + const useRoute: typeof import('vue-router')['useRoute'] + const useRouter: typeof import('vue-router')['useRouter'] + const useSlots: typeof import('vue')['useSlots'] + const watch: typeof import('vue')['watch'] + const watchEffect: typeof import('vue')['watchEffect'] +} +export {} diff --git a/src/components.d.ts b/src/components.d.ts new file mode 100644 index 0000000..4a259e4 --- /dev/null +++ b/src/components.d.ts @@ -0,0 +1,11 @@ +// generated by unplugin-vue-components +// We suggest you to commit this file into source control +// Read more: https://github.com/vuejs/vue-next/pull/3399 + +declare module 'vue' { + export interface GlobalComponents { + SvgIcon: typeof import('./components/SvgIcon.vue')['default'] + } +} + +export { } diff --git a/src/components/SvgIcon.vue b/src/components/SvgIcon.vue new file mode 100644 index 0000000..b416094 --- /dev/null +++ b/src/components/SvgIcon.vue @@ -0,0 +1,42 @@ + + + + diff --git a/src/icons/msb.svg b/src/icons/msb.svg new file mode 100644 index 0000000..f9c4c1b --- /dev/null +++ b/src/icons/msb.svg @@ -0,0 +1,107 @@ + + + + diff --git a/src/icons/vue.svg b/src/icons/vue.svg new file mode 100644 index 0000000..0e6787a --- /dev/null +++ b/src/icons/vue.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..7f4d5dc --- /dev/null +++ b/src/main.js @@ -0,0 +1,6 @@ +import { createApp } from 'vue'; +import App from './App.vue'; + +import 'virtual:svg-icons-register'; + +createApp(App).mount('#app'); diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..cbfb349 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,78 @@ +import { UserConfigExport, ConfigEnv } from 'vite'; +import { resolve } from 'path'; + +import vue from '@vitejs/plugin-vue'; +import vueJsx from '@vitejs/plugin-vue-jsx'; +import AutoImport from 'unplugin-auto-import/vite'; +import Components from 'unplugin-vue-components/vite'; +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'; +import { createStyleImportPlugin, ElementPlusResolve as ElementPlusStyleResolve } from 'vite-plugin-style-import'; +import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'; +import globalStyle from '@originjs/vite-plugin-global-style'; +import removeConsole from 'vite-plugin-remove-console'; +import legacy from '@vitejs/plugin-legacy'; + +export default ({ command, mode }: ConfigEnv): UserConfigExport => { + return { + resolve: { + alias: [ + { + find: '@', + replacement: resolve(process.cwd(), 'src'), + }, + { + find: '~', + replacement: resolve(process.cwd(), 'src/assets'), + }, + ], + }, + plugins: [ + vue(), + vueJsx(), + createSvgIconsPlugin({ + iconDirs: [resolve(process.cwd(), 'src/icons')], + symbolId: 'icon-[dir]-[name]', + }), + createStyleImportPlugin({ + include: ['**/*.js', '**/*.ts', '**/*.tsx', '**/*.jsx', '**/*.vue'], + resolves: [ElementPlusStyleResolve()], + }), + AutoImport({ + include: [/\.[jt]sx?$/, /\.vue\??/], + imports: [ + 'vue', + 'vue-router', + { + axios: [ + ['default', 'axios'], // import { default as axios } from 'axios', + ], + }, + { lodash: [['*', '_']] }, + { dayjs: [['*', 'dayjs']] }, + ], + eslintrc: { + enabled: true, + filepath: './src/.eslintrc.json', + globalsPropValue: true, + }, + dts: 'src/auto-imports.d.ts', + }), + Components({ + dirs: ['src/components'], + extensions: ['vue', 'jsx', 'tsx', 'js', 'ts'], + deep: true, + resolvers: [ElementPlusResolver()], + dts: 'src/components.d.ts', + include: [/\.tsx$/, /\.jsx$/, /\.ts$/, /\.js$/, /\.vue$/, /\.vue\?vue/], + exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/], + }), + removeConsole(), + globalStyle({ + sourcePath: 'src/styles', + }), + legacy({ + targets: ['defaults', 'not IE 11'], + }), + ], + }; +};