打包管理

This commit is contained in:
朱浩 2025-01-08 13:45:40 +08:00
parent 1132dc2c0d
commit 510f02a530
8 changed files with 68 additions and 8 deletions

View File

@ -1,6 +1,8 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 文枢课堂 VITE_APP_TITLE = 文枢课堂
VITE_APP_ID = 'aix-win-ws'
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'production' VITE_APP_ENV = 'production'

View File

@ -1,5 +1,7 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 文枢课堂 VITE_APP_TITLE = 永川中小学AI教学系统
VITE_APP_ID = 'aix-win-ws-yc'
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'production' VITE_APP_ENV = 'production'

View File

@ -1,6 +1,8 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 实训教学 VITE_APP_TITLE = 实训教学
VITE_APP_ID = 'aix-win-ws-yc2'
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'production' VITE_APP_ENV = 'production'

View File

@ -17,7 +17,7 @@ asarUnpack:
nsis: nsis:
oneClick: false oneClick: false
allowToChangeInstallationDirectory: true allowToChangeInstallationDirectory: true
artifactName: ${name}-yc-${version}-setup.${ext} artifactName: ${name}-${version}-setup.${ext}
shortcutName: ${productName} shortcutName: ${productName}
uninstallDisplayName: ${productName} uninstallDisplayName: ${productName}
createDesktopShortcut: always createDesktopShortcut: always

View File

@ -17,7 +17,7 @@ asarUnpack:
nsis: nsis:
oneClick: false oneClick: false
allowToChangeInstallationDirectory: true allowToChangeInstallationDirectory: true
artifactName: ${name}-ycsx-${version}-setup.${ext} artifactName: ${name}-${version}-setup.${ext}
shortcutName: ${productName} shortcutName: ${productName}
uninstallDisplayName: ${productName} uninstallDisplayName: ${productName}
createDesktopShortcut: always createDesktopShortcut: always

View File

@ -10,14 +10,13 @@
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
"start": "electron-vite preview", "start": "electron-vite preview",
"dev": "electron-vite dev", "dev": "electron-vite dev",
"build": "electron-vite build",
"postinstall": "electron-builder install-app-deps", "postinstall": "electron-builder install-app-deps",
"build:unpack": "npm run build && electron-builder --dir", "build:unpack": "npm run build && electron-builder --dir",
"build:dev": "npm run build && electron-builder --win --config ./electron-builder-test.yml", "build:dev": "npm run build && electron-builder --win --config ./electron-builder-test.yml",
"build:test": "electron-vite build --mode test && electron-builder --win --config ./electron-builder.yml", "build:test": "node updatePackageJsonName.js && electron-vite build --mode test && electron-builder --win --config ./electron-builder.yml",
"build:prod": "electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml", "build": "node updatePackageJsonName.js && electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml",
"build:yc": "electron-vite build --mode yc && electron-builder --win --config ./electron-builder-yc.yml", "build:yc": "node updatePackageJsonName.js && electron-vite build --mode yc && electron-builder --win --config ./electron-builder-yc.yml",
"build:yc2": "electron-vite build --mode yc2 && electron-builder --win --config ./electron-builder-yc2.yml", "build:yc2": "node updatePackageJsonName.js && electron-vite build --mode yc2 && electron-builder --win --config ./electron-builder-yc2.yml",
"build:lt": "electron-vite build --mode lt && electron-builder --win --config ./electron-builder-lt.yml", "build:lt": "electron-vite build --mode lt && electron-builder --win --config ./electron-builder-lt.yml",
"build:mac": "electron-vite build --mode production && electron-builder --mac --config ./electron-builder-prod.yml", "build:mac": "electron-vite build --mode production && electron-builder --mac --config ./electron-builder-prod.yml",
"build:linux": "npm run build && electron-builder --linux" "build:linux": "npm run build && electron-builder --linux"

View File

@ -407,11 +407,52 @@ export const dataSetJson = {
"教材-高中-数学": "e03aa4fe9fd011ef91270242ac140006", "教材-高中-数学": "e03aa4fe9fd011ef91270242ac140006",
"教材-高中-地理": "270516829fd111efb13c0242ac140006", "教材-高中-地理": "270516829fd111efb13c0242ac140006",
"教材-高中-政治": "a2f0b247b85d11ef84290242ac140005", "教材-高中-政治": "a2f0b247b85d11ef84290242ac140005",
"考试-小学-语文": "570f7ed2cc9d11ef9e070242ac140002",
"考试-小学-数学": "983270b8cc9d11efbbd80242ac140002",
"考试-小学-英语": "d5f80e4ccc9d11ef96fa0242ac140002",
"课标-小学-科学": "935cfec8bf6a11ef98950242ac140006", "课标-小学-科学": "935cfec8bf6a11ef98950242ac140006",
"课标-小学-数学": "3c4e298fbf7911ef8e8b0242ac140002", "课标-小学-数学": "3c4e298fbf7911ef8e8b0242ac140002",
"课标-小学-语文": "f76f1aa5bf7111ef90c80242ac140002", "课标-小学-语文": "f76f1aa5bf7111ef90c80242ac140002",
"课标-小学-道德": "8da87869cbd711ef92280242ac140002",
"课标-小学-英语": "dc963316cbd811ef8d820242ac140002",
"课标-小学-劳动": "fc047d81cbdc11efa1740242ac140002",
"教材-小学-科学": "935cfec8bf6a11ef98950242ac140006", "教材-小学-科学": "935cfec8bf6a11ef98950242ac140006",
"教材-小学-数学": "3c4e298fbf7911ef8e8b0242ac140002", "教材-小学-数学": "3c4e298fbf7911ef8e8b0242ac140002",
"教材-小学-语文": "f76f1aa5bf7111ef90c80242ac140002", "教材-小学-语文": "f76f1aa5bf7111ef90c80242ac140002",
"教材-小学-道德": "8da87869cbd711ef92280242ac140002",
"教材-小学-英语": "dc963316cbd811ef8d820242ac140002",
"教材-小学-劳动": "fc047d81cbdc11efa1740242ac140002",
"教材-初中-道德与法治": "df9f3ccccbdd11ef9e550242ac140002",
"教材-初中-语文": "3770ad18cbde11efadaa0242ac140002",
"教材-初中-数学": "8cc0a799cbde11ef8b440242ac140002",
"教材-初中-英语": "07b58ca2cbdf11efaa180242ac140002",
"教材-初中-物理": "86f2c018cbf211ef9d6a0242ac140002",
"教材-初中-化学": "c7b34790cbf211ef92350242ac140002",
"教材-初中-生物": "083ac3edcbf311efaad30242ac140002",
"教材-初中-地理": "7ee584e1cbf311efbd270242ac140002",
"教材-初中-历史": "8ae07971cbf411ef81e70242ac140002",
"教材-初中-信息技术": "ca476233cbf411efa9860242ac140002",
"课标-初中-道德与法治": "df9f3ccccbdd11ef9e550242ac140002",
"课标-初中-语文": "3770ad18cbde11efadaa0242ac140002",
"课标-初中-数学": "8cc0a799cbde11ef8b440242ac140002",
"课标-初中-英语": "07b58ca2cbdf11efaa180242ac140002",
"课标-初中-物理": "86f2c018cbf211ef9d6a0242ac140002",
"课标-初中-化学": "c7b34790cbf211ef92350242ac140002",
"课标-初中-生物": "083ac3edcbf311efaad30242ac140002",
"课标-初中-地理": "7ee584e1cbf311efbd270242ac140002",
"课标-初中-历史": "8ae07971cbf411ef81e70242ac140002",
"课标-初中-信息技术": "ca476233cbf411efa9860242ac140002",
"考试-初中-语文": "6be6d201cc0111ef89100242ac140002",
"考试-初中-数学": "d764b539cc0111ef8f1b0242ac140002",
"考试-初中-英语": "3477cff7cc9911efbfa50242ac140002",
"考试-初中-政治": "7ac981d8cc9a11efa5dc0242ac140002",
"考试-初中-历史": "c058a33acc9a11efb7f00242ac140002",
"考试-初中-地理": "5548224ecc9b11efa76d0242ac140002",
"考试-初中-生物": "206c5fd3cc9c11ef990f0242ac140002",
"考试-初中-物理": "93039442cc9c11ef89b10242ac140002",
"考试-初中-化学": "f8d78002cc9c11efbbf60242ac140002",
"鉴权": "ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm" "鉴权": "ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm"
} }

14
updatePackageJsonName.js Normal file
View File

@ -0,0 +1,14 @@
const fs = require('fs');
const path = require('path');
const { env } = require('process');
// 读取当前的package.json文件
const packageJsonPath = path.join(__dirname, 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
console.log(env)
let res = env.npm_lifecycle_event.replace("build", "").replace(":", "");
res = res?"-" + res:"";
packageJson.name = "aix-win-ws" + res
// 将修改后的内容写回package.json文件
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));