diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..dc3bc09 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,4 @@ +> 1% +last 2 versions +not dead +not ie 11 diff --git a/.env b/.env index 0ea8b00..e136e8b 100644 --- a/.env +++ b/.env @@ -1,17 +1,30 @@ -# Whether to open mock -VITE_USE_MOCK=false +# 项目基本地址 +VITE_BASE_URL=/ +# 项目名称 +VITE_APP_NAME=N-Admin +# 项目标题 +VITE_APP_TITLE=N-Admin +# 项目描述 +VITE_APP_DESC=N-Admin-UI -# public path -VITE_PUBLIC_PATH=/ - -VITE_TITLE=N-Admin -VITE_DESCRIPTION=N-Admin-UI template - -# Basic interface address SPA +# API访问地址 VITE_API_URL=/api - -# File upload address, optional +# 上传地址,optional VITE_UPLOAD_URL=/api/upload +# API接口前缀 +VITE_API_URL_PREFIX= -# Interface prefix -VITE_API_URL_PREFIX= \ No newline at end of file +# 是否开启请求代理 +VITE_HTTP_PROXY=false +# 是否开启打包文件大小结果分析 +VITE_VISUALIZER=true +# 是否开启打包压缩 +VITE_COMPRESS=false +# 压缩算法类型 +VITE_COMPRESS_TYPE=gzip +# 是否应用pwa +VITE_PWA=false +# 是否启用Markdown插件 +VITE_MARKDOWN=true +# 是否开启Mock +VITE_USE_MOCK=false \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d4e5bd3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +# https://docs.github.com/cn/get-started/getting-started-with-git/configuring-git-to-handle-line-endings + +# Automatically normalize line endings (to LF) for all text-based files. +* text=auto eol=lf + +# Declare files that will always have CRLF line endings on checkout. +*.{cmd,[cC][mM][dD]} text eol=crlf +*.{bat,[bB][aA][tT]} text eol=crlf + +# Denote all files that are truly binary and should not be modified. +*.{ico,png,jpg,jpeg,gif,webp,svg,woff,woff2} binary \ No newline at end of file diff --git a/.gitignore b/.gitignore index cef0d8d..689f001 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,38 @@ -.DS_Store .vite-ssg-dist .vite-ssg-temp -*.local +cypress/downloads + +node_modules +.DS_Store dist dist-ssr -node_modules -.idea/ +.cache +.turbo + +# local files +*.local +# local env files +.env.local +.env.*.local +.eslintcache + +# Log files *.log -cypress/downloads +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.idea +# .vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +package-lock.json +pnpm-lock.yaml + +.history \ No newline at end of file diff --git a/LICENSE b/LICENSE index 670b1b3..964aa53 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020-PRESENT Anthony Fu +Copyright (c) 2020-PRESENT NorthLan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/index.html b/index.html index 5d00087..6b8e457 100644 --- a/index.html +++ b/index.html @@ -1,11 +1,15 @@ + + + + %VITE_APP_NAME% + -
+
+
+
- + + \ No newline at end of file diff --git a/package.json b/package.json index a3842e3..8c89d96 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test:unit": "vitest", "typecheck": "vue-tsc --noEmit", "up": "taze major -I", - "postinstall": "npx simple-git-hooks", + "postinstall": "npx simple-git-hooks && turbo run stub", "sizecheck": "npx vite-bundle-visualizer" }, "dependencies": { @@ -64,6 +64,7 @@ "shiki": "^0.14.2", "simple-git-hooks": "^2.8.1", "taze": "^0.10.1", + "turbo": "^1.10.3", "typescript": "^5.0.4", "unocss": "^0.52.2", "unplugin-auto-import": "^0.16.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27b056a..a39a821 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -121,6 +121,9 @@ devDependencies: taze: specifier: ^0.10.1 version: 0.10.1 + turbo: + specifier: ^1.10.3 + version: 1.10.3 typescript: specifier: ^5.0.4 version: 5.1.3 @@ -9242,6 +9245,67 @@ packages: safe-buffer: 5.2.1 dev: true + /turbo-darwin-64@1.10.3: + resolution: {integrity: sha512-IIB9IomJGyD3EdpSscm7Ip1xVWtYb7D0x7oH3vad3gjFcjHJzDz9xZ/iw/qItFEW+wGFcLSRPd+1BNnuLM8AsA==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /turbo-darwin-arm64@1.10.3: + resolution: {integrity: sha512-SBNmOZU9YEB0eyNIxeeQ+Wi0Ufd+nprEVp41rgUSRXEIpXjsDjyBnKnF+sQQj3+FLb4yyi/yZQckB+55qXWEsw==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /turbo-linux-64@1.10.3: + resolution: {integrity: sha512-kvAisGKE7xHJdyMxZLvg53zvHxjqPK1UVj4757PQqtx9dnjYHSc8epmivE6niPgDHon5YqImzArCjVZJYpIGHQ==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /turbo-linux-arm64@1.10.3: + resolution: {integrity: sha512-Qgaqln0IYRgyL0SowJOi+PNxejv1I2xhzXOI+D+z4YHbgSx87ox1IsALYBlK8VRVYY8VCXl+PN12r1ioV09j7A==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /turbo-windows-64@1.10.3: + resolution: {integrity: sha512-rbH9wManURNN8mBnN/ZdkpUuTvyVVEMiUwFUX4GVE5qmV15iHtZfDLUSGGCP2UFBazHcpNHG1OJzgc55GFFrUw==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /turbo-windows-arm64@1.10.3: + resolution: {integrity: sha512-ThlkqxhcGZX39CaTjsHqJnqVe+WImjX13pmjnpChz6q5HHbeRxaJSFzgrHIOt0sUUVx90W/WrNRyoIt/aafniw==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /turbo@1.10.3: + resolution: {integrity: sha512-U4gKCWcKgLcCjQd4Pl8KJdfEKumpyWbzRu75A6FCj6Ctea1PIm58W6Ltw1QXKqHrl2pF9e1raAskf/h6dlrPCA==} + hasBin: true + requiresBuild: true + optionalDependencies: + turbo-darwin-64: 1.10.3 + turbo-darwin-arm64: 1.10.3 + turbo-linux-64: 1.10.3 + turbo-linux-arm64: 1.10.3 + turbo-windows-64: 1.10.3 + turbo-windows-arm64: 1.10.3 + dev: true + /tweetnacl@0.14.5: resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} dev: true diff --git a/src/types/env.d.ts b/src/types/env.d.ts index 7721d9e..488ae7b 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -1,7 +1,7 @@ /// interface ImportMetaEnv { - /** 项目基本地址 */ + /** 项目基本地址 */ readonly VITE_BASE_URL: string; /** 项目名称 */ readonly VITE_APP_NAME: string; diff --git a/turbo.json b/turbo.json new file mode 100644 index 0000000..bf5b89b --- /dev/null +++ b/turbo.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://turborepo.org/schema.json", + "pipeline": { + "build": { + "dependsOn": ["^build"], + "outputs": ["dist/**"] + }, + "stub": {}, + "lint": {}, + "clean": { + "cache": false + }, + "dev": { + "cache": false, + "persistent": true + } + } +}