refactor: 将前端代码模块化

This commit is contained in:
wushuo
2025-12-12 13:10:50 +08:00
parent ec7f7f2efe
commit b2a2ab28a5
92 changed files with 97 additions and 19 deletions

View File

@@ -84,7 +84,7 @@
<supportUrl>https://whichjdk.com/</supportUrl>
<stayAlive>false</stayAlive>
<restartOnCrash>false</restartOnCrash>
<icon>${project.parent.basedir}/ui/public/favicon.ico</icon>
<icon>${project.parent.basedir}/ani-rss-ui/public/favicon.ico</icon>
<jre>
<path>jre/bin;%JAVA_HOME%/bin;%PATH%</path>
<minVersion>17</minVersion>

View File

@@ -22,3 +22,4 @@ dist-ssr
*.njsproj
*.sln
*.sw?
node

84
ani-rss-ui/pom.xml Normal file
View File

@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ani.rss</groupId>
<artifactId>ani-rss</artifactId>
<version>2.4.15</version>
</parent>
<artifactId>ani-rss-ui</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.6.2</version>
<executions>
<execution>
<phase>clean</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>rm</executable>
<arguments>
<argument>-rf</argument>
<argument>./dist</argument>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.15.4</version>
<configuration>
<workingDirectory>${project.parent.basedir}/ani-rss-ui</workingDirectory>
</configuration>
<executions>
<execution>
<id>install node and pnpm</id>
<goals>
<goal>install-node-and-pnpm</goal>
</goals>
<configuration>
<nodeVersion>v25.2.1</nodeVersion>
<pnpmVersion>10.4.1</pnpmVersion>
</configuration>
</execution>
<execution>
<id>install</id>
<goals>
<goal>pnpm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>build</id>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -4,7 +4,7 @@
base_path=$(pwd)
# ui 位置
ui_path=${base_path}/ui
ui_path=${base_path}/ani-rss-ui
# ani-rss-application 路径
application_path=${base_path}/ani-rss-application
# dist 位置
@@ -26,10 +26,17 @@ GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m'
cd ${ui_path}
mvn -B install -DskipTests --file pom.xml
if [ $? -eq 1 ]; then
echo -e "${RED}web编译失败${NC}"
exit 1
fi
echo -e "${GREEN}web编译完成${NC}"
if [ -d ${dist_path} ]; then
echo -e "${YELLOW}清理 ${dist_path}${NC}"
rm -rf ${dist_path}/*
@@ -38,21 +45,6 @@ else
mkdir -p ${dist_path}
fi
if ! command -v pnpm >/dev/null 2>&1; then
echo -e "${YELLOW}正在安装 pnpm ...${NC}"
npm install pnpm -g
fi
pnpm install
pnpm run build
if [ $? -eq 1 ]; then
echo -e "${RED}web编译失败${NC}"
exit 1
fi
echo -e "${GREEN}web编译完成${NC}"
cp -r dist/* ${dist_path}
if [ ! -e ${update_exe_path} ]; then

View File

@@ -17,6 +17,7 @@
<module>ani-rss-web</module>
<module>ani-rss-core</module>
<module>ani-rss-api</module>
<module>ani-rss-ui</module>
</modules>
<inceptionYear>2025</inceptionYear>
<description>基于RSS自动追番、订阅、下载、刮削</description>