From 1e57b0e59bb3fc3f28c95ce402a84a0625c226d8 Mon Sep 17 00:00:00 2001 From: polv Date: Sun, 29 Mar 2026 11:17:14 +0700 Subject: [PATCH] formatter --- .gitignore | 2 +- .prettierrc.json | 15 ++++ .vscode/extensions.json | 3 +- .vscode/settings.json | 19 +++++ package.json | 3 + src-tauri/Cargo.lock | 62 +++++++++++++++- src-tauri/Cargo.toml | 5 +- src-tauri/resources/.gitignore | 8 +++ src-tauri/resources/mecab-ipadic/COPYING | 71 +++++++++++++++++++ .../{tauri.conf.json => tauri.conf.json5} | 5 +- 10 files changed, 185 insertions(+), 8 deletions(-) create mode 100644 .prettierrc.json create mode 100644 .vscode/settings.json create mode 100644 src-tauri/resources/.gitignore create mode 100644 src-tauri/resources/mecab-ipadic/COPYING rename src-tauri/{tauri.conf.json => tauri.conf.json5} (90%) diff --git a/.gitignore b/.gitignore index a547bf3..4587401 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,7 @@ dist-ssr *.local # Editor directories and files -.vscode/* +# .vscode/* !.vscode/extensions.json .idea .DS_Store diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..3ee63b4 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,15 @@ +{ + "trailingComma": "all", + "tabWidth": 2, + "semi": true, + "singleQuote": false, + "overrides": [ + { + "files": "*.json5", + "options": { + "parser": "jsonc", + "trailingComma": "none" + } + } + ] +} \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json index cf4385b..60999f5 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ "recommendations": [ "Vue.volar", "tauri-apps.tauri-vscode", - "rust-lang.rust-analyzer" + "rust-lang.rust-analyzer", + "esbenp.prettier-vscode" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..420823b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,19 @@ +{ + "editor.tabSize": 2, + "[typescript]": { + "editor.formatOnSave": true + }, + "[vue]": { + "editor.formatOnSave": true + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "files.associations": { + "tauri*.conf.json5": "jsonc" + }, + "json.schemaDownload.trustedDomains": { + "https://schema.tauri.app": true + } +} diff --git a/package.json b/package.json index 0259dff..67082bd 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,9 @@ "version": "0.1.0", "type": "module", "scripts": { + "desktop:dev": "tauri dev", + "android:dev": "tauri android run", + "android:server": "tauri android dev", "dev": "vite", "build": "vue-tsc --noEmit && vite build", "preview": "vite preview", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 99d5cb3..a1a3df0 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -675,7 +675,6 @@ dependencies = [ "tauri-plugin-sql", "vibrato-rkyv", "zip", - "zstd", ] [[package]] @@ -2556,6 +2555,17 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "json5" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" +dependencies = [ + "pest", + "pest_derive", + "serde", +] + [[package]] name = "jsonptr" version = "0.6.3" @@ -3297,6 +3307,49 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" +[[package]] +name = "pest" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f486f1ea21e6c10ed15d5a7c77165d0ee443402f0780849d1768e7d9d6fe77" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8040c4647b13b210a963c1ed407c1ff4fdfa01c31d6d2a098218702e6664f94f" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "pest_meta" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220" +dependencies = [ + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.8.3" @@ -5623,6 +5676,7 @@ dependencies = [ "http", "infer", "json-patch", + "json5", "kuchikiki", "log", "memchr", @@ -6118,6 +6172,12 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "uds_windows" version = "1.2.1" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 530c23a..f9a28be 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -15,10 +15,10 @@ name = "cjdic2_next_lib" crate-type = ["staticlib", "cdylib", "rlib"] [build-dependencies] -tauri-build = { version = "2", features = [] } +tauri-build = { version = "2", features = ["config-json5"] } [dependencies] -tauri = { version = "2", features = [] } +tauri = { version = "2", features = ["config-json5"] } tauri-plugin-opener = "2" serde = { version = "1", features = ["derive"] } serde_json = "1" @@ -27,6 +27,5 @@ tauri-plugin-sql = { version = "2", features = ["sqlite"] } tauri-plugin-fs = "2" tauri-plugin-clipboard-manager = "2" zip = "8.1.0" -zstd = "0.13.3" blake3 = "1.8.3" vibrato-rkyv = "0.7.5" diff --git a/src-tauri/resources/.gitignore b/src-tauri/resources/.gitignore new file mode 100644 index 0000000..f6f9f3f --- /dev/null +++ b/src-tauri/resources/.gitignore @@ -0,0 +1,8 @@ +*.zip +# *.json.zip from https://github.com/scriptin/jmdict-simplified/releases +# TODO: jmdict.db build script +jmdict.db + +manifest.json +# vibrato-rkyv dicts from https://github.com/stellanomia/vibrato-rkyv/releases/tag/v0.6.2 +system.dic.zst diff --git a/src-tauri/resources/mecab-ipadic/COPYING b/src-tauri/resources/mecab-ipadic/COPYING new file mode 100644 index 0000000..dc7db62 --- /dev/null +++ b/src-tauri/resources/mecab-ipadic/COPYING @@ -0,0 +1,71 @@ +Copyright 2000, 2001, 2002, 2003 Nara Institute of Science +and Technology. All Rights Reserved. + +Use, reproduction, and distribution of this software is permitted. +Any copy of this software, whether in its original form or modified, +must include both the above copyright notice and the following +paragraphs. + +Nara Institute of Science and Technology (NAIST), +the copyright holders, disclaims all warranties with regard to this +software, including all implied warranties of merchantability and +fitness, in no event shall NAIST be liable for +any special, indirect or consequential damages or any damages +whatsoever resulting from loss of use, data or profits, whether in an +action of contract, negligence or other tortuous action, arising out +of or in connection with the use or performance of this software. + +A large portion of the dictionary entries +originate from ICOT Free Software. The following conditions for ICOT +Free Software applies to the current dictionary as well. + +Each User may also freely distribute the Program, whether in its +original form or modified, to any third party or parties, PROVIDED +that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear +on, or be attached to, the Program, which is distributed substantially +in the same form as set out herein and that such intended +distribution, if actually made, will neither violate or otherwise +contravene any of the laws and regulations of the countries having +jurisdiction over the User or the intended distribution itself. + +NO WARRANTY + +The program was produced on an experimental basis in the course of the +research and development conducted during the project and is provided +to users as so produced on an experimental basis. Accordingly, the +program is provided without any warranty whatsoever, whether express, +implied, statutory or otherwise. The term "warranty" used herein +includes, but is not limited to, any warranty of the quality, +performance, merchantability and fitness for a particular purpose of +the program and the nonexistence of any infringement or violation of +any right of any third party. + +Each user of the program will agree and understand, and be deemed to +have agreed and understood, that there is no warranty whatsoever for +the program and, accordingly, the entire risk arising from or +otherwise connected with the program is assumed by the user. + +Therefore, neither ICOT, the copyright holder, or any other +organization that participated in or was otherwise related to the +development of the program and their respective officials, directors, +officers and other employees shall be held liable for any and all +damages, including, without limitation, general, special, incidental +and consequential damages, arising out of or otherwise in connection +with the use or inability to use the program or any product, material +or result produced or otherwise obtained by using the program, +regardless of whether they have been advised of, or otherwise had +knowledge of, the possibility of such damages at any time during the +project or thereafter. Each user will be deemed to have agreed to the +foregoing by his or her commencement of use of the program. The term +"use" as used herein includes, but is not limited to, the use, +modification, copying and distribution of the program and the +production of secondary products from the program. + +In the case where the program, whether in its original form or +modified, was distributed or delivered to or received by a user from +any person, organization or entity other than ICOT, unless it makes or +grants independently of ICOT any specific warranty to the user in +writing, such person, organization or entity, will also be exempted +from and not be held liable to the user for any such damages as noted +above as far as the program is concerned. +÷÷ diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json5 similarity index 90% rename from src-tauri/tauri.conf.json rename to src-tauri/tauri.conf.json5 index 0d6b757..2fb3cd3 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json5 @@ -13,8 +13,9 @@ "windows": [ { "title": "cjdic2-next", - "width": 800, - "height": 600 + "width": 1024, + "height": 768, + "maximized": true } ], "security": {