Skip to content

Commit

Permalink
release: update 5.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Dec 11, 2024
1 parent 932ecb3 commit 323a8c9
Show file tree
Hide file tree
Showing 25 changed files with 2,738 additions and 2,681 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.15.0
v22.12.0
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 5.9.0 (2024-12-11)

https://github.com/pure-admin/vue-pure-admin/releases/tag/v5.9.0

# 5.8.0 (2024-08-20)

https://github.com/pure-admin/vue-pure-admin/releases/tag/v5.8.0

# 5.7.0 (2024-07-03)

https://github.com/pure-admin/vue-pure-admin/releases/tag/v5.7.0
Expand Down
8 changes: 4 additions & 4 deletions build/info.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { Plugin } from "vite";
import gradient from "gradient-string";
import { getPackageSize } from "./utils";
import dayjs, { type Dayjs } from "dayjs";
import duration from "dayjs/plugin/duration";
import gradientString from "gradient-string";
import boxen, { type Options as BoxenOptions } from "boxen";
dayjs.extend(duration);

const welcomeMessage = gradientString("cyan", "magenta").multiline(
`您好! 欢迎使用 pure-admin 开源项目\n我们为您精心准备了下面两个贴心的保姆级文档\nhttps://pure-admin.github.io/pure-admin-doc\nhttps://pure-admin-utils.netlify.app`
const welcomeMessage = gradient(["cyan", "magenta"]).multiline(
`您好! 欢迎使用 pure-admin 开源项目\n我们为您精心准备了下面两个贴心的保姆级文档\nhttps://pure-admin.cn\nhttps://pure-admin-utils.netlify.app`
);

const boxenOptions: BoxenOptions = {
Expand Down Expand Up @@ -41,7 +41,7 @@ export function viteBuildInfo(): Plugin {
callback: (size: string) => {
console.log(
boxen(
gradientString("cyan", "magenta").multiline(
gradient(["cyan", "magenta"]).multiline(
`🎉 恭喜打包完成(总用时${dayjs
.duration(endTime.diff(startTime))
.format("mm分ss秒")},打包后的大小为${size})`
Expand Down
6 changes: 1 addition & 5 deletions build/optimize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ const include = [
* 在预构建中强制排除的依赖项
* 温馨提示:所有以 `@iconify-icons/` 开头引入的的本地图标模块,都应该加入到下面的 `exclude` 里,因为平台推荐的使用方式是哪里需要哪里引入而且都是单个的引入,不需要预构建,直接让浏览器加载就好
*/
const exclude = [
"@iconify-icons/ep",
"@iconify-icons/ri",
"@pureadmin/theme/dist/browser-utils"
];
const exclude = ["@iconify-icons/ep", "@iconify-icons/ri"];

export { include, exclude };
65 changes: 24 additions & 41 deletions build/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import { cdn } from "./cdn";
import vue from "@vitejs/plugin-vue";
import { pathResolve } from "./utils";
import { viteBuildInfo } from "./info";
import svgLoader from "vite-svg-loader";
import type { PluginOption } from "vite";
import checker from "vite-plugin-checker";
import vueJsx from "@vitejs/plugin-vue-jsx";
import electron from "vite-plugin-electron";
import Inspector from "vite-plugin-vue-inspector";
import { configCompressPlugin } from "./compress";
import electron from "vite-plugin-electron/simple";
import removeNoMatch from "vite-plugin-router-warn";
import renderer from "vite-plugin-electron-renderer";
import { visualizer } from "rollup-plugin-visualizer";
import removeConsole from "vite-plugin-remove-console";
import { themePreprocessorPlugin } from "@pureadmin/theme";
import { genScssMultipleScopeVars } from "../src/layout/theme";
import { codeInspectorPlugin } from "code-inspector-plugin";
import { vitePluginFakeServer } from "vite-plugin-fake-server";
import pkg from "../package.json";

Expand All @@ -32,18 +27,16 @@ export function getPluginsList(
vue(),
// jsx、tsx语法支持
vueJsx(),
checker({
typescript: true,
vueTsc: true,
eslint: {
lintCommand: `eslint ${pathResolve("../{src,mock,build}/**/*.{vue,js,ts,tsx}")}`,
useFlatConfig: true
},
terminal: false,
enableBuild: false
/**
* 在页面上按住组合键时,鼠标在页面移动即会在 DOM 上出现遮罩层并显示相关信息,点击一下将自动打开 IDE 并将光标定位到元素对应的代码位置
* Mac 默认组合键 Option + Shift
* Windows 默认组合键 Alt + Shift
* 更多用法看 https://inspector.fe-dev.cn/guide/start.html
*/
codeInspectorPlugin({
bundler: "vite",
hideConsole: true
}),
// 按下Command(⌘)+Shift(⇧),然后点击页面元素会自动打开本地IDE并跳转到对应的代码位置
Inspector(),
viteBuildInfo(),
/**
* 开发环境下移除非必要的vue-router动态路由警告No match found for location with path
Expand All @@ -58,13 +51,6 @@ export function getPluginsList(
infixName: false,
enableProd: command !== "serve" && prodMock
}),
// 自定义主题
themePreprocessorPlugin({
scss: {
multipleScopeVars: genScssMultipleScopeVars(),
extract: true
}
}),
// svg组件化支持
svgLoader(),
VITE_CDN ? cdn : null,
Expand All @@ -78,17 +64,17 @@ export function getPluginsList(
!lifecycle.includes("browser")
? [
// 支持electron
electron([
{
// Main-Process entry file of the Electron App.
electron({
main: {
// Shortcut of `build.lib.entry`
entry: "electron/main/index.ts",
onstart(options) {
onstart({ startup }) {
if (process.env.VSCODE_DEBUG) {
console.log(
/* For `.vscode/.debug.script.mjs` */ "[startup] Electron App"
);
} else {
options.startup();
startup();
}
},
vite: {
Expand All @@ -104,13 +90,8 @@ export function getPluginsList(
}
}
},
{
entry: "electron/preload/index.ts",
onstart(options) {
// Notify the Renderer-Process to reload the page when the Preload-Scripts build is complete,
// instead of restarting the entire Electron App.
options.reload();
},
preload: {
input: "electron/preload/index.ts",
vite: {
build: {
sourcemap: sourcemap ? "inline" : undefined, // #332
Expand All @@ -123,10 +104,12 @@ export function getPluginsList(
}
}
}
}
]),
// Use Node.js API in the Renderer-process
renderer()
},
// Ployfill the Electron and Node.js API for Renderer process.
// If you want use Node.js in Renderer process, the `nodeIntegration` needs to be enabled in the Main process.
// See 👉 https://github.com/electron-vite/vite-plugin-electron-renderer
renderer: {}
})
]
: null
];
Expand Down
11 changes: 6 additions & 5 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
// │ ├─┬ main
// │ │ └── index.js > Electron-Main
// │ └─┬ preload
// │ └── index.js > Preload-Scripts
// │ └── index.mjs > Preload-Scripts
// ├─┬ dist
// │ └── index.html > Electron-Renderer
//
Expand Down Expand Up @@ -49,7 +49,7 @@ if (!app.requestSingleInstanceLock()) {

let win: BrowserWindow | null = null;
// Here, you can also use other preload
const preload = join(__dirname, "../preload/index.js");
const preload = join(__dirname, "../preload/index.mjs");
const url = process.env.VITE_DEV_SERVER_URL;
const indexHtml = join(process.env.DIST, "index.html");

Expand All @@ -70,12 +70,13 @@ async function createWindow() {
title: "Main window",
icon: join(process.env.PUBLIC, "favicon.ico"),
webPreferences: {
preload,
preload
// Warning: Enable nodeIntegration and disable contextIsolation is not secure in production
// nodeIntegration: true,

// Consider using contextBridge.exposeInMainWorld
// Read more on https://www.electronjs.org/docs/latest/tutorial/context-isolation
nodeIntegration: true,
contextIsolation: false
// contextIsolation: false,
}
});

Expand Down
5 changes: 4 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ export default defineFlatConfig([
languageOptions: {
parser: parserTypeScript,
parserOptions: {
sourceType: "module"
sourceType: "module",
warnOnUnsupportedTypeScriptVersion: false
}
},
plugins: {
Expand All @@ -95,6 +96,8 @@ export default defineFlatConfig([
"@typescript-eslint/prefer-as-const": "warn",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-unsafe-function-type": "off",
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/consistent-type-imports": [
Expand Down
6 changes: 5 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -8,6 +8,10 @@
name="viewport"
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
/>
<meta
http-equiv="Content-Security-Policy"
content="script-src 'self' 'unsafe-inline';"
/>
<title>electron-pure-admin</title>
<link rel="icon" href="/favicon.ico" />
<script>
Expand Down
Loading

0 comments on commit 323a8c9

Please sign in to comment.