feat: Feature/pro docs (#70)
* chore: merge main * feat: update docs * feat: remove coze-assistant * feat: add watermark plugin * feat: update preferences * feat: update docs --------- Co-authored-by: vince <vince292007@gmail.com>
This commit is contained in:
@@ -28,25 +28,25 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint-config-turbo": "^2.0.9",
|
||||
"eslint-plugin-command": "^0.2.3"
|
||||
"eslint-plugin-command": "^0.2.3",
|
||||
"eslint-plugin-import-x": "^3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.7.0",
|
||||
"@eslint/js": "^9.8.0",
|
||||
"@types/eslint": "^9.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.17.0",
|
||||
"@typescript-eslint/parser": "^7.17.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.8.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-i": "^2.29.1",
|
||||
"eslint-plugin-jsdoc": "^48.8.3",
|
||||
"eslint-plugin-jsonc": "^2.16.0",
|
||||
"eslint-plugin-n": "^17.9.0",
|
||||
"eslint-plugin-n": "^17.10.1",
|
||||
"eslint-plugin-no-only-tests": "^3.1.0",
|
||||
"eslint-plugin-perfectionist": "^3.0.0",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"eslint-plugin-regexp": "^2.6.0",
|
||||
"eslint-plugin-unicorn": "^54.0.0",
|
||||
"eslint-plugin-unicorn": "^55.0.0",
|
||||
"eslint-plugin-unused-imports": "^4.0.1",
|
||||
"eslint-plugin-vitest": "^0.5.4",
|
||||
"eslint-plugin-vue": "^9.27.0",
|
||||
|
@@ -1,14 +1,12 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function importPluginConfig(): Promise<Linter.FlatConfig[]> {
|
||||
const [pluginImport] = await Promise.all([
|
||||
// @ts-expect-error - no types
|
||||
import('eslint-plugin-i'),
|
||||
] as const);
|
||||
import * as pluginImport from 'eslint-plugin-import-x';
|
||||
|
||||
export async function importPluginConfig(): Promise<Linter.Config[]> {
|
||||
return [
|
||||
{
|
||||
plugins: {
|
||||
// @ts-expect-error - This is a dynamic import
|
||||
import: pluginImport,
|
||||
},
|
||||
rules: {
|
||||
|
@@ -33,7 +33,7 @@
|
||||
"stylelint-scss": "^6.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"postcss": "^8.4.39",
|
||||
"postcss": "^8.4.40",
|
||||
"postcss-html": "^1.7.0",
|
||||
"postcss-scss": "^4.0.9",
|
||||
"prettier": "^3.3.3",
|
||||
|
@@ -37,6 +37,6 @@
|
||||
"pkg-types": "^1.1.3",
|
||||
"prettier": "^3.3.3",
|
||||
"rimraf": "^6.0.1",
|
||||
"zx": "^7.2.3"
|
||||
"zx": "^8.1.4"
|
||||
}
|
||||
}
|
||||
|
@@ -46,17 +46,17 @@
|
||||
"tailwindcss": "^3.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify/json": "^2.2.230",
|
||||
"@iconify/json": "^2.2.231",
|
||||
"@iconify/tailwind": "^1.1.1",
|
||||
"@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
|
||||
"@tailwindcss/typography": "^0.5.13",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"cssnano": "^7.0.4",
|
||||
"postcss": "^8.4.39",
|
||||
"postcss": "^8.4.40",
|
||||
"postcss-antd-fixes": "^0.2.0",
|
||||
"postcss-import": "^16.1.0",
|
||||
"postcss-preset-env": "^9.6.0",
|
||||
"tailwindcss": "^3.4.6",
|
||||
"tailwindcss": "^3.4.7",
|
||||
"tailwindcss-animate": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@@ -20,6 +20,6 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@vben/types": "workspace:*",
|
||||
"vite": "^5.3.4"
|
||||
"vite": "^5.3.5"
|
||||
}
|
||||
}
|
||||
|
@@ -34,20 +34,20 @@
|
||||
"nitropack": "^2.9.7",
|
||||
"resolve.exports": "^2.0.2",
|
||||
"vite-plugin-lib-inject-css": "^2.1.1",
|
||||
"vite-plugin-pwa": "^0.20.0",
|
||||
"vite-plugin-vue-devtools": "^7.3.6"
|
||||
"vite-plugin-pwa": "^0.20.1",
|
||||
"vite-plugin-vue-devtools": "^7.3.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/html-minifier-terser": "^7.0.2",
|
||||
"@vben/node-utils": "workspace:*",
|
||||
"@vitejs/plugin-vue": "^5.0.5",
|
||||
"@vitejs/plugin-vue": "^5.1.1",
|
||||
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
||||
"dayjs": "^1.11.12",
|
||||
"dotenv": "^16.4.5",
|
||||
"rollup": "^4.19.0",
|
||||
"rollup": "^4.19.1",
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
"sass": "^1.77.8",
|
||||
"vite": "^5.3.4",
|
||||
"vite": "^5.3.5",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-dts": "4.0.0-beta.1",
|
||||
"vite-plugin-html": "^3.2.2"
|
||||
|
@@ -94,7 +94,7 @@ function createCssOptions(injectGlobalScss = true) {
|
||||
const relativePath = relative(root, filepath);
|
||||
// apps下的包注入全局样式
|
||||
if (relativePath.startsWith('apps/')) {
|
||||
return `@import "@vben/styles/global";\n${content}`;
|
||||
return `@import (reference) "@vben/styles/global";\n${content}`;
|
||||
}
|
||||
return content;
|
||||
},
|
||||
|
@@ -7,16 +7,16 @@ const isDevelopment = process.env.NODE_ENV === 'development';
|
||||
const getDefaultPwaOptions = (name: string): Partial<PwaPluginOptions> => ({
|
||||
manifest: {
|
||||
description:
|
||||
'Vue Vben Admin is a modern admin dashboard template based on Vue 3. ',
|
||||
'Vben Admin is a modern admin dashboard template based on Vue 3. ',
|
||||
icons: [
|
||||
{
|
||||
sizes: '192x192',
|
||||
src: 'https://cdn.jsdelivr.net/npm/@vbenjs/static-source@0.1.3/source/pwa-icon-192.png',
|
||||
src: 'https://unpkg.com/@vbenjs/static-source@0.1.5/source/pwa-icon-192.png',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
sizes: '512x512',
|
||||
src: 'https://cdn.jsdelivr.net/npm/@vbenjs/static-source@0.1.3/source/pwa-icon-512.png',
|
||||
src: 'https://unpkg.com/@vbenjs/static-source@0.1.5/source/pwa-icon-512.png',
|
||||
type: 'image/png',
|
||||
},
|
||||
],
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
import { fs } from '@vben/node-utils';
|
||||
import { fs, readPackageJSON } from '@vben/node-utils';
|
||||
|
||||
import { type PluginOption } from 'vite';
|
||||
|
||||
@@ -15,8 +15,9 @@ async function viteInjectAppLoadingPlugin(
|
||||
loadingTemplate = 'loading.html',
|
||||
): Promise<PluginOption | undefined> {
|
||||
const loadingHtml = await getLoadingRawByHtmlTemplate(loadingTemplate);
|
||||
const { version } = await readPackageJSON(process.cwd());
|
||||
const envRaw = isBuild ? 'prod' : 'dev';
|
||||
const cacheName = `'${env.VITE_APP_NAMESPACE}-${envRaw}-preferences-theme'`;
|
||||
const cacheName = `'${env.VITE_APP_NAMESPACE}-${version}-${envRaw}-preferences-theme'`;
|
||||
|
||||
// 获取缓存的主题
|
||||
// 保证黑暗主题下,刷新页面时,loading也是黑暗主题
|
||||
|
@@ -74,6 +74,7 @@ async function viteMetadataPlugin(
|
||||
license,
|
||||
version,
|
||||
}),
|
||||
'import.meta.env.VITE_APP_VERSION': JSON.stringify(version),
|
||||
},
|
||||
};
|
||||
},
|
||||
|
@@ -30,7 +30,7 @@ async function viteLicensePlugin(
|
||||
handler: (_options: NormalizedOutputOptions, bundle: OutputBundle) => {
|
||||
const date = dateUtil().format('YYYY-MM-DD ');
|
||||
const copyrightText = `/*!
|
||||
* Vue Vben Admin
|
||||
* Vben Admin
|
||||
* Version: ${version}
|
||||
* Author: vben
|
||||
* Copyright (C) 2024 Vben
|
||||
|
@@ -56,24 +56,40 @@ async function loadAndConvertEnv(
|
||||
match = 'VITE_',
|
||||
confFiles = getConfFiles(),
|
||||
): Promise<
|
||||
{ appTitle: string; port: number } & Partial<ApplicationPluginOptions>
|
||||
{
|
||||
appTitle: string;
|
||||
base: string;
|
||||
port: number;
|
||||
} & Partial<ApplicationPluginOptions>
|
||||
> {
|
||||
const envConfig = await loadEnv(match, confFiles);
|
||||
const visualizer = envConfig.visualizer || '';
|
||||
const pwa = envConfig.pwa || '';
|
||||
const compress = envConfig.VITE_COMPRESS || '';
|
||||
const {
|
||||
VITE_BASE,
|
||||
VITE_COMPRESS,
|
||||
VITE_DEVTOOLS,
|
||||
VITE_GLOB_APP_TITLE,
|
||||
VITE_INJECT_APP_LOADING,
|
||||
VITE_NITRO_MOCK,
|
||||
VITE_PORT,
|
||||
VITE_PWA,
|
||||
VITE_VISUALIZER,
|
||||
} = envConfig;
|
||||
const compress = VITE_COMPRESS || '';
|
||||
const compressTypes = compress
|
||||
.split(',')
|
||||
.filter((item) => item === 'brotli' || item === 'gzip');
|
||||
|
||||
return {
|
||||
appTitle: envConfig?.VITE_GLOB_APP_TITLE ?? 'Vben Admin',
|
||||
appTitle: VITE_GLOB_APP_TITLE ?? 'Vben Admin',
|
||||
base: VITE_BASE || '/',
|
||||
compress: !!compress,
|
||||
compressTypes: compressTypes as ('brotli' | 'gzip')[],
|
||||
nitroMock: !!envConfig.VITE_NITRO_MOCK,
|
||||
port: Number(envConfig.VITE_PORT) || 5173,
|
||||
pwa: !!pwa,
|
||||
visualizer: !!visualizer,
|
||||
devtools: VITE_DEVTOOLS === 'true',
|
||||
injectAppLoading: VITE_INJECT_APP_LOADING === 'true',
|
||||
nitroMock: VITE_NITRO_MOCK === 'true',
|
||||
port: Number(VITE_PORT) || 5173,
|
||||
pwa: VITE_PWA === 'true',
|
||||
visualizer: VITE_VISUALIZER === 'true',
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user