移除 react

This commit is contained in:
lutinglt
2025-08-05 12:59:23 +08:00
parent 305b2eca0b
commit a1cc1509ce
34 changed files with 9 additions and 33 deletions

2
.github/release.md vendored
View File

@@ -18,4 +18,4 @@
## 🐞 Fix ## 🐞 Fix
- 修复一些圆角问题 - 修复一些圆角问题
- 修复工单下依赖工单选择框的高度对齐 - 修复工单下依赖工单选择框的高度对齐

11
eslint.config.js vendored
View File

@@ -1,6 +1,4 @@
import js from "@eslint/js"; import js from "@eslint/js";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import globals from "globals"; import globals from "globals";
import tseslint from "typescript-eslint"; import tseslint from "typescript-eslint";
@@ -8,17 +6,10 @@ export default tseslint.config(
{ ignores: ["dist"] }, { ignores: ["dist"] },
{ {
extends: [js.configs.recommended, ...tseslint.configs.recommended], extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"], files: ["**/*.{ts}"],
languageOptions: { languageOptions: {
ecmaVersion: 2020, ecmaVersion: 2020,
globals: globals.browser, globals: globals.browser,
}, },
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
},
} }
); );

View File

@@ -1,6 +1,6 @@
{ {
"name": "gitea-github-theme", "name": "gitea-github-theme",
"version": "1.24.2", "version": "1.24.4",
"description": "A theme to make Gitea look and feel like GitHub", "description": "A theme to make Gitea look and feel like GitHub",
"type": "module", "type": "module",
"scripts": { "scripts": {
@@ -12,35 +12,26 @@
"version": "node scripts/version.cjs" "version": "node scripts/version.cjs"
}, },
"devDependencies": { "devDependencies": {
"@babel/preset-react": "^7.27.1",
"@babel/preset-typescript": "^7.27.1", "@babel/preset-typescript": "^7.27.1",
"@eslint/js": "^9.29.0", "@eslint/js": "^9.29.0",
"@linaria/core": "^6.3.0", "@linaria/core": "^6.3.0",
"@linaria/react": "^6.3.0",
"@types/node": "^24.0.3", "@types/node": "^24.0.3",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@vanilla-extract/css": "^1.17.4", "@vanilla-extract/css": "^1.17.4",
"@vanilla-extract/vite-plugin": "^5.0.6", "@vanilla-extract/vite-plugin": "^5.0.6",
"@vitejs/plugin-react": "^4.5.2",
"@vitejs/plugin-react-swc": "^3.10.2",
"@wyw-in-js/babel-preset": "^0.7.0", "@wyw-in-js/babel-preset": "^0.7.0",
"@wyw-in-js/vite": "^0.7.0", "@wyw-in-js/vite": "^0.7.0",
"dotenv": "^17.0.0", "dotenv": "^17.0.0",
"eslint": "^9.29.0", "eslint": "^9.29.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.2.0", "globals": "^16.2.0",
"lightningcss": "^1.30.1", "lightningcss": "^1.30.1",
"polished": "^4.3.1", "polished": "^4.3.1",
"prettier": "3.5.3", "prettier": "3.5.3",
"prettier-plugin-organize-imports": "^4.1.0", "prettier-plugin-organize-imports": "^4.1.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"sass-embedded": "^1.89.2", "sass-embedded": "^1.89.2",
"typescript": "^5.8.3", "typescript": "^5.8.3",
"typescript-eslint": "^8.34.1", "typescript-eslint": "^8.34.1",
"typescript-plugin-css-modules": "^5.1.0", "typescript-plugin-css-modules": "^5.1.0",
"typescript-styled-plugin": "^0.18.3",
"vite": "^6.3.5" "vite": "^6.3.5"
}, },
"prettier": { "prettier": {
@@ -62,8 +53,5 @@
"prettier-plugin-organize-imports" "prettier-plugin-organize-imports"
], ],
"organizeImportsSkipDestructiveCodeActions": false "organizeImportsSkipDestructiveCodeActions": false
},
"dependencies": {
"typescript-styled-plugin": "^0.18.3"
} }
} }

View File

@@ -4,7 +4,7 @@ import fs from "node:fs";
import path from "node:path"; import path from "node:path";
import type { Plugin } from "vite"; import type { Plugin } from "vite";
const suffix = ".css.tsx"; const suffix = ".css.ts";
/** /**
* 生成主题输入 * 生成主题输入

View File

@@ -162,8 +162,8 @@ export const selectionDropdown = css`
// 修复选择框的下拉菜单向上显示时的样式问题 // 修复选择框的下拉菜单向上显示时的样式问题
.ui.upward.selection.dropdown.visible:not(.small), .ui.upward.selection.dropdown.visible:not(.small),
.ui.active.upward.selection.dropdown:not(.small) { .ui.active.upward.selection.dropdown:not(.small) {
border-top-left-radius: ${otherThemeVars.border.radius}!important; border-top-left-radius: ${otherThemeVars.border.radius} !important;
border-top-right-radius: ${otherThemeVars.border.radius}!important; border-top-right-radius: ${otherThemeVars.border.radius} !important;
} }
`; `;

View File

@@ -23,7 +23,6 @@
"verbatimModuleSyntax": true, "verbatimModuleSyntax": true,
"moduleDetection": "force", "moduleDetection": "force",
"noEmit": true, "noEmit": true,
"jsx": "react-jsx",
/* Linting */ /* Linting */
"strict": true, "strict": true,
"noUnusedLocals": true, "noUnusedLocals": true,

View File

@@ -1,5 +1,4 @@
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin"; import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
import react from "@vitejs/plugin-react";
import linaria from "@wyw-in-js/vite"; import linaria from "@wyw-in-js/vite";
import * as dotenv from "dotenv"; import * as dotenv from "dotenv";
import { Features } from "lightningcss"; import { Features } from "lightningcss";
@@ -24,7 +23,7 @@ export default defineConfig(({ mode }) => {
styles: path.resolve(__dirname, "styles"), styles: path.resolve(__dirname, "styles"),
themes: path.resolve(__dirname, "themes"), themes: path.resolve(__dirname, "themes"),
}, },
extensions: [".js", ".jsx", ".ts", ".tsx", ".css.tsx"], extensions: [".js", ".ts", ".css.ts"],
}, },
css: { css: {
transformer: "lightningcss", transformer: "lightningcss",
@@ -37,14 +36,13 @@ export default defineConfig(({ mode }) => {
linaria({ linaria({
include: ["**/*.{ts,tsx}"], include: ["**/*.{ts,tsx}"],
babelOptions: { babelOptions: {
presets: ["@babel/preset-typescript", "@babel/preset-react"], presets: ["@babel/preset-typescript"],
}, },
preprocessor: (_selector, cssText) => sass.compileString(cssText).css, // 默认为全局样式并使用 sass-embedded 预处理 css preprocessor: (_selector, cssText) => sass.compileString(cssText).css, // 默认为全局样式并使用 sass-embedded 预处理 css
tagResolver: (source, tag) => tagResolver: (source, tag) =>
// 识别从 src 导出的 css 标签,使用 @linaria/core/processors/css 处理 // 识别从 src 导出的 css 标签,使用 @linaria/core/processors/css 处理
source === "src/types/vars" && tag === "css" ? require.resolve("@linaria/core/processors/css") : null, source === "src/types/vars" && tag === "css" ? require.resolve("@linaria/core/processors/css") : null,
}), }),
react(),
vanillaExtractPlugin(), vanillaExtractPlugin(),
themePlugin(), themePlugin(),
], ],