Migrate to vp/vite-plus toolchain and update configs
Replace ESLint/Prettier/Husky workflow with vp (vite-plus) tooling: remove .eslintrc.cjs and prettier.config.js, drop husky pre-commit and add .vite-hooks/pre-commit (vp staged). Update package.json scripts to use vp commands, bump @halo-dev/theme-package-cli, replace vite with @voidzero-dev/vite-plus-core alias and add vite-plus, and add pnpm settings/overrides and packageManager update. Add VS Code recommendations and formatter settings, expose .vscode/settings.json in .gitignore, and adjust CI to use Node 24. Update README link and small formatting fixes. Regenerate pnpm lockfile to reflect dependency changes and other config updates; templates and vite config were also modified.
This commit is contained in:
@@ -1,14 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
parser: "@typescript-eslint/parser",
|
|
||||||
plugins: ["@typescript-eslint", "prettier"],
|
|
||||||
extends: [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended",
|
|
||||||
"prettier",
|
|
||||||
],
|
|
||||||
env: {
|
|
||||||
node: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -18,4 +18,4 @@ jobs:
|
|||||||
skip-appstore-release: true
|
skip-appstore-release: true
|
||||||
app-id: app-foo
|
app-id: app-foo
|
||||||
pnpm-version: 10
|
pnpm-version: 10
|
||||||
node-version: 20
|
node-version: 24
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ dist-ssr
|
|||||||
# Editor directories and files
|
# Editor directories and files
|
||||||
.vscode/*
|
.vscode/*
|
||||||
!.vscode/extensions.json
|
!.vscode/extensions.json
|
||||||
|
!.vscode/settings.json
|
||||||
.idea
|
.idea
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.suo
|
*.suo
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
npx lint-staged
|
|
||||||
Executable
+1
@@ -0,0 +1 @@
|
|||||||
|
vp staged
|
||||||
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"recommendations": ["VoidZero.vite-plus-extension-pack"]
|
||||||
|
}
|
||||||
Vendored
+9
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"editor.defaultFormatter": "oxc.oxc-vscode",
|
||||||
|
"oxc.fmt.configPath": "./vite.config.ts",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.formatOnSaveMode": "file",
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.oxc": "explicit"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
一个集成了 Vite 的主题快速开始模板。
|
一个集成了 Vite 的主题快速开始模板。
|
||||||
|
|
||||||
主题开发文档可查阅:<https://docs.halo.run/2.0.0-SNAPSHOT/developer-guide/theme/prepare>
|
主题开发文档可查阅:<https://docs.halo.run/developer-guide/theme/prepare>
|
||||||
|
|
||||||
## 开发
|
## 开发
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ cd ~/halo2-dev/themes/theme-vite-starter
|
|||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm install
|
pnpm install
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
+20
-23
@@ -1,31 +1,28 @@
|
|||||||
{
|
{
|
||||||
"license": "GPL-3.0",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc && vite build && theme-package",
|
"build": "tsc && vp build && theme-package",
|
||||||
"build-only": "tsc && vite build",
|
"build-only": "tsc && vp build",
|
||||||
"dev": "vite build --watch",
|
"dev": "vp build --watch",
|
||||||
"lint": "eslint ./src --ext .js,.cjs,.mjs,.ts,.cts,.mts --ignore-path .gitignore",
|
"lint": "vp lint",
|
||||||
"prepare": "husky",
|
"prepare": "vp config",
|
||||||
"prettier": "prettier --write './**/*.{ts,json,yaml,yml,html}'"
|
"fmt": "vp fmt"
|
||||||
},
|
|
||||||
"lint-staged": {
|
|
||||||
"*.{ts,json,yaml,yml,html}": [
|
|
||||||
"prettier --write"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@halo-dev/theme-package-cli": "^1.0.0",
|
"@halo-dev/theme-package-cli": "^1.0.1",
|
||||||
"@types/node": "18.11.9",
|
"@types/node": "18.11.9",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
||||||
"@typescript-eslint/parser": "^5.62.0",
|
|
||||||
"eslint": "^8.57.1",
|
|
||||||
"eslint-config-prettier": "^8.10.0",
|
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
|
||||||
"husky": "^9.1.7",
|
|
||||||
"lint-staged": "^15.5.0",
|
|
||||||
"prettier": "^2.8.8",
|
|
||||||
"typescript": "^4.9.5",
|
"typescript": "^4.9.5",
|
||||||
"vite": "^5.4.16"
|
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
||||||
|
"vite-plus": "latest"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.6.5+sha512.cdf928fca20832cd59ec53826492b7dc25dc524d4370b6b4adbf65803d32efaa6c1c88147c0ae4e8d579a6c9eec715757b50d4fa35eea179d868eada4ed043af"
|
"packageManager": "pnpm@10.32.1",
|
||||||
|
"pnpm": {
|
||||||
|
"onlyBuiltDependencies": [
|
||||||
|
"esbuild"
|
||||||
|
],
|
||||||
|
"overrides": {
|
||||||
|
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
||||||
|
"vitest": "npm:@voidzero-dev/vite-plus-test@latest"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+1196
-2315
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
printWidth: 120,
|
|
||||||
tabWidth: 2,
|
|
||||||
useTabs: false,
|
|
||||||
endOfLine: "lf",
|
|
||||||
};
|
|
||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite-plus/client" />
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{modules/layout :: html(content = ~{::content})}">
|
<html
|
||||||
|
xmlns:th="https://www.thymeleaf.org"
|
||||||
|
th:replace="~{modules/layout :: html(content = ~{::content})}"
|
||||||
|
>
|
||||||
<th:block th:fragment="content">
|
<th:block th:fragment="content">
|
||||||
<ul>
|
<ul>
|
||||||
<li th:each="post : ${posts.items}">
|
<li th:each="post : ${posts.items}">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en" th:fragment="html (content)">
|
<html lang="en" th:fragment="html (content)">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
|
|||||||
+5
-2
@@ -1,5 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{modules/layout :: html(content = ~{::content})}">
|
<html
|
||||||
|
xmlns:th="https://www.thymeleaf.org"
|
||||||
|
th:replace="~{modules/layout :: html(content = ~{::content})}"
|
||||||
|
>
|
||||||
<th:block th:fragment="content">
|
<th:block th:fragment="content">
|
||||||
<article th:utext="${post.content.content}"></article>
|
<article th:utext="${post.content.content}"></article>
|
||||||
</th:block>
|
</th:block>
|
||||||
|
|||||||
+18
-3
@@ -1,16 +1,31 @@
|
|||||||
import { defineConfig } from "vite";
|
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
|
|
||||||
|
import { defineConfig } from "vite-plus";
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
outDir: fileURLToPath(new URL("./templates/assets/dist", import.meta.url)),
|
outDir: fileURLToPath(new URL("./templates/assets/dist", import.meta.url)),
|
||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
lib: {
|
lib: {
|
||||||
entry: path.resolve(__dirname, "src/main.ts"),
|
entry: path.resolve(process.cwd(), "src/main.ts"),
|
||||||
name: "main",
|
name: "main",
|
||||||
fileName: "main",
|
fileName: "main",
|
||||||
formats: ["iife"],
|
formats: ["iife"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
lint: { options: { typeAware: true, typeCheck: true } },
|
||||||
|
fmt: {
|
||||||
|
printWidth: 100,
|
||||||
|
tabWidth: 2,
|
||||||
|
useTabs: false,
|
||||||
|
endOfLine: "lf",
|
||||||
|
sortPackageJson: true,
|
||||||
|
insertFinalNewline: true,
|
||||||
|
sortImports: {},
|
||||||
|
ignorePatterns: [],
|
||||||
|
},
|
||||||
|
staged: {
|
||||||
|
"*": ["vp check"],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user