From e700f31f6e150dbec0ef63a920f911b5f8d6eb79 Mon Sep 17 00:00:00 2001 From: purocean Date: Tue, 25 Jul 2023 15:47:11 +0800 Subject: [PATCH 1/9] feat(switch-todo): add checking todo with time configuration option --- src/renderer/plugins/switch-todo.ts | 17 ++++++++++++++++- src/renderer/types.ts | 1 + src/share/i18n/languages/en.ts | 1 + src/share/i18n/languages/zh-CN.ts | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/renderer/plugins/switch-todo.ts b/src/renderer/plugins/switch-todo.ts index d403b2097..1ba15a131 100644 --- a/src/renderer/plugins/switch-todo.ts +++ b/src/renderer/plugins/switch-todo.ts @@ -13,8 +13,12 @@ export default { checked = !lineText.match(/^\s*[-+*]\s+\[x\]/) } + const doneStr = ctx.setting.getSetting('editor.todo-with-time', true) + ? `[x] ~~${ctx.lib.dayjs().format('YYYY-MM-DD HH:mm')}~~` + : '[x]' + const value = checked - ? lineText.replace('[ ]', `[x] ~~${ctx.lib.dayjs().format('YYYY-MM-DD HH:mm')}~~`) + ? lineText.replace('[ ]', doneStr) : lineText.replace(/(\[x\] ~~[\d-: ]+~~|\[x\])/, '[ ]') if (value !== lineText) { @@ -68,5 +72,16 @@ export default { return false }) + + ctx.setting.changeSchema(schema => { + schema.properties['editor.todo-with-time'] = { + defaultValue: true, + title: 'T_setting-panel.schema.editor.todo-with-time', + type: 'boolean', + format: 'checkbox', + group: 'editor', + required: true, + } + }) } } as Plugin diff --git a/src/renderer/types.ts b/src/renderer/types.ts index bb1b5e567..6b1e4ac1e 100644 --- a/src/renderer/types.ts +++ b/src/renderer/types.ts @@ -300,6 +300,7 @@ export interface BuildInSettings { 'editor.enable-preview': boolean, 'editor.font-family': string, 'editor.complete-emoji': boolean, + 'editor.todo-with-time': boolean, 'render.md-html': boolean, 'render.md-breaks': boolean, 'render.md-linkify': boolean, diff --git a/src/share/i18n/languages/en.ts b/src/share/i18n/languages/en.ts index 47eb431e9..8543503c5 100644 --- a/src/share/i18n/languages/en.ts +++ b/src/share/i18n/languages/en.ts @@ -378,6 +378,7 @@ const data = { 'enable-preview': 'Enable Preview - Open new files using temporary tabs, double click the tab to change', 'font-family': 'Font Family', 'complete-emoji': 'Complete Emoji - Input : to display emoji list', + 'todo-with-time': 'Add time when checking todo', }, 'render': { 'md-html': 'Enable HTML', diff --git a/src/share/i18n/languages/zh-CN.ts b/src/share/i18n/languages/zh-CN.ts index 7df36ccf4..92f637557 100644 --- a/src/share/i18n/languages/zh-CN.ts +++ b/src/share/i18n/languages/zh-CN.ts @@ -369,6 +369,7 @@ const data: BaseLanguage = { 'enable-preview': '开启预览 - 打开新文件使用临时标签,双击标签以更改', 'font-family': '字体', 'complete-emoji': '自动补全 Emoji - 输入 : 时显示 Emoji 列表', + 'todo-with-time': '勾选待办事项时自动添加时间', }, 'render': { 'md-html': '启用 HTML', From 9f17105b908e00d2309f1e96220fdd0a6e342b8e Mon Sep 17 00:00:00 2001 From: purocean Date: Thu, 27 Jul 2023 10:21:11 +0800 Subject: [PATCH 2/9] feat: disable click details tag to scroll --- src/renderer/plugins/sync-scroll.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/plugins/sync-scroll.ts b/src/renderer/plugins/sync-scroll.ts index f53e7b56d..97e84f4c1 100644 --- a/src/renderer/plugins/sync-scroll.ts +++ b/src/renderer/plugins/sync-scroll.ts @@ -62,7 +62,7 @@ export default { function clickScroll (e: MouseEvent) { const _target = e.target as HTMLElement - if (['button', 'div', 'img', 'input', 'canvas'].includes(_target.tagName.toLowerCase())) { + if (['button', 'div', 'img', 'input', 'canvas', 'details', 'summary'].includes(_target.tagName.toLowerCase())) { return } From 5881ca92d53d04b0f2f54b1a9f88b1e292bc76ea Mon Sep 17 00:00:00 2001 From: purocean Date: Thu, 27 Jul 2023 10:27:39 +0800 Subject: [PATCH 3/9] feat: update copy button behavior and fix newline replacement --- src/renderer/plugins/markdown-code-copy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/plugins/markdown-code-copy.ts b/src/renderer/plugins/markdown-code-copy.ts index d2d428d76..4d07e3500 100644 --- a/src/renderer/plugins/markdown-code-copy.ts +++ b/src/renderer/plugins/markdown-code-copy.ts @@ -93,7 +93,7 @@ export default { h('div', { class: 'p-mcc-language' }, token.info), h( 'div', - { class: 'p-mcc-copy-btn copy-text', 'data-text': code, title: ctx.i18n.t('copy-code') }, + { class: 'p-mcc-copy-btn copy-text', 'data-text': code.replace(/\n$/, ''), title: ctx.i18n.t('copy-code') }, h(SvgIcon, { name: 'clipboard', style: 'pointer-events: none' }) ), ])) From 76017bcccfe8631fe970a60baf7cbaa15ee58235 Mon Sep 17 00:00:00 2001 From: purocean Date: Thu, 27 Jul 2023 19:10:06 +0800 Subject: [PATCH 4/9] refactor: i18n text --- src/renderer/others/setting-schema.ts | 2 +- src/share/i18n/languages/en.ts | 2 +- src/share/i18n/languages/zh-CN.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/others/setting-schema.ts b/src/renderer/others/setting-schema.ts index 09a1a4b3f..8c509a1ee 100644 --- a/src/renderer/others/setting-schema.ts +++ b/src/renderer/others/setting-schema.ts @@ -316,7 +316,7 @@ const schema: SettingSchema = ({ }, 'keep-running-after-closing-window': { defaultValue: !isMacOS, - title: 'T_setting-panel.keep-running-after-closing-window', + title: 'T_setting-panel.schema.keep-running-after-closing-window', type: 'boolean', group: 'other', format: 'checkbox', diff --git a/src/share/i18n/languages/en.ts b/src/share/i18n/languages/en.ts index 8543503c5..d5c974a9f 100644 --- a/src/share/i18n/languages/en.ts +++ b/src/share/i18n/languages/en.ts @@ -348,7 +348,6 @@ const data = { 'add': 'Add %s', 'delete-warning': 'Are you sure you want to remove this node?', 'error-choose-repo-path': 'Please choose repository path', - 'keep-running-after-closing-window': 'Keep Running after Closing Window', 'tabs': { 'repos': 'Repositories', 'appearance': 'Appearance', @@ -432,6 +431,7 @@ const data = { 'match-placeholder': '%foo%', 'replace-placeholder': '%foo% -> BAR', }, + 'hide-main-window-on-startup': 'Hide Main Window on Startup', } }, 'quick-open': { diff --git a/src/share/i18n/languages/zh-CN.ts b/src/share/i18n/languages/zh-CN.ts index 92f637557..dc2c0da60 100644 --- a/src/share/i18n/languages/zh-CN.ts +++ b/src/share/i18n/languages/zh-CN.ts @@ -349,7 +349,6 @@ const data: BaseLanguage = { 'add': '添加%s', 'delete-warning': '确定要删除吗?', 'error-choose-repo-path': '请选择储存位置', - 'keep-running-after-closing-window': '关闭窗口后保持运行', 'schema': { 'repos': { 'repos': '仓库', @@ -423,6 +422,7 @@ const data: BaseLanguage = { 'match-placeholder': '%foo%', 'replace-placeholder': '%foo% -> BAR', }, + 'keep-running-after-closing-window': '关闭窗口后保持运行', }, 'tabs': { 'repos': '仓库', From f9bcca8b7728836fe933129596cb45cf245e8df4 Mon Sep 17 00:00:00 2001 From: purocean Date: Thu, 27 Jul 2023 19:35:26 +0800 Subject: [PATCH 5/9] feat: add 'hide-main-window-on-startup' configuration item --- src/main/app.ts | 6 +++++- src/renderer/others/setting-schema.ts | 8 ++++++++ src/renderer/types.ts | 1 + src/share/i18n/languages/en.ts | 1 + src/share/i18n/languages/zh-CN.ts | 1 + 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/app.ts b/src/main/app.ts index b5b947182..9d92ae5a9 100644 --- a/src/main/app.ts +++ b/src/main/app.ts @@ -234,7 +234,11 @@ const createWindow = () => { win && win.loadURL(getUrl()) restoreWindowBounds() win.on('ready-to-show', () => { - win!.show() + if (config.get('hide-main-window-on-startup', false)) { + hideWindow() + } else { + win!.show() + } skipBeforeUnloadCheck = false }) diff --git a/src/renderer/others/setting-schema.ts b/src/renderer/others/setting-schema.ts index 8c509a1ee..a56600515 100644 --- a/src/renderer/others/setting-schema.ts +++ b/src/renderer/others/setting-schema.ts @@ -322,6 +322,14 @@ const schema: SettingSchema = ({ format: 'checkbox', required: true, }, + 'hide-main-window-on-startup': { + defaultValue: false, + title: 'T_setting-panel.schema.hide-main-window-on-startup', + type: 'boolean', + group: 'other', + format: 'checkbox', + required: true, + }, envs: { defaultValue: '', title: 'T_setting-panel.schema.envs', diff --git a/src/renderer/types.ts b/src/renderer/types.ts index 6b1e4ac1e..2d0cbbcc0 100644 --- a/src/renderer/types.ts +++ b/src/renderer/types.ts @@ -326,6 +326,7 @@ export interface BuildInSettings { 'extension.registry': RegistryHostname, 'extension.auto-upgrade': boolean, 'keep-running-after-closing-window': boolean, + 'hide-main-window-on-startup': boolean, 'plantuml-api': string, } diff --git a/src/share/i18n/languages/en.ts b/src/share/i18n/languages/en.ts index d5c974a9f..2acef7416 100644 --- a/src/share/i18n/languages/en.ts +++ b/src/share/i18n/languages/en.ts @@ -432,6 +432,7 @@ const data = { 'replace-placeholder': '%foo% -> BAR', }, 'hide-main-window-on-startup': 'Hide Main Window on Startup', + 'keep-running-after-closing-window': 'Keep Running after Closing Window', } }, 'quick-open': { diff --git a/src/share/i18n/languages/zh-CN.ts b/src/share/i18n/languages/zh-CN.ts index dc2c0da60..ee5ab611b 100644 --- a/src/share/i18n/languages/zh-CN.ts +++ b/src/share/i18n/languages/zh-CN.ts @@ -423,6 +423,7 @@ const data: BaseLanguage = { 'replace-placeholder': '%foo% -> BAR', }, 'keep-running-after-closing-window': '关闭窗口后保持运行', + 'hide-main-window-on-startup': '启动时隐藏主窗口', }, 'tabs': { 'repos': '仓库', From fcbabc8f8fa15324f65c288ff7f95f84099ff424 Mon Sep 17 00:00:00 2001 From: purocean Date: Thu, 27 Jul 2023 20:14:03 +0800 Subject: [PATCH 6/9] feat(macro): add `$seq` method --- help/FEATURES.md | 2 ++ help/FEATURES_ZH-CN.md | 2 ++ src/renderer/plugins/markdown-macro.ts | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/help/FEATURES.md b/help/FEATURES.md index 3d0704cb5..fa4ec7e06 100644 --- a/help/FEATURES.md +++ b/help/FEATURES.md @@ -641,6 +641,7 @@ If the expression needs to contain [\= or =\], please enter `[\=` or `=\]` to es - application version: [= $ctx.version =] - current document name: [= $doc.basename =] - current time: [= $ctx.lib.dayjs().format('YYYY-MM-DD HH:mm') =] +- sequence: [= $seq`Figure-` =] | [= $seq`Figure-` =] | [= $seq`Figure-` =] | [= $seq`Table-` =] | [= $seq`Table-` =] - qualifier escape: [= '[\= =\]' =] - Arithmetic: [= (1 + 2) / 2 =] - reference file (support 3 levels of nesting, you can use Front Matter variable defined in the target document): @@ -680,6 +681,7 @@ variable name | type | description `$afterMacro` | `(fn: (src: string) => string) => Result` | Define a macro-replaced callback function that can be used for further processing of the replaced text. `$noop` | `() => Result` | no operation, Used for holding text space `$doc` | `object` | Current document information +`$seq` | `(label: string) => Result` | Sequence `$doc.basename` | `string` | File name of current document (no suffix) `$doc.name` | `string` | File name of current document `$doc.path` | `string` | Current document path diff --git a/help/FEATURES_ZH-CN.md b/help/FEATURES_ZH-CN.md index 3d3363f43..638fe1338 100644 --- a/help/FEATURES_ZH-CN.md +++ b/help/FEATURES_ZH-CN.md @@ -641,6 +641,7 @@ Front Matter 中的 `define` 字段可以定义一些文本替换映射。支持 - 应用版本:[= $ctx.version =] - 当前文档名: [= $doc.basename =] - 当前时间: [= $ctx.lib.dayjs().format('YYYY-MM-DD HH:mm') =] +- 计数器: [= $seq`图-` =] | [= $seq`图-` =] | [= $seq`图-` =] | [= $seq`表-` =] | [= $seq`表-` =] - 限定符转义: [= '[\= =\]' =] - 四则运算: [= (1 + 2) / 2 =] - 引用文件(支持最多嵌套 3 层,可使用目标文档中定义的 Front Matter 变量) @@ -679,6 +680,7 @@ Front Matter 中的 `define` 字段可以定义一些文本替换映射。支持 `$export` | `(key: string, val: any) => Result` | 定义一个本文档可以使用的变量 `$noop` | `() => Result` | 无操作函数,可用于文本占位使用 `$afterMacro` | `(fn: (src: string) => string) => Result` | 定义一个宏替换后的回调函数,可用于对替换后的文本进行进一步处理。 +`$seq` | `(label: string) => Result` | 文档内部计数器 `$doc` | `object` | 当前文档信息 `$doc.basename` | `string` | 当前文档文件名(无后缀) `$doc.name` | `string` | 当前文档文件名 diff --git a/src/renderer/plugins/markdown-macro.ts b/src/renderer/plugins/markdown-macro.ts index a3ddcf3cb..360cc9a80 100644 --- a/src/renderer/plugins/markdown-macro.ts +++ b/src/renderer/plugins/markdown-macro.ts @@ -31,6 +31,17 @@ const globalVars = { $noop: noop, } +function createSeq () { + const counters: Record = {} + return function (str = '') { + if (!counters[str]) { + counters[str] = 0 + } + counters[str]++ + return `${str}${counters[str]}` + } +} + function lineCount (str: string) { let s = 1 const len = str.length @@ -309,6 +320,7 @@ export default { const vars: Record = { ...globalVars, ...env.attributes } vars.$include = include.bind(null, { ...options, belongDoc: file, count: 0, vars }) + vars.$seq = createSeq() vars.$doc = { basename: file.name ? file.name.substring(0, file.name.lastIndexOf('.')) : '', ...ctx.lib.lodash.pick(env.file, 'name', 'repo', 'path', 'content', 'status') From c8aca872e48e72a69df8a44764b1cbd8043dde8b Mon Sep 17 00:00:00 2001 From: purocean Date: Fri, 28 Jul 2023 15:01:13 +0800 Subject: [PATCH 7/9] chore: downgrade electron-builder --- package.json | 2 +- yarn.lock | 365 +++++++++++++++++++++++++++------------------------ 2 files changed, 194 insertions(+), 173 deletions(-) diff --git a/package.json b/package.json index 6787eebe3..3db1447b8 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "crypto-js": "^3.3.0", "dom-to-image": "^2.6.0", "electron": "22.3.17", - "electron-builder": "^24.4.0", + "electron-builder": "^23.6.0", "electron-notarize": "^1.2.2", "eslint": "^7.11.0", "eslint-plugin-import": "^2.20.2", diff --git a/yarn.lock b/yarn.lock index 6a1c9de64..38ba96f95 100644 --- a/yarn.lock +++ b/yarn.lock @@ -759,16 +759,6 @@ ajv "^6.12.0" ajv-keywords "^3.4.1" -"@electron/asar@^3.2.1": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@electron/asar/-/asar-3.2.4.tgz#7e8635a3c4f6d8b3f8ae6efaf5ecb9fbf3bd9864" - integrity sha512-lykfY3TJRRWFeTxccEKdf1I6BLl2Plw81H0bbp4Fc5iEc67foDCa5pjJQULVgo0wF+Dli75f3xVcdb/67FFZ/g== - dependencies: - chromium-pickle-js "^0.2.0" - commander "^5.0.0" - glob "^7.1.6" - minimatch "^3.0.4" - "@electron/get@^2.0.0": version "2.0.2" resolved "https://registry.yarnpkg.com/@electron/get/-/get-2.0.2.tgz#ae2a967b22075e9c25aaf00d5941cd79c21efd7e" @@ -784,26 +774,6 @@ optionalDependencies: global-agent "^3.0.0" -"@electron/notarize@^1.2.3": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@electron/notarize/-/notarize-1.2.4.tgz#a7d38773f4cad40df111a5edc64037e5d768ea1e" - integrity sha512-W5GQhJEosFNafewnS28d3bpQ37/s91CDWqxVchHfmv2dQSTWpOzNlUVQwYzC1ay5bChRV/A9BTL68yj0Pa+TSg== - dependencies: - debug "^4.1.1" - fs-extra "^9.0.1" - -"@electron/osx-sign@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@electron/osx-sign/-/osx-sign-1.0.4.tgz#8e91442846471636ca0469426a82b253b9170151" - integrity sha512-xfhdEcIOfAZg7scZ9RQPya1G1lWo8/zMCwUXAulq0SfY7ONIW+b9qGyKdMyuMctNYwllrIS+vmxfijSfjeh97g== - dependencies: - compare-version "^0.1.2" - debug "^4.3.4" - fs-extra "^10.0.0" - isbinaryfile "^4.0.8" - minimist "^1.2.6" - plist "^3.0.5" - "@electron/rebuild@^3.2.13": version "3.2.13" resolved "https://registry.yarnpkg.com/@electron/rebuild/-/rebuild-3.2.13.tgz#98fbb98981b1a86162546a2ab91b2355569cca4c" @@ -828,15 +798,15 @@ resolved "https://registry.yarnpkg.com/@electron/remote/-/remote-2.0.10.tgz#133e2f607b1861ac249bd78b5abd1e961feed713" integrity sha512-3SFKKaQXcyWgwmibud+UqJl/XlHOgLcI3fwtB9pNelPSJAcTxocOJrF6FaxBIQaj1+R05Di6xuAswZpXAW7xhA== -"@electron/universal@1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@electron/universal/-/universal-1.3.4.tgz#bccd94b635d7c85eeed5eabba457eb4ed2be2777" - integrity sha512-BdhBgm2ZBnYyYRLRgOjM5VHkyFItsbggJ0MHycOjKWdFGYwK97ZFXH54dTvUWEfha81vfvwr5On6XBjt99uDcg== +"@electron/universal@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@electron/universal/-/universal-1.2.1.tgz#3c2c4ff37063a4e9ab1e6ff57db0bc619bc82339" + integrity sha512-7323HyMh7KBAl/nPDppdLsC87G6RwRU02dy5FPeGB1eS7rUePh55+WNWiDPLhFQqqVPHzh77M69uhmoT8XnwMQ== dependencies: - "@electron/asar" "^3.2.1" "@malept/cross-spawn-promise" "^1.1.0" + asar "^3.1.0" debug "^4.3.1" - dir-compare "^3.0.0" + dir-compare "^2.4.0" fs-extra "^9.0.1" minimatch "^3.0.4" plist "^3.0.4" @@ -1403,13 +1373,6 @@ dependencies: "@types/node" "*" -"@types/fs-extra@9.0.13": - version "9.0.13" - resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-9.0.13.tgz#7594fbae04fe7f1918ce8b3d213f74ff44ac1f45" - integrity sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA== - dependencies: - "@types/node" "*" - "@types/fs-extra@^9.0.11": version "9.0.11" resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-9.0.11.tgz#8cc99e103499eab9f347dbc6ca4e99fb8d2c2b87" @@ -1417,6 +1380,14 @@ dependencies: "@types/node" "*" +"@types/glob@^7.1.1": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" + integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== + dependencies: + "@types/minimatch" "*" + "@types/node" "*" + "@types/glob@^8.1.0": version "8.1.0" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-8.1.0.tgz#b63e70155391b0584dce44e7ea25190bbc38f2fc" @@ -1571,7 +1542,7 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.3.tgz#c893b73721db73699943bfc3653b1deb7faa4a3a" integrity sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q== -"@types/minimatch@^5.1.2": +"@types/minimatch@*", "@types/minimatch@^5.1.2": version "5.1.2" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== @@ -1735,6 +1706,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yargs@^17.0.1": + version "17.0.24" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.24.tgz#b3ef8d50ad4aa6aecf6ddc97c580a00f5aa11902" + integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== + dependencies: + "@types/yargs-parser" "*" + "@types/yauzl@^2.9.1": version "2.10.0" resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.0.tgz#b3248295276cf8c6f153ebe6a9aba0c988cb2599" @@ -2244,39 +2222,36 @@ app-builder-bin@4.0.0: resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-4.0.0.tgz#1df8e654bd1395e4a319d82545c98667d7eed2f0" integrity sha512-xwdG0FJPQMe0M0UA4Tz0zEB8rBJTRA5a476ZawAqiBkMv16GRK5xpXThOjMaEOFnZ6zabejjG4J3da0SXG63KA== -app-builder-lib@24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/app-builder-lib/-/app-builder-lib-24.4.0.tgz#1606f94e99366eea9e7507228961b8396e40d546" - integrity sha512-EcdqtWvg1LAApKCfyRBukcVkmsa94s2e1VKHjZLpvA9/D14QEt8rHhffYeaA+cH/pVeoNVn2ob735KnfJKEEow== +app-builder-lib@23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/app-builder-lib/-/app-builder-lib-23.6.0.tgz#03cade02838c077db99d86212d61c5fc1d6da1a8" + integrity sha512-dQYDuqm/rmy8GSCE6Xl/3ShJg6Ab4bZJMT8KaTKGzT436gl1DN4REP3FCWfXoh75qGTJ+u+WsdnnpO9Jl8nyMA== dependencies: "7zip-bin" "~5.1.1" "@develar/schema-utils" "~2.6.5" - "@electron/notarize" "^1.2.3" - "@electron/osx-sign" "^1.0.4" - "@electron/rebuild" "^3.2.13" - "@electron/universal" "1.3.4" + "@electron/universal" "1.2.1" "@malept/flatpak-bundler" "^0.4.0" - "@types/fs-extra" "9.0.13" async-exit-hook "^2.0.1" bluebird-lst "^1.0.9" - builder-util "24.4.0" - builder-util-runtime "9.2.1" + builder-util "23.6.0" + builder-util-runtime "9.1.1" chromium-pickle-js "^0.2.0" debug "^4.3.4" - ejs "^3.1.8" - electron-publish "24.4.0" + ejs "^3.1.7" + electron-osx-sign "^0.6.0" + electron-publish "23.6.0" form-data "^4.0.0" fs-extra "^10.1.0" hosted-git-info "^4.1.0" is-ci "^3.0.0" - isbinaryfile "^5.0.0" + isbinaryfile "^4.0.10" js-yaml "^4.1.0" lazy-val "^1.0.5" - minimatch "^5.1.1" - read-config-file "6.3.2" + minimatch "^3.1.2" + read-config-file "6.2.0" sanitize-filename "^1.6.3" - semver "^7.3.8" - tar "^6.1.12" + semver "^7.3.7" + tar "^6.1.11" temp-file "^3.4.0" app-license@^0.2.4: @@ -2367,6 +2342,18 @@ asap@~2.0.3: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= +asar@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/asar/-/asar-3.2.0.tgz#e6edb5edd6f627ebef04db62f771c61bea9c1221" + integrity sha512-COdw2ZQvKdFGFxXwX3oYh2/sOsJWJegrdJCGxnN4MZ7IULgRBp9P6665aqj9z1v9VwP4oP1hRBojRDQ//IGgAg== + dependencies: + chromium-pickle-js "^0.2.0" + commander "^5.0.0" + glob "^7.1.6" + minimatch "^3.0.4" + optionalDependencies: + "@types/glob" "^7.1.1" + asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" @@ -2579,7 +2566,7 @@ bluebird-lst@^1.0.9: dependencies: bluebird "^3.5.5" -bluebird@^3.5.5: +bluebird@^3.5.0, bluebird@^3.5.5: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== @@ -2657,6 +2644,19 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" +buffer-alloc-unsafe@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" + integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== + +buffer-alloc@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" + integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== + dependencies: + buffer-alloc-unsafe "^1.1.0" + buffer-fill "^1.0.0" + buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" @@ -2667,10 +2667,15 @@ buffer-equal-constant-time@1.0.1: resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= -buffer-equal@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.1.tgz#2f7651be5b1b3f057fcd6e7ee16cf34767077d90" - integrity sha512-QoV3ptgEaQpvVwbXdSO39iqPQTCxSF7A5U99AxbHYqUdCizL/lH2Z0A2y6nbZucxMEOtNyZfG2s6gsVugGpKkg== +buffer-equal@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" + integrity sha512-tcBWO2Dl4e7Asr9hTGcpVrCe+F7DubpmqWCTbj4FHLmjqO2hIaC383acQubWtRJhdceqs5uBHs6Es+Sk//RKiQ== + +buffer-fill@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" + integrity sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ== buffer-from@^1.0.0: version "1.1.1" @@ -2685,6 +2690,14 @@ buffer@^5.1.0, buffer@^5.5.0: base64-js "^1.3.1" ieee754 "^1.1.13" +builder-util-runtime@9.1.1: + version "9.1.1" + resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-9.1.1.tgz#2da7b34e78a64ad14ccd070d6eed4662d893bd60" + integrity sha512-azRhYLEoDvRDR8Dhis4JatELC/jUvYjm4cVSj7n9dauGTOM2eeNn9KS0z6YA6oDsjI1xphjNbY6PZZeHPzzqaw== + dependencies: + debug "^4.3.4" + sax "^1.2.4" + builder-util-runtime@9.2.1: version "9.2.1" resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-9.2.1.tgz#3184dcdf7ed6c47afb8df733813224ced4f624fd" @@ -2693,22 +2706,23 @@ builder-util-runtime@9.2.1: debug "^4.3.4" sax "^1.2.4" -builder-util@24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-24.4.0.tgz#dbb201a118fd573180e6a1070cf4c0be6de80cd7" - integrity sha512-tONb/GIK1MKa1BcOPHE1naId3o5nj6gdka5kP7yUJh2DOfF+jMq3laiu+UOZH6A7ZtkMtnGNMYFKFTIv408n/A== +builder-util@23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-23.6.0.tgz#1880ec6da7da3fd6fa19b8bd71df7f39e8d17dd9" + integrity sha512-QiQHweYsh8o+U/KNCZFSvISRnvRctb8m/2rB2I1JdByzvNKxPeFLlHFRPQRXab6aYeXc18j9LpsDLJ3sGQmWTQ== dependencies: "7zip-bin" "~5.1.1" "@types/debug" "^4.1.6" + "@types/fs-extra" "^9.0.11" app-builder-bin "4.0.0" bluebird-lst "^1.0.9" - builder-util-runtime "9.2.1" - chalk "^4.1.2" + builder-util-runtime "9.1.1" + chalk "^4.1.1" cross-spawn "^7.0.3" debug "^4.3.4" - fs-extra "^10.1.0" + fs-extra "^10.0.0" http-proxy-agent "^5.0.0" - https-proxy-agent "^5.0.1" + https-proxy-agent "^5.0.0" is-ci "^3.0.0" js-yaml "^4.1.0" source-map-support "^0.5.19" @@ -2830,7 +2844,7 @@ chalk@^2.0.0: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.2: +chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -3047,6 +3061,11 @@ colorette@^1.2.2: resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== +colors@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" + integrity sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw== + combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -3059,6 +3078,13 @@ command-exists@^1.2.9: resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== +commander@2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" + integrity sha512-bmkUukX8wAOjHdN26xj5c4ctEV22TQ7dQYhSmuckKhToXrkUn0iIaolHdIxYYqD55nhpSPA9zPQ1yP57GdXP2A== + dependencies: + graceful-readlink ">= 1.0.0" + commander@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" @@ -3128,14 +3154,6 @@ conf@^10.2.0: pkg-up "^3.1.0" semver "^7.3.5" -config-file-ts@^0.2.4: - version "0.2.4" - resolved "https://registry.yarnpkg.com/config-file-ts/-/config-file-ts-0.2.4.tgz#6c0741fbe118a7cf786c65f139030f0448a2cc99" - integrity sha512-cKSW0BfrSaAUnxpgvpXPLaaW/umg4bqg4k3GO1JqlRfpx+d5W0GDXznCMkWotJQek5Mmz1MJVChQnz3IVaeMZQ== - dependencies: - glob "^7.1.6" - typescript "^4.0.2" - console-control-strings@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -3343,7 +3361,7 @@ debug@4: dependencies: ms "2.1.2" -debug@^2.6.9: +debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -3511,13 +3529,15 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -dir-compare@^3.0.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/dir-compare/-/dir-compare-3.3.0.tgz#2c749f973b5c4b5d087f11edaae730db31788416" - integrity sha512-J7/et3WlGUCxjdnD3HAAzQ6nsnc0WL6DD7WcwJb7c39iH1+AWfg+9OqzJNaI6PkBwBvm1mhZNL9iY/nRiZXlPg== +dir-compare@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/dir-compare/-/dir-compare-2.4.0.tgz#785c41dc5f645b34343a4eafc50b79bac7f11631" + integrity sha512-l9hmu8x/rjVC9Z2zmGzkhOEowZvW7pmYws5CWHutg8u1JgvsKWMx7Q/UODeu4djLZ4FgW5besw5yvMQnBHzuCA== dependencies: - buffer-equal "^1.0.0" - minimatch "^3.0.4" + buffer-equal "1.0.0" + colors "1.0.3" + commander "2.9.0" + minimatch "3.0.4" dir-glob@^3.0.1: version "3.0.1" @@ -3526,15 +3546,15 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" -dmg-builder@24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/dmg-builder/-/dmg-builder-24.4.0.tgz#46c80f119465f6a7275766c72b4f3d514cc8013d" - integrity sha512-p5z9Cx539GSBYb+b09Z+hMhuBTh/BrI71VRg4rgF6f2xtIRK/YlTGVS/O08k5OojoyhZcpS7JXxDVSmQoWgiiQ== +dmg-builder@23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/dmg-builder/-/dmg-builder-23.6.0.tgz#d39d3871bce996f16c07d2cafe922d6ecbb2a948" + integrity sha512-jFZvY1JohyHarIAlTbfQOk+HnceGjjAdFjVn3n8xlDWKsYNqbO4muca6qXEZTfGXeQMG7TYim6CeS5XKSfSsGA== dependencies: - app-builder-lib "24.4.0" - builder-util "24.4.0" - builder-util-runtime "9.2.1" - fs-extra "^10.1.0" + app-builder-lib "23.6.0" + builder-util "23.6.0" + builder-util-runtime "9.1.1" + fs-extra "^10.0.0" iconv-lite "^0.6.2" js-yaml "^4.1.0" optionalDependencies: @@ -3676,29 +3696,30 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -ejs@^3.1.8: +ejs@^3.1.7: version "3.1.9" resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.9.tgz#03c9e8777fe12686a9effcef22303ca3d8eeb361" integrity sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ== dependencies: jake "^10.8.5" -electron-builder@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-24.4.0.tgz#8846efa45bac8f6b9afc181abf71a4e12530f045" - integrity sha512-D5INxodxaUIJgEX6p/fqBd8wQNS8XRAToNIJ9SQC+taNS5D73ZsjLuXiRraFGCB0cVk9KeKhEkdEOH5AaVya4g== - dependencies: - app-builder-lib "24.4.0" - builder-util "24.4.0" - builder-util-runtime "9.2.1" - chalk "^4.1.2" - dmg-builder "24.4.0" - fs-extra "^10.1.0" +electron-builder@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-23.6.0.tgz#c79050cbdce90ed96c5feb67c34e9e0a21b5331b" + integrity sha512-y8D4zO+HXGCNxFBV/JlyhFnoQ0Y0K7/sFH+XwIbj47pqaW8S6PGYQbjoObolKBR1ddQFPt4rwp4CnwMJrW3HAw== + dependencies: + "@types/yargs" "^17.0.1" + app-builder-lib "23.6.0" + builder-util "23.6.0" + builder-util-runtime "9.1.1" + chalk "^4.1.1" + dmg-builder "23.6.0" + fs-extra "^10.0.0" is-ci "^3.0.0" lazy-val "^1.0.5" - read-config-file "6.3.2" - simple-update-notifier "^1.1.0" - yargs "^17.6.2" + read-config-file "6.2.0" + simple-update-notifier "^1.0.7" + yargs "^17.5.1" electron-context-menu@^3.6.1: version "3.6.1" @@ -3736,6 +3757,18 @@ electron-notarize@^1.2.2: debug "^4.1.1" fs-extra "^9.0.1" +electron-osx-sign@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/electron-osx-sign/-/electron-osx-sign-0.6.0.tgz#9b69c191d471d9458ef5b1e4fdd52baa059f1bb8" + integrity sha512-+hiIEb2Xxk6eDKJ2FFlpofCnemCbjbT5jz+BKGpVBrRNT3kWTGs4DfNX6IzGwgi33hUcXF+kFs9JW+r6Wc1LRg== + dependencies: + bluebird "^3.5.0" + compare-version "^0.1.2" + debug "^2.6.8" + isbinaryfile "^3.0.2" + minimist "^1.2.0" + plist "^3.0.1" + electron-progressbar@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/electron-progressbar/-/electron-progressbar-2.1.0.tgz#12cc2a652f9b12a408b7a1e623fb4eb62c9fc645" @@ -3743,16 +3776,16 @@ electron-progressbar@^2.1.0: dependencies: extend "^3.0.1" -electron-publish@24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-24.4.0.tgz#a58f49ecd727620f65372881788ebb1a9b853284" - integrity sha512-U3mnVSxIfNrLW7ZnwiedFhcLf6ExPFXgAsx89WpfQFsV4gFAt/LG+H74p0m9NSvsLXiZuF82yXoxi7Ou8GHq4Q== +electron-publish@23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-23.6.0.tgz#ac9b469e0b07752eb89357dd660e5fb10b3d1ce9" + integrity sha512-jPj3y+eIZQJF/+t5SLvsI5eS4mazCbNYqatv5JihbqOstIM13k0d1Z3vAWntvtt13Itl61SO6seicWdioOU5dg== dependencies: "@types/fs-extra" "^9.0.11" - builder-util "24.4.0" - builder-util-runtime "9.2.1" - chalk "^4.1.2" - fs-extra "^10.1.0" + builder-util "23.6.0" + builder-util-runtime "9.1.1" + chalk "^4.1.1" + fs-extra "^10.0.0" lazy-val "^1.0.5" mime "^2.5.2" @@ -4960,6 +4993,11 @@ graceful-fs@^4.2.6: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== +"graceful-readlink@>= 1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" + integrity sha512-8tLu60LgxF6XpdbK8OW3FA+IfTNBn1ZHGHKF4KQbEeSkajYw5PlYJcKluntgegDPTg8UkHjpet1T82vk6TQ68w== + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -5178,14 +5216,6 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" -https-proxy-agent@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - human-signals@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" @@ -5511,16 +5541,18 @@ isarray@~1.0.0: resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= -isbinaryfile@^4.0.8: +isbinaryfile@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" + integrity sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw== + dependencies: + buffer-alloc "^1.2.0" + +isbinaryfile@^4.0.10: version "4.0.10" resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.10.tgz#0c5b5e30c2557a2f06febd37b7322946aaee42b3" integrity sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw== -isbinaryfile@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-5.0.0.tgz#034b7e54989dab8986598cbcea41f66663c65234" - integrity sha512-UDdnyGvMajJUWCkib7Cei/dvyJrrvo4FIrsvSFWdPpXSUorzXrDJ0S+X5Q4ZlasfPjca4yqCNNsjbCeiy8FFeg== - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -6778,7 +6810,14 @@ min-indent@^1.0.0: resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== -minimatch@^3.0.4: +minimatch@3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^3.0.4, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -6792,13 +6831,6 @@ minimatch@^5.0.1: dependencies: brace-expansion "^2.0.1" -minimatch@^5.1.1: - version "5.1.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" - integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== - dependencies: - brace-expansion "^2.0.1" - minimatch@^9.0.1: version "9.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" @@ -6820,11 +6852,6 @@ minimist@^1.2.0, minimist@^1.2.5: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== -minimist@^1.2.6: - version "1.2.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - minipass-collect@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" @@ -7474,15 +7501,7 @@ plantuml-pipe@^1.4.0: binary-split "^1.0.5" split2 "^4.1.0" -plist@^3.0.4: - version "3.0.6" - resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.6.tgz#7cfb68a856a7834bca6dbfe3218eb9c7740145d3" - integrity sha512-WiIVYyrp8TD4w8yCvyeIr+lkmrGRd5u0VbRnU+tP/aRLxP/YadJUYOMZJ/6hIa3oUyVCsycXvtNRgd5XBJIbiA== - dependencies: - base64-js "^1.5.1" - xmlbuilder "^15.1.1" - -plist@^3.0.5: +plist@^3.0.1: version "3.1.0" resolved "https://registry.yarnpkg.com/plist/-/plist-3.1.0.tgz#797a516a93e62f5bde55e0b9cc9c967f860893c9" integrity sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ== @@ -7491,6 +7510,14 @@ plist@^3.0.5: base64-js "^1.5.1" xmlbuilder "^15.1.1" +plist@^3.0.4: + version "3.0.6" + resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.6.tgz#7cfb68a856a7834bca6dbfe3218eb9c7740145d3" + integrity sha512-WiIVYyrp8TD4w8yCvyeIr+lkmrGRd5u0VbRnU+tP/aRLxP/YadJUYOMZJ/6hIa3oUyVCsycXvtNRgd5XBJIbiA== + dependencies: + base64-js "^1.5.1" + xmlbuilder "^15.1.1" + postcss-value-parser@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" @@ -7753,12 +7780,11 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== -read-config-file@6.3.2: - version "6.3.2" - resolved "https://registry.yarnpkg.com/read-config-file/-/read-config-file-6.3.2.tgz#556891aa6ffabced916ed57457cb192e61880411" - integrity sha512-M80lpCjnE6Wt6zb98DoW8WHR09nzMSpu8XHtPkiTHrJ5Az9CybfeQhTJ8D7saeBHpGhLPIVyA8lcL6ZmdKwY6Q== +read-config-file@6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/read-config-file/-/read-config-file-6.2.0.tgz#71536072330bcd62ba814f91458b12add9fc7ade" + integrity sha512-gx7Pgr5I56JtYz+WuqEbQHj/xWo+5Vwua2jhb1VwM4Wid5PqYmZ4i00ZB0YEGIfkVBsCv9UrjgyqCiQfS/Oosg== dependencies: - config-file-ts "^0.2.4" dotenv "^9.0.2" dotenv-expand "^5.1.0" js-yaml "^4.1.0" @@ -8071,7 +8097,7 @@ semver@7.3.7: dependencies: lru-cache "^6.0.0" -semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.8: +semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -8160,7 +8186,7 @@ signal-exit@^4.0.1: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== -simple-update-notifier@^1.1.0: +simple-update-notifier@^1.0.7: version "1.1.0" resolved "https://registry.yarnpkg.com/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz#67694c121de354af592b347cdba798463ed49c82" integrity sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg== @@ -8639,7 +8665,7 @@ tar-stream@^2.2.0: inherits "^2.0.3" readable-stream "^3.1.1" -tar@^6.0.5, tar@^6.1.12, tar@^6.1.2: +tar@^6.0.5, tar@^6.1.2: version "6.1.15" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.15.tgz#c9738b0b98845a3b344d334b8fa3041aaba53a69" integrity sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A== @@ -9016,11 +9042,6 @@ typedoc@^0.22.7: minimatch "^3.0.4" shiki "^0.9.12" -typescript@^4.0.2: - version "4.9.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" - integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== - typescript@^4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc" @@ -9690,7 +9711,7 @@ yargs@^17.0.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.0.1, yargs@^17.6.2: +yargs@^17.0.1, yargs@^17.5.1: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== From 1ac3ed91345063d10324bc1c17aecaa8bb5d9a54 Mon Sep 17 00:00:00 2001 From: purocean Date: Mon, 31 Jul 2023 15:38:20 +0800 Subject: [PATCH 8/9] feat(document-history): limit history file size --- src/main/server/file.ts | 23 +++++++++++++++++++---- src/renderer/components/DocHistory.vue | 20 ++++++++++++++++++-- src/renderer/support/api.ts | 2 +- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/main/server/file.ts b/src/main/server/file.ts index 5344f8c56..fbd2fc67c 100644 --- a/src/main/server/file.ts +++ b/src/main/server/file.ts @@ -86,7 +86,7 @@ function writeHistoryZip (zip: AdmZip, zipFilePath: string) { } async function writeHistory (filePath: string, content: any) { - const limit = Math.min(10000, config.get('doc-history.number-limit', 500)) + let limit = Math.min(10000, config.get('doc-history.number-limit', 500)) if (limit < 1) { return } @@ -94,8 +94,15 @@ async function writeHistory (filePath: string, content: any) { const historyFilePath = getHistoryFilePath(filePath) let zip: AdmZip + let tooLarge = false if ((await fs.pathExists(historyFilePath))) { + const stats = await fs.stat(historyFilePath) + if (stats.size > 1024 * 1024 * 5) { // 5M + console.log('history file too large, limit max versions.', historyFilePath, stats.size) + tooLarge = true + } + zip = readHistoryZip(historyFilePath) } else { zip = new AdmZip() @@ -105,7 +112,12 @@ async function writeHistory (filePath: string, content: any) { zip.addFile(dayjs().format('YYYY-MM-DD HH-mm-ss') + ext, content) - orderBy(zip.getEntries(), x => x.entryName, 'desc').slice(limit).forEach(entry => { + const entries = zip.getEntries() + if (tooLarge) { + limit = Math.min(limit, Math.floor(entries.length / 3 * 2)) + } + + orderBy(entries, x => x.entryName, 'desc').slice(limit).forEach(entry => { if (!entry.comment) { zip.deleteFile(entry) } @@ -376,14 +388,17 @@ export function historyList (repo: string, path: string) { const historyFilePath = getHistoryFilePath(filePath) if (!(await fs.pathExists(historyFilePath))) { - return [] + return { list: [], size: 0 } } + const stats = await fs.stat(historyFilePath) const zip = readHistoryZip(historyFilePath) - return orderBy(zip.getEntries(), x => x.entryName, 'desc').map(x => ({ + const list = orderBy(zip.getEntries(), x => x.entryName, 'desc').map(x => ({ name: x.entryName, comment: x.comment })) + + return { list, size: stats.size } }, path) } diff --git a/src/renderer/components/DocHistory.vue b/src/renderer/components/DocHistory.vue index 955b9d496..2983f51cc 100644 --- a/src/renderer/components/DocHistory.vue +++ b/src/renderer/components/DocHistory.vue @@ -3,7 +3,7 @@
-
{{$t('doc-history.clear')}}
+
{{$t('doc-history.clear')}}({{sizeText}})
[ const currentDoc = ref(null) const currentVersion = ref() const versions = ref([]) +const size = ref(0) const content = ref('') const displayType = ref<'content' | 'diff'>('content') const listType = ref<'all' | 'marked'>('all') @@ -116,6 +117,11 @@ const xVersions = computed(() => { return versions.value }) +const sizeText = computed(() => { + const val = Math.round(size.value / 1024) + return val > 1024 ? `${Math.round(val / 1024)}M` : `${val}K` +}) + function show (doc?: Doc) { doc ??= currentFile.value! currentDoc.value = doc @@ -133,12 +139,22 @@ function show (doc?: Doc) { function hide () { currentDoc.value = null versions.value = null + size.value = 0 } async function fetchVersions () { try { versions.value = null - versions.value = (currentDoc.value ? await fetchHistoryList(currentDoc.value) : []).map(({ name: value, comment }) => { + size.value = 0 + + let list: any[] = [] + if (currentDoc.value) { + const data = await fetchHistoryList(currentDoc.value!) + list = data.list + size.value = data.size + } + + versions.value = list.map(({ name: value, comment }) => { const arr = value.split('.') const name = arr[0] const encrypted = isEncrypted({ type: 'file', path: value }) diff --git a/src/renderer/support/api.ts b/src/renderer/support/api.ts index 85409b576..565961c9d 100644 --- a/src/renderer/support/api.ts +++ b/src/renderer/support/api.ts @@ -162,7 +162,7 @@ export async function deleteFile (file: FileItem): Promise> { return fetchHttp(`/api/file?path=${encodeURIComponent(path)}&repo=${encodeURIComponent(repo)}`, { method: 'DELETE' }) } -export async function fetchHistoryList (file: PathItem): Promise<{name: string, comment: string}[]> { +export async function fetchHistoryList (file: PathItem): Promise<{size: number, list: {name: string, comment: string}[]}> { const { path, repo } = file const { data } = await fetchHttp(`/api/history/list?path=${encodeURIComponent(path)}&repo=${encodeURIComponent(repo)}`) return data From 2a9ce020358bd026f1fc3e183e34bfbc25e0d0f3 Mon Sep 17 00:00:00 2001 From: purocean Date: Mon, 31 Jul 2023 16:30:21 +0800 Subject: [PATCH 9/9] chore: bump version --- README.md | 16 ++++++++-------- README_ZH-CN.md | 16 ++++++++-------- package.json | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index d50b8bb09..68a7e3156 100644 --- a/README.md +++ b/README.md @@ -76,16 +76,16 @@ For more information on how to use the following functions, please see [characte ## Changelogs -### [v3.56.4](https://github.com/purocean/yn/releases/tag/v3.56.4) 2023-07-23 +### [v3.57.0](https://github.com/purocean/yn/releases/tag/v3.57.0) 2023-07-31 -[Windows](https://github.com/purocean/yn/releases/download/v3.56.4/Yank-Note-win-x64-3.56.4.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.56.4/Yank-Note-mac-arm64-3.56.4.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.56.4/Yank-Note-mac-x64-3.56.4.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.56.4/Yank-Note-linux-x86_64-3.56.4.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.56.4/Yank-Note-linux-amd64-3.56.4.deb) +[Windows](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-win-x64-3.57.0.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-mac-arm64-3.57.0.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-mac-x64-3.57.0.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-linux-x86_64-3.57.0.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-linux-amd64-3.57.0.deb) -1. feat: upgrade Electron to 22.3.17 -2. feat: optimize the popup position of context menu when space is limited -3. feat: add file-related operations to the context menu of file tabs -4. feat: Prompt whether to create a new file when switching to a non-existent file -5. feat(plugin): add `file-tabs.close-tabs` Action -6. feat(plugin): add extension methods to the context menu of file tabs +1. feat: introducing the $seq method in the macro to generate sequential numbers like Figure-1, Figure-2. +2. feat: added configuration to hide the main window upon startup. +3. feat: implemented a configuration option to automatically add to-dos to the completion time. +4. feat: implemented size restriction for generated historical version files. +5. feat: enhanced scrolling behavior for the details tag when clicked. +6. fix: resolved the issue of extra blank lines at the end of copied code blocks. [More release notes](https://github.com/purocean/yn/releases) diff --git a/README_ZH-CN.md b/README_ZH-CN.md index 02bab43d4..ce2dda4f8 100644 --- a/README_ZH-CN.md +++ b/README_ZH-CN.md @@ -76,16 +76,16 @@ ## 更新日志 -### [v3.56.4](https://github.com/purocean/yn/releases/tag/v3.56.4) 2023-07-23 +### [v3.57.0](https://github.com/purocean/yn/releases/tag/v3.57.0) 2023-07-31 -[Windows](https://github.com/purocean/yn/releases/download/v3.56.4/Yank-Note-win-x64-3.56.4.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.56.4/Yank-Note-mac-arm64-3.56.4.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.56.4/Yank-Note-mac-x64-3.56.4.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.56.4/Yank-Note-linux-x86_64-3.56.4.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.56.4/Yank-Note-linux-amd64-3.56.4.deb) +[Windows](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-win-x64-3.57.0.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-mac-arm64-3.57.0.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-mac-x64-3.57.0.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-linux-x86_64-3.57.0.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-linux-amd64-3.57.0.deb) -1. feat: 升级 Electron 到 22.3.17 -2. feat: 优化当空间不够时上下文菜单弹出位置 -3. feat: 文件选项卡上下文菜单增加文件相关操作 -4. feat: 切换到一个不存在的文件时,提示是否创建 -5. feat(plugin): 增加 `file-tabs.close-tabs` Action -6. feat(plugin): 增加文件选项卡上下文菜单拓展方法 +1. feat: 宏增加 `$seq` 方法,用于生成如 `图-1`、`图-2` 这样的序号 +2. feat: 增加启动隐藏主窗口的配置 +3. feat: 增加勾选待办是否自动添加完成时间的配置 +4. feat: 限制生成历史版本文件的大小 +5. feat: 优化点击 `details` 标签时滚动行为 +6. fix: 修复拷贝代码块内容末尾有多余空行的问题 [更多发布说明](https://github.com/purocean/yn/releases) diff --git a/package.json b/package.json index 3db1447b8..857406fdb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yank.note", - "version": "3.56.4", + "version": "3.57.0", "description": "Yank Note: A highly extensible Markdown editor, designed for productivity.", "main": "dist/main/app.js", "license": "AGPL-3.0",