Bump tooling, add check script, remove templates

Upgrade developer toolchain and clean up project files: add a new "check" script (replacing previous lint/fmt), bump TypeScript and add @halo-dev/vite-plugin-halo-theme, update pnpm packageManager version, remove legacy templates HTML files and add "templates" to .gitignore, and apply related changes to vite.config.ts. The lockfile was updated to reflect dependency changes.
This commit is contained in:
Ryan Wang
2026-04-02 23:06:27 +08:00
parent eaaf71a8bf
commit 2ae2ec231a
7 changed files with 574 additions and 311 deletions
+2 -1
View File
@@ -25,4 +25,5 @@ dist-ssr
*.sw? *.sw?
.gradle .gradle
build build
templates
+5 -5
View File
@@ -4,18 +4,18 @@
"build": "tsc && vp build && theme-package", "build": "tsc && vp build && theme-package",
"build-only": "tsc && vp build", "build-only": "tsc && vp build",
"dev": "vp build --watch", "dev": "vp build --watch",
"lint": "vp lint", "check": "vp check --fix",
"prepare": "vp config", "prepare": "vp config"
"fmt": "vp fmt"
}, },
"devDependencies": { "devDependencies": {
"@halo-dev/theme-package-cli": "^1.0.1", "@halo-dev/theme-package-cli": "^1.0.1",
"@halo-dev/vite-plugin-halo-theme": "^1.0.3",
"@types/node": "18.11.9", "@types/node": "18.11.9",
"typescript": "^4.9.5", "typescript": "^5.9.3",
"vite": "npm:@voidzero-dev/vite-plus-core@latest", "vite": "npm:@voidzero-dev/vite-plus-core@latest",
"vite-plus": "latest" "vite-plus": "latest"
}, },
"packageManager": "pnpm@10.32.1", "packageManager": "pnpm@10.33.0",
"pnpm": { "pnpm": {
"onlyBuiltDependencies": [ "onlyBuiltDependencies": [
"esbuild" "esbuild"
+564 -256
View File
File diff suppressed because it is too large Load Diff
-13
View File
@@ -1,13 +0,0 @@
<!doctype html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(content = ~{::content})}"
>
<th:block th:fragment="content">
<ul>
<li th:each="post : ${posts.items}">
<a th:text="${post.spec.title}" th:href="${post.status.permalink}"></a>
</li>
</ul>
</th:block>
</html>
-14
View File
@@ -1,14 +0,0 @@
<!doctype html>
<html lang="en" th:fragment="html (content)">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title th:text="${site.title}"></title>
<link rel="stylesheet" th:href="@{/assets/dist/style.css}" href="./assets/dist/style.css" />
<script th:src="@{/assets/dist/main.iife.js}"></script>
</head>
<body th:style="'background-color: '+${theme.config.styles.background_color}">
<th:block th:replace="${content}" />
</body>
</html>
-9
View File
@@ -1,9 +0,0 @@
<!doctype html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(content = ~{::content})}"
>
<th:block th:fragment="content">
<article th:utext="${post.content.content}"></article>
</th:block>
</html>
+3 -13
View File
@@ -1,19 +1,8 @@
import path from "path"; import { haloThemePlugin } from "@halo-dev/vite-plugin-halo-theme";
import { fileURLToPath } from "url";
import { defineConfig } from "vite-plus"; import { defineConfig } from "vite-plus";
export default defineConfig({ export default defineConfig({
build: { plugins: [haloThemePlugin()],
outDir: fileURLToPath(new URL("./templates/assets/dist", import.meta.url)),
emptyOutDir: true,
lib: {
entry: path.resolve(process.cwd(), "src/main.ts"),
name: "main",
fileName: "main",
formats: ["iife"],
},
},
lint: { options: { typeAware: true, typeCheck: true } }, lint: { options: { typeAware: true, typeCheck: true } },
fmt: { fmt: {
printWidth: 100, printWidth: 100,
@@ -23,6 +12,7 @@ export default defineConfig({
sortPackageJson: true, sortPackageJson: true,
insertFinalNewline: true, insertFinalNewline: true,
sortImports: {}, sortImports: {},
sortTailwindcss: {},
ignorePatterns: [], ignorePatterns: [],
}, },
staged: { staged: {