no message

This commit is contained in:
kuaifan 2025-03-05 15:19:38 +08:00
parent e2718a39a0
commit 1752e88c42
3 changed files with 88 additions and 77 deletions

115
electron/build.js vendored
View File

@ -492,12 +492,9 @@ async function startBuild(data) {
console.log("版本:", config.version + ` (${config.codeVerson})`);
console.log("系统:", platform.replace('build-', '').toUpperCase());
console.log("架构:", archs.map(arch => arch.toUpperCase()).join(', '));
console.log("发布:", publish ? '是' : '否');
if (publish) {
console.log("升级提示:", release ? '是' : '否');
if (platform === 'build-mac') {
console.log("公证:", notarize ? '是' : '否');
}
console.log("发布:", publish ? `是(${release ? '升级提示' : '静默升级'}` : '否');
if (platform === 'build-mac') {
console.log("公证:", notarize ? '是' : '否');
}
console.log("===============\n");
// drawio
@ -707,14 +704,13 @@ if (["dev"].includes(argv[2])) {
{
name: "MacOS",
value: platforms[0],
checked: true
},
{
name: "Windows",
value: platforms[1]
}
],
validate: function(answer) {
validate: (answer) => {
if (answer.length < 1) {
return '请至少选择一个系统';
}
@ -725,18 +721,26 @@ if (["dev"].includes(argv[2])) {
type: 'checkbox',
name: 'arch',
message: "选择系统架构",
choices: [
{
name: "arm64",
value: architectures[0],
checked: true
},
{
name: "x64",
value: architectures[1]
choices: ({platform}) => {
const array = [
{
name: "arm64",
value: architectures[0],
},
{
name: "x64",
value: architectures[1]
}
]
if (platform.find(item => item === 'build-mac')) {
array.push({
name: "通用" + (platform.length > 1 ? " (仅MacOS)" : ""),
value: 'universal'
})
}
],
validate: function(answer) {
return array;
},
validate: (answer) => {
if (answer.length < 1) {
return '请至少选择一个架构';
}
@ -754,28 +758,25 @@ if (["dev"].includes(argv[2])) {
name: "是",
value: true
}]
}
];
// 根据publish选项动态添加后续问题
const publishQuestions = [
},
{
type: 'list',
name: 'release',
message: "选择是否弹出升级提示框",
message: "选择升级方式",
when: ({publish}) => publish,
choices: [{
name: "",
name: "弹出提示",
value: true
}, {
name: "",
name: "静默",
value: false
}]
},
{
type: 'list',
name: 'notarize',
message: "选择是否需要公证MacOS应用",
when: (answers) => answers.platform === 'build-mac', // 只在MacOS时显示
message: ({platform}) => platform.length > 1 ? "选择是否需要公证应用(仅MacOS" : "选择是否需要公证应用",
when: ({platform}) => platform.find(item => item === 'build-mac'),
choices: [{
name: "否",
value: false
@ -786,42 +787,44 @@ if (["dev"].includes(argv[2])) {
}
];
// 先询问基本问题
inquirer.prompt(questions).then(async answers => {
// 如果选择发布,继续询问发布相关问题
if (answers.publish) {
const publishAnswers = await inquirer.prompt(publishQuestions);
Object.assign(answers, publishAnswers);
// 开始提问
const prompt = inquirer.createPromptModule();
prompt(questions)
.then(async answers => {
answers = Object.assign({
release: false,
notarize: false
}, answers);
if (!PUBLISH_KEY && (!GITHUB_TOKEN || !utils.strExists(GITHUB_REPOSITORY, "/"))) {
console.error("发布需要 PUBLISH_KEY 或 GitHub Token 和 Repository, 请检查环境变量!");
process.exit()
// 发布判断环境变量
if (answers.publish) {
if (!PUBLISH_KEY && (!GITHUB_TOKEN || !utils.strExists(GITHUB_REPOSITORY, "/"))) {
console.error("发布需要 PUBLISH_KEY 或 GitHub Token 和 Repository, 请检查环境变量!");
process.exit()
}
}
// 公证判断环境变量
if (answers.notarize === true) {
if (!APPLEID || !APPLEIDPASS) {
console.error("公证MacOS应用需要 Apple ID 和 Apple ID 密码, 请检查环境变量!");
process.exit()
}
}
} else {
// 如果不发布,设置默认值
answers.release = false;
answers.notarize = false;
}
// 开始构建
for (const platform of answers.platform) {
for (const data of config.app) {
data.configure = {
platform,
archs: answers.arch,
publish: answers.publish,
release: answers.release,
notarize: answers.notarize
};
await startBuild(data);
// 开始构建
for (const platform of answers.platform) {
for (const data of config.app) {
data.configure = {
platform,
archs: answers.arch,
publish: answers.publish,
release: answers.release,
notarize: answers.notarize
};
await startBuild(data);
}
}
}
});
})
.catch(_ => { });
}

View File

@ -12,5 +12,7 @@
<true/>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
</dict>
</plist>

View File

@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "1.0.0",
"version": "0.43.73",
"description": "DooTask is task management system.",
"main": "electron.js",
"license": "MIT",
@ -36,7 +36,7 @@
"electron-builder": "^25.1.8",
"electron-notarize": "^1.2.2",
"form-data": "^4.0.1",
"inquirer": "^8.2.0",
"inquirer": "^12.4.2",
"ora": "^4.1.1"
},
"dependencies": {
@ -66,10 +66,10 @@
},
"build": {
"appId": "com.dootask.task",
"artifactName": "${productName}-v${version}-${os}-${arch}.${ext}",
"artifactName": "DooTask-v${version}-${os}-${arch}.${ext}",
"asar": true,
"directories": {
"output": "dist"
"output": "dist/com-dootask-task/build-mac-generic"
},
"files": [
"render/**/*",
@ -83,14 +83,19 @@
{
"from": "updater/${os}/${arch}",
"to": "Resources/updater",
"filter": ["**/*"]
"filter": [
"**/*"
]
}
],
"npmRebuild": false,
"publish": {
"provider": "generic"
"provider": "generic",
"url": "https://www.dootask.com/desktop/publish"
},
"releaseInfo": {
"releaseNotes": "## [0.43.73-Silence]\n\n### Bug Fixes\n\n- 全屏预览图片关闭窗口\n- 点击排序导致任务不显示的情况\n\n### Performance\n\n- 新增录音转文字\n- 优化数据排序\n\n## [0.43.49]\n\n### Performance\n\n- 添加全局搜索功能\n- 优化消息搜索\n- 团队管理支持调整部门区域尺寸\n- 任务详情支持调整聊天区域尺寸\n- 优化团队部门支持3级部门\n- 可见群组ID\n- 支持在团队管理打开群聊\n- 优化回复消息自动@逻辑\n- 转发预览隐藏表情回应部分\n- 优化任务日志\n- 已删除任务支持按标签搜索\n- 归档任务支持按标签搜索\n- 项目面板添加按标签筛选\n- 优化 AI 提示词\n- 优化 AI 设置\n\n## [0.43.18]\n\n### Bug Fixes\n\n- 首次跟ai聊天没有记录的问题\n\n### Performance\n\n- 工作报告支持查看仅未读\n- AI 支持引用文件\n- 优化图文消息\n- 优化文本信息复制\n- 优化样式\n- 无法再AI机器人页面看到模型的问题\n\n## [0.43.7]\n\n### Features\n\n- 添加 Grok AI、Ollama AI\n\n### Performance\n\n- 优化MD消息过长处理\n- 优化AI支持分析指定文件\n- 支持在AI对话中直接引用任务提问\n- 优化 AI 参数\n- 优化 Ollama AI\n- 优化设置\n- 优化AI设置\n- 优化AI消息\n\n## [0.42.85]\n\n### Bug Fixes\n\n- 撤回消息是消息列表不更新的情况\n\n### Performance\n\n- 表情回复时更新对话列表\n- Onlyoffice 支持打开超过100m的文件\n- 优化点击上传列表效果\n- AI支持自定义模型列表\n\n"
},
"releaseInfo": {},
"mac": {
"icon": "../resources/assets/statics/public/images/logo-app.png",
"entitlements": "entitlements.plist",
@ -99,16 +104,18 @@
"target": [
{
"target": "zip",
"arch": [
"x64",
"arm64"
]
"arch": []
},
{
"target": "dmg",
"arch": [
"x64",
"arm64"
"universal"
]
},
{
"target": "pkg",
"arch": [
"universal"
]
}
]
@ -118,19 +125,17 @@
"target": [
{
"target": "nsis",
"arch": [
"x64",
"arm64"
]
"arch": []
}
],
"verifyUpdateCodeSignature": false
},
"nsis": {
"oneClick": false,
"artifactName": "${productName}-v${version}-${os}-${arch}.${ext}",
"artifactName": "DooTask-v${version}-${os}-${arch}.${ext}",
"allowToChangeInstallationDirectory": true
}
},
"afterSign": "./notarize.js"
},
"config": {
"forge": {
@ -158,5 +163,6 @@
}
]
}
}
}
},
"appId": "com.dootask.task"
}