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

View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "DooTask", "name": "DooTask",
"version": "1.0.0", "version": "0.43.73",
"description": "DooTask is task management system.", "description": "DooTask is task management system.",
"main": "electron.js", "main": "electron.js",
"license": "MIT", "license": "MIT",
@ -36,7 +36,7 @@
"electron-builder": "^25.1.8", "electron-builder": "^25.1.8",
"electron-notarize": "^1.2.2", "electron-notarize": "^1.2.2",
"form-data": "^4.0.1", "form-data": "^4.0.1",
"inquirer": "^8.2.0", "inquirer": "^12.4.2",
"ora": "^4.1.1" "ora": "^4.1.1"
}, },
"dependencies": { "dependencies": {
@ -66,10 +66,10 @@
}, },
"build": { "build": {
"appId": "com.dootask.task", "appId": "com.dootask.task",
"artifactName": "${productName}-v${version}-${os}-${arch}.${ext}", "artifactName": "DooTask-v${version}-${os}-${arch}.${ext}",
"asar": true, "asar": true,
"directories": { "directories": {
"output": "dist" "output": "dist/com-dootask-task/build-mac-generic"
}, },
"files": [ "files": [
"render/**/*", "render/**/*",
@ -83,14 +83,19 @@
{ {
"from": "updater/${os}/${arch}", "from": "updater/${os}/${arch}",
"to": "Resources/updater", "to": "Resources/updater",
"filter": ["**/*"] "filter": [
"**/*"
]
} }
], ],
"npmRebuild": false, "npmRebuild": false,
"publish": { "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": { "mac": {
"icon": "../resources/assets/statics/public/images/logo-app.png", "icon": "../resources/assets/statics/public/images/logo-app.png",
"entitlements": "entitlements.plist", "entitlements": "entitlements.plist",
@ -99,16 +104,18 @@
"target": [ "target": [
{ {
"target": "zip", "target": "zip",
"arch": [ "arch": []
"x64",
"arm64"
]
}, },
{ {
"target": "dmg", "target": "dmg",
"arch": [ "arch": [
"x64", "universal"
"arm64" ]
},
{
"target": "pkg",
"arch": [
"universal"
] ]
} }
] ]
@ -118,19 +125,17 @@
"target": [ "target": [
{ {
"target": "nsis", "target": "nsis",
"arch": [ "arch": []
"x64",
"arm64"
]
} }
], ],
"verifyUpdateCodeSignature": false "verifyUpdateCodeSignature": false
}, },
"nsis": { "nsis": {
"oneClick": false, "oneClick": false,
"artifactName": "${productName}-v${version}-${os}-${arch}.${ext}", "artifactName": "DooTask-v${version}-${os}-${arch}.${ext}",
"allowToChangeInstallationDirectory": true "allowToChangeInstallationDirectory": true
} },
"afterSign": "./notarize.js"
}, },
"config": { "config": {
"forge": { "forge": {
@ -158,5 +163,6 @@
} }
] ]
} }
} },
} "appId": "com.dootask.task"
}