diff --git a/.github/workflows/pake-cli.yaml b/.github/workflows/pake-cli.yaml index db00064..d4541c9 100644 --- a/.github/workflows/pake-cli.yaml +++ b/.github/workflows/pake-cli.yaml @@ -28,6 +28,9 @@ on: description: '[Height, Optional]' required: false default: '780' + safe_domain: + description: '[Safe Domain, Optional]' + required: false hide_title_bar: description: '[Hide TitleBar, Optional, MacOS only]' required: false @@ -129,6 +132,7 @@ jobs: RESIZE: ${{ inputs.resize }} MULTI_ARCH: ${{ inputs.multi_arch }} TARGETS: ${{ inputs.targets }} + SAFE_DOMAIN: ${{ inputs.safe_domain }} - name: Upload archive uses: actions/upload-artifact@v3 diff --git a/README.md b/README.md index 517337a..f76087e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

English | 简体中文

+

English | 简体中文 | 日本語

@@ -257,6 +257,13 @@ Pake's development can not be without these Hackers. They contributed a lot of c + + + YangguangZhou +
+ Jerry Zhou +
+ AielloChan @@ -278,6 +285,13 @@ Pake's development can not be without these Hackers. They contributed a lot of c Pake Actions + + + eltociear +
+ Ikko Eltociear Ashimine +
+ QingZ11 @@ -291,7 +305,8 @@ Pake's development can not be without these Hackers. They contributed a lot of c
孟世博
- + + 2nthony @@ -305,8 +320,7 @@ Pake's development can not be without these Hackers. They contributed a lot of c
Null
- - + imabutahersiddik @@ -341,12 +355,13 @@ Pake's development can not be without these Hackers. They contributed a lot of c
Fechin
- + + - - eltociear + + ImgBotApp
- Ikko Eltociear Ashimine + Imgbot
@@ -355,8 +370,7 @@ Pake's development can not be without these Hackers. They contributed a lot of c
Jiaqi Gu - - + Milo123459 @@ -391,7 +405,8 @@ Pake's development can not be without these Hackers. They contributed a lot of c
Null
- + + liudonghua123 @@ -405,8 +420,7 @@ Pake's development can not be without these Hackers. They contributed a lot of c
Liusishan
- - + piaoyidage diff --git a/README_CN.md b/README_CN.md index 7e8726a..ae7a62e 100644 --- a/README_CN.md +++ b/README_CN.md @@ -1,4 +1,4 @@ -

English | 简体中文

+

English | 简体中文 | 日本語

diff --git a/README_JP.md b/README_JP.md new file mode 100644 index 0000000..dd4a1de --- /dev/null +++ b/README_JP.md @@ -0,0 +1,450 @@ +

English | 简体中文 | 日本語

+

+ +

+

Pake

+

Rustを使って、簡単にウェブページをデスクトップアプリに変換します。

+
+ + twitter + + telegram + + GitHub downloads + + GitHub commit + + GitHub closed issues + + Open in Colab +
+ +
PakeはMac、Windows、Linuxをサポートしています。人気のパッケージコマンドラインパッケージングカスタマイズ開発に関する情報はREADMEをご覧ください。ディスカッションでご意見をお聞かせください。
+ +## 特徴 + +- 🎐 Electron パッケージと比較して約 20 倍小さい(約 5M!) +- 🚀 Rust Tauri を使用しているため、Pake は JS ベースのフレームワークよりもはるかに軽量で高速です。 +- 📦 パッケージにはショートカットの透過、没入型ウィンドウ、ミニマリストのカスタマイズが含まれています。 +- 👻 Pake は単なるシンプルなツールです—Tauri を使用して古いバンドルアプローチを置き換えます(PWA も十分に良いです)。 + +## 人気のパッケージ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
WeRead + Mac + Windows + Linux + Twitter + Mac + Windows + Linux +
ChatGPT + Mac + Windows + Linux + Poe + Mac + Windows + Linux +
YouTube Music + Mac + Windows + Linux + YouTube + Mac + Windows + Linux +
LiZhi + Mac + Windows + Linux + ProgramMusic + Mac + Windows + Linux +
Qwerty + Mac + Windows + Linux + CodeRunner + Mac + Windows + Linux +
Flomo + Mac + Windows + Linux + XiaoHongShu + Mac + Windows + Linux +
+ +
+🏂 リリースからさらに多くのアプリケーションをダウンロードできます。ここをクリックしてショートカットの参照を展開してください! + +
+ +| Mac | Windows/Linux | 機能 | +| --------------------------- | ------------------------------ | ------------------------------ | +| + [ | Ctrl + | 前のページに戻る | +| + ] | Ctrl + | 次のページに進む | +| + | Ctrl + | ページのトップに自動スクロール | +| + | Ctrl + | ページの底に自動スクロール | +| + r | Ctrl + r | ページをリフレッシュ | +| + w | Ctrl + w | ウィンドウを隠す、終了しない | +| + - | Ctrl + - | ページを縮小 | +| + + | Ctrl + + | ページを拡大 | +| + = | Ctrl + = | ページを拡大 | +| + 0 | Ctrl + 0 | ページのズームをリセット | + +さらに、タイトルバーをダブルクリックして全画面モードに切り替えることができます。Mac ユーザーは、ジェスチャーを使用して前のページまたは次のページに移動することもできます。ウィンドウを移動するには、タイトルバーをドラッグします。 + +
+ +## 始める前に + +1. **初心者の方へ**: 「人気のパッケージ」を使用して Pake の機能を試してみてください。または、[GitHub Actions]()を使用してアプリケーションをパッケージ化してみてください。[ディスカッション](https://github.com/tw93/Pake/discussions)で助けを求めることもできます! +2. **開発者の方へ**: 「コマンドラインパッケージング」を使用してください。macOS では完全にサポートされています。Windows/Linux ユーザーは、[環境を設定](https://tauri.app/v1/guides/getting-started/prerequisites)する必要があります。 +3. **ハッカーの方へ**: フロントエンド開発と Rust の両方が得意な方は、以下の[カスタマイズ開発](#開発)でアプリの機能をさらにカスタマイズしてみてください。 + +## コマンドラインパッケージング + +![Pake](https://gw.alipayobjects.com/zos/k/zd/pake.gif) + +**Pake はコマンドラインツールを提供しており、必要なパッケージをより迅速かつ簡単にカスタマイズすることができます。詳細は[ドキュメント](./bin/README.md)をご覧ください。** + +```bash +# npmを使用してインストール +npm install -g pake-cli + +# コマンドの使用 +pake url [OPTIONS]... + +# Pakeを自由に試してみてください!初めての起動時は環境の準備に時間がかかる場合があります。 +pake https://weekly.tw93.fun --name Weekly --hide-title-bar +``` + +コマンドラインの使用に不慣れな場合は、_GitHub Actions_ を使用してオンラインでパッケージをコンパイルすることができます。[チュートリアル]()をご覧ください。 + +## 開発 + +開始する前に、Rust `>=1.63` と Node `>=16` (例: `16.18.1`) がコンピュータにインストールされていることを確認してください。インストールガイドについては、[Tauri ドキュメント](https://tauri.app/v1/guides/getting-started/prerequisites)を参照してください。 + +これらに不慣れな場合は、上記のツールを使用してワンクリックでパッケージを作成することをお勧めします。 + +```sh +# 依存関係のインストール +npm i + +# ローカル開発 [右クリックでデバッグモードを開く] +npm run dev + +# アプリケーションのパッケージング +npm run build +``` + +## 高度な使用法 + +1. [コードベースの構造](https://github.com/tw93/Pake/wiki/Description-of-Pake's-code-structure)を参照して、開発前により多くの情報を得ることができます。 +2. `src-tauri` ディレクトリ内の `pake.json` ファイルの `url` と `productName` フィールドを変更する場合は、`tauri.config.json` ファイル内の `domain` フィールド、および `tauri.xxx.conf.json` ファイル内の `icon` と `identifier` フィールドを同期して変更する必要があります。`icon` は `icons` ディレクトリから選択することも、[macOSicons](https://macosicons.com/#/) から効果に合ったものをダウンロードすることもできます。 +3. ウィンドウプロパティの設定については、`pake.json` ファイルを変更して `windows` プロパティの `width`、`height`、`fullscreen`(またはしない)、`resizable`(またはしない)の値を変更できます。Mac の没入型ヘッダーに適応するには、`hideTitleBar` を `true` に設定し、`Header` 要素を見つけて `padding-top` プロパティを追加します。 +4. スタイルの書き換え、広告の除去、JS の注入、コンテナメッセージ通信、ユーザー定義のショートカットキーについては、[高度な使用法](https://github.com/tw93/Pake/wiki/Advanced-Usage-of-Pake)を参照してください。 + +## 開発者 + +Pake の開発はこれらのハッカーたちなしにはあり得ませんでした。彼らは Pake のために多くの能力を貢献しました。彼らをフォローすることも歓迎します!❤️ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + tw93 +
+ Tw93 +
+
+ + Tlntin +
+ Tlntin +
+
+ + jeasonnow +
+ Santree +
+
+ + pan93412 +
+ Pan93412 +
+
+ + wanghanzhen +
+ Volare +
+
+ + liby +
+ Bryan Lee +
+
+ + essesoul +
+ Essesoul +
+
+ + YangguangZhou +
+ Jerry Zhou +
+
+ + AielloChan +
+ Aiello +
+
+ + m1911star +
+ Horus +
+
+ + Pake-Actions +
+ Pake Actions +
+
+ + QingZ11 +
+ Steam +
+
+ + exposir +
+ 孟世博 +
+
+ + 2nthony +
+ 2nthony +
+
+ + ACGNnsj +
+ Null +
+
+ + imabutahersiddik +
+ Abu Taher Siddik +
+
+ + kidylee +
+ An Li +
+
+ + nekomeowww +
+ Ayaka Neko +
+
+ + turkyden +
+ Dengju Deng +
+
+ + Fechin +
+ Fechin +
+
+ + eltociear +
+ Ikko Eltociear Ashimine +
+
+ + ImgBotApp +
+ Imgbot +
+
+ + droid-Q +
+ Jiaqi Gu +
+
+ + Milo123459 +
+ Milo +
+
+ + princemaple +
+ Po Chen +
+
+ + geekvest +
+ Null +
+
+ + houhoz +
+ Hyzhao +
+
+ + lakca +
+ Null +
+
+ + liudonghua123 +
+ Liudonghua +
+
+ + liusishan +
+ Liusishan +
+
+ + piaoyidage +
+ Ranger +
+
+ + hetz +
+ 贺天卓 +
+
+ + +## よくある質問 + +1. ページ内の画像要素を右クリックしてメニューを開き、「画像をダウンロード」または他のイベントを選択しても機能しない(MacOS システムで一般的)。この問題は、MacOS の組み込み webview がこの機能をサポートしていないためです。 + +## サポート + +1. 私には汤圆と可乐という 2 匹の猫がいます。Pake があなたの生活をより良くしてくれると思ったら、缶詰をあげてください 🥩。 +2. Pake が気に入ったら、GitHub でスターをつけてください。また、友達に推薦することを歓迎します。 +3. 私のTwitterをフォローして、Pake の最新情報を入手することができます。また、Telegramのチャットグループに参加することもできます。 +4. 皆さんが楽しんでいただけることを願っています。Mac アプリに適したウェブサイトを見つけたら、ぜひ教えてください。 diff --git a/dist/cli.js b/dist/cli.js index 81e8cb5..f9e4d4d 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -20,7 +20,7 @@ import psl from 'psl'; import isUrl from 'is-url'; var name = "pake-cli"; -var version = "2.5.0"; +var version = "2.5.1"; var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。"; var engines = { node: ">=16.0.0" @@ -465,9 +465,11 @@ async function combineFiles(files, output) { const contents = files.map(file => { const fileContent = fs.readFileSync(file); if (file.endsWith('.css')) { - return "window.addEventListener('DOMContentLoaded', (_event) => { const css = `" + fileContent + "`; const style = document.createElement('style'); style.innerHTML = css; document.head.appendChild(style); });"; + return ("window.addEventListener('DOMContentLoaded', (_event) => { const css = `" + + fileContent + + "`; const style = document.createElement('style'); style.innerHTML = css; document.head.appendChild(style); });"); } - return "window.addEventListener('DOMContentLoaded', (_event) => { " + fileContent + " });"; + return "window.addEventListener('DOMContentLoaded', (_event) => { " + fileContent + ' });'; }); fs.writeFileSync(output, contents.join('\n')); return files; @@ -633,7 +635,7 @@ async function mergeConfig(url, options, tauriConf) { logger.error('The injected file must be in either CSS or JS format.'); return; } - const files = inject.map(filepath => path.isAbsolute(filepath) ? filepath : path.join(process.cwd(), filepath)); + const files = inject.map(filepath => (path.isAbsolute(filepath) ? filepath : path.join(process.cwd(), filepath))); tauriConf.pake.inject = files; await combineFiles(files, injectFilePath); } @@ -1014,10 +1016,7 @@ ${green('| |_) / _` | |/ / _ \\')} ${green('| __/ (_| | < __/')} ${yellow('https://github.com/tw93/pake')} ${green('|_| \\__,_|_|\\_\\___| can turn any webpage into a desktop app with Rust.')} `; -program - .addHelpText('beforeAll', logo) - .usage(`[url] [options]`) - .showHelpAfterError(); +program.addHelpText('beforeAll', logo).usage(`[url] [options]`).showHelpAfterError(); program .argument('[url]', 'The web URL you want to package', validateUrlInput) .option('--name ', 'Application name') @@ -1034,8 +1033,12 @@ program .addOption(new Option('--user-agent ', 'Custom user agent').default(DEFAULT_PAKE_OPTIONS.userAgent).hideHelp()) .addOption(new Option('--targets ', 'Only for Linux, option "deb" or "appimage"').default(DEFAULT_PAKE_OPTIONS.targets).hideHelp()) .addOption(new Option('--always-on-top', 'Always on the top level').default(DEFAULT_PAKE_OPTIONS.alwaysOnTop).hideHelp()) - .addOption(new Option('--disabled-web-shortcuts', 'Disabled webPage shortcuts').default(DEFAULT_PAKE_OPTIONS.disabledWebShortcuts).hideHelp()) - .addOption(new Option('--safe-domain [domains...]', 'Domains that Require Security Configuration').default(DEFAULT_PAKE_OPTIONS.safeDomain).hideHelp()) + .addOption(new Option('--disabled-web-shortcuts', 'Disabled webPage shortcuts') + .default(DEFAULT_PAKE_OPTIONS.disabledWebShortcuts) + .hideHelp()) + .addOption(new Option('--safe-domain [domains...]', 'Domains that Require Security Configuration') + .default(DEFAULT_PAKE_OPTIONS.safeDomain) + .hideHelp()) .addOption(new Option('--show-system-tray', 'Show system tray in app').default(DEFAULT_PAKE_OPTIONS.showSystemTray).hideHelp()) .addOption(new Option('--system-tray-icon ', 'Custom system tray icon').default(DEFAULT_PAKE_OPTIONS.systemTrayIcon).hideHelp()) .version(packageJson.version, '-v, --version', 'Output the current version') diff --git a/package.json b/package.json index bfd8bac..9aa0ac7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pake-cli", - "version": "2.5.0", + "version": "2.5.1", "description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。", "engines": { "node": ">=16.0.0" diff --git a/script/build_with_pake_cli.js b/script/build_with_pake_cli.js index 621eec8..41cfb1c 100644 --- a/script/build_with_pake_cli.js +++ b/script/build_with_pake_cli.js @@ -17,6 +17,7 @@ console.log('hide-title-bar: ', process.env.HIDE_TITLE_BAR); console.log('resize: ', process.env.RESIZE); console.log('is multi arch? only for Mac: ', process.env.MULTI_ARCH); console.log('targets type? only for Linux: ', process.env.TARGETS); +console.log('safe-domain: ', process.env.SAFE_DOMAIN); console.log('===========================\n'); cd('node_modules/pake-cli'); @@ -39,11 +40,11 @@ if (process.env.TARGETS) { params = `${params} --targets ${process.env.TARGETS}`; } -if (process.platform === 'win32') { - params = `${params} --show-system-tray`; +if (process.env.SAFE_DOMAIN) { + params = `${params} --safe-domain ${process.env.SAFE_DOMAIN}`; } -if (process.platform === 'linux') { +if (process.platform === 'win32' || process.platform === 'linux') { params = `${params} --show-system-tray`; } diff --git a/src-tauri/png/chatgpt_512.png b/src-tauri/png/chatgpt_512.png index 6010822..0ef971d 100644 Binary files a/src-tauri/png/chatgpt_512.png and b/src-tauri/png/chatgpt_512.png differ diff --git a/src-tauri/png/coderunner_512.png b/src-tauri/png/coderunner_512.png index 375f9bd..203c11d 100644 Binary files a/src-tauri/png/coderunner_512.png and b/src-tauri/png/coderunner_512.png differ diff --git a/src-tauri/png/flomo_512.png b/src-tauri/png/flomo_512.png index e868bc4..a31ba60 100644 Binary files a/src-tauri/png/flomo_512.png and b/src-tauri/png/flomo_512.png differ diff --git a/src-tauri/png/icon_512.png b/src-tauri/png/icon_512.png index bbda5c8..4ba1291 100644 Binary files a/src-tauri/png/icon_512.png and b/src-tauri/png/icon_512.png differ diff --git a/src-tauri/png/lizhi_512.png b/src-tauri/png/lizhi_512.png index 9846846..9836b4d 100644 Binary files a/src-tauri/png/lizhi_512.png and b/src-tauri/png/lizhi_512.png differ diff --git a/src-tauri/png/poe_512.png b/src-tauri/png/poe_512.png index aaceef9..3bd02dd 100644 Binary files a/src-tauri/png/poe_512.png and b/src-tauri/png/poe_512.png differ diff --git a/src-tauri/png/programmusic_512.png b/src-tauri/png/programmusic_512.png index a75eb43..f8fc9c2 100644 Binary files a/src-tauri/png/programmusic_512.png and b/src-tauri/png/programmusic_512.png differ diff --git a/src-tauri/png/qwerty_512.png b/src-tauri/png/qwerty_512.png index 03cab91..0a0d1eb 100644 Binary files a/src-tauri/png/qwerty_512.png and b/src-tauri/png/qwerty_512.png differ diff --git a/src-tauri/png/reference_512.png b/src-tauri/png/reference_512.png index a61916c..9d292d4 100644 Binary files a/src-tauri/png/reference_512.png and b/src-tauri/png/reference_512.png differ diff --git a/src-tauri/png/twitter_512.png b/src-tauri/png/twitter_512.png index d93e601..3c6a9c4 100644 Binary files a/src-tauri/png/twitter_512.png and b/src-tauri/png/twitter_512.png differ diff --git a/src-tauri/png/wechat_512.png b/src-tauri/png/wechat_512.png index a2adc28..3e27463 100644 Binary files a/src-tauri/png/wechat_512.png and b/src-tauri/png/wechat_512.png differ diff --git a/src-tauri/png/weread_512.png b/src-tauri/png/weread_512.png index aa8a737..c6c09b3 100644 Binary files a/src-tauri/png/weread_512.png and b/src-tauri/png/weread_512.png differ diff --git a/src-tauri/png/xiaohongshu_512.png b/src-tauri/png/xiaohongshu_512.png index 9819bb8..f635c58 100644 Binary files a/src-tauri/png/xiaohongshu_512.png and b/src-tauri/png/xiaohongshu_512.png differ diff --git a/src-tauri/png/youtube_512.png b/src-tauri/png/youtube_512.png index 9bbc08e..7774b03 100644 Binary files a/src-tauri/png/youtube_512.png and b/src-tauri/png/youtube_512.png differ diff --git a/src-tauri/png/youtubemusic_512.png b/src-tauri/png/youtubemusic_512.png index 2830ace..19b0404 100644 Binary files a/src-tauri/png/youtubemusic_512.png and b/src-tauri/png/youtubemusic_512.png differ