diff --git a/LICENSE b/LICENSE index 7d2e69e..0ca62b7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Tw93 +Copyright (c) 2023 Tw93 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 2a88fc1..e40ee45 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ - + YouTube Music @@ -75,7 +75,7 @@ - + LiZhi @@ -91,7 +91,7 @@ - + Qwerty @@ -123,7 +123,7 @@ - + @@ -159,7 +159,7 @@ In addition, double-click the title bar to switch to full-screen mode. For Mac u ![Pake](https://gw.alipayobjects.com/zos/k/zd/pake.gif) -**Pake provides a command line tool, making the flow of package customization quicker and easier. See [documentation](./bin/README_CN.md) for more information.** +**Pake provides a command line tool, making the flow of package customization quicker and easier. See [documentation](./bin/README.md) for more information.** ```bash # Install with npm @@ -198,7 +198,7 @@ npm run build 3. For configurations on window properties, you can modify the `pake.json` file to change the value of `width`, `height`, `fullscreen` (or not), `resizable` (or not) of the `windows` property. To adapt to the immersive header on Mac, change `transparent` to `true`, look for the `Header` element, and add the `padding-top` property. 4. For advanced usages such as style rewriting, advertisement removal, JS injection, container message communication, and user-defined shortcut keys, see [Advanced Usage of Pake](https://github.com/tw93/Pake/wiki/Advanced-Usage-of-Pake). -## Developer +## Developers Pake's development can not be without these Hackers. They contributed a lot of capabilities for Pake. Also, welcome to follow them! ❤️ diff --git a/README_CN.md b/README_CN.md index 406a777..26325da 100644 --- a/README_CN.md +++ b/README_CN.md @@ -58,7 +58,7 @@ - + YouTube Music @@ -74,7 +74,7 @@ - + LiZhi @@ -90,7 +90,7 @@ - + Qwerty @@ -122,7 +122,7 @@ - + @@ -271,6 +271,13 @@ Pake 的发展离不开这些 Hacker 们,一起贡献了大量能力,也欢 Pake Actions + + + jeasonnow +
+ Santree +
+ QingZ11 @@ -285,13 +292,6 @@ Pake 的发展离不开这些 Hacker 们,一起贡献了大量能力,也欢 孟世博 - - - jeasonnow -
- Santree -
- 2nthony diff --git a/bin/README_CN.md b/bin/README_CN.md index e28be37..8904969 100644 --- a/bin/README_CN.md +++ b/bin/README_CN.md @@ -11,8 +11,7 @@ npm install pake-cli -g ## Windows/Linux 注意事项 - **非常重要**:请参阅 Tauri 的 [依赖项指南](https://tauri.app/v1/guides/getting-started/prerequisites)。 -- 对于 Windows 用户,请确保至少安装了 `Win10 SDK(10.0.19041.0)` 和 `Visual Studio Build Tools 2022(版本 17.2 或更高)` - 。此外,还需要安装以下组件: +- 对于 Windows 用户,请确保至少安装了 `Win10 SDK(10.0.19041.0)` 和 `Visual Studio Build Tools 2022(版本 17.2 或更高)`,此外还需要安装以下组件: 1. Microsoft Visual C++ 2015-2022 Redistributable (x64) 2. Microsoft Visual C++ 2015-2022 Redistributable (x86) diff --git a/bin/builders/BaseBuilder.ts b/bin/builders/BaseBuilder.ts index 5c96a8d..395b272 100644 --- a/bin/builders/BaseBuilder.ts +++ b/bin/builders/BaseBuilder.ts @@ -27,8 +27,8 @@ export default abstract class BaseBuilder { const tauriTargetPathExists = await fsExtra.pathExists(tauriTargetPath); if (!IS_MAC && !tauriTargetPathExists) { - logger.info('✺ The first use requires installing system dependencies.'); - logger.info('✺ See more in https://tauri.app/v1/guides/getting-started/prerequisites.'); + logger.warn('✼ The first use requires installing system dependencies.'); + logger.warn('✼ See more in https://tauri.app/v1/guides/getting-started/prerequisites.'); } if (!checkRustInstalled()) { @@ -78,7 +78,7 @@ export default abstract class BaseBuilder { // Build app const spinner = getSpinner('Building app...'); setTimeout(() => spinner.stop(), 3000); - await shellExec(`cd ${npmDirectory} && ${this.getBuildCommand()}`); + await shellExec(`cd "${npmDirectory}" && ${this.getBuildCommand()}`); // Copy app const fileName = this.getFileName(); diff --git a/bin/cli.ts b/bin/cli.ts index 1b7033e..e7ff5f6 100644 --- a/bin/cli.ts +++ b/bin/cli.ts @@ -10,9 +10,17 @@ import handleInputOptions from './options/index'; import { PakeCliOptions } from './types'; import { validateNumberInput, validateUrlInput } from './utils/validate'; +const { green, yellow }= chalk; +const logo = `${chalk.green(' ____ _')} +${green('| _ \\ __ _| | _____')} +${green('| |_) / _` | |/ / _ \\')} +${green('| __/ (_| | < __/')} ${yellow('https://github.com/tw93/pake')} +${green('|_| \\__,_|_|\\_\\___| can turn any webpage into a desktop app with Rust.')} +`; + program - .description(chalk.green('Pake can turn any webpage into a desktop app with Rust.')) - .usage('[url] [options]') + .addHelpText('beforeAll', logo) + .usage(`[url] [options]`) .showHelpAfterError(); program diff --git a/bin/helpers/updater.ts b/bin/helpers/updater.ts index 549e989..a55837b 100644 --- a/bin/helpers/updater.ts +++ b/bin/helpers/updater.ts @@ -2,5 +2,5 @@ import updateNotifier from 'update-notifier'; import packageJson from '../../package.json'; export async function checkUpdateTips() { - updateNotifier({ pkg: packageJson, updateCheckInterval: 1000 * 60 }).notify(); + updateNotifier({ pkg: packageJson, updateCheckInterval: 1000 * 60 }).notify({ isGlobal: true }); } diff --git a/bin/utils/info.ts b/bin/utils/info.ts index a08a726..f9ad6ac 100644 --- a/bin/utils/info.ts +++ b/bin/utils/info.ts @@ -6,7 +6,7 @@ import chalk from 'chalk'; // Generates an identifier based on the given URL. export function getIdentifier(url: string) { const postFixHash = crypto.createHash('md5').update(url).digest('hex').substring(0, 6); - return `pake-${postFixHash}`; + return `com.pake.${postFixHash}`; } export async function promptText(message: string, initial?: string): Promise { diff --git a/dist/cli.js b/dist/cli.js index c170218..149c43a 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -20,7 +20,7 @@ import isUrl from 'is-url'; import fs from 'fs'; var name = "pake-cli"; -var version = "2.1.8"; +var version = "2.1.12"; var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。"; var engines = { node: ">=16.0.0" @@ -205,7 +205,7 @@ var tauri$2 = { "png/weread_256.ico", "png/weread_32.ico" ], - identifier: "com.tw93.weread", + identifier: "com.pake.weread", active: true, category: "DeveloperTool", copyright: "", @@ -241,7 +241,7 @@ var tauri$1 = { icon: [ "icons/weread.icns" ], - identifier: "com.tw93.weread", + identifier: "com.pake.weread", active: true, category: "DeveloperTool", copyright: "", @@ -273,7 +273,7 @@ var tauri = { icon: [ "png/weread_512.png" ], - identifier: "com.tw93.weread", + identifier: "com.pake.weread", active: true, category: "DeveloperTool", copyright: "", @@ -283,7 +283,7 @@ var tauri = { "wget" ], files: { - "/usr/share/applications/com-tw93-weread.desktop": "assets/com-tw93-weread.desktop" + "/usr/share/applications/com-pake-weread.desktop": "assets/com-pake-weread.desktop" } }, externalBin: [ @@ -617,8 +617,8 @@ class BaseBuilder { const tauriTargetPath = path.join(tauriSrcPath, 'target'); const tauriTargetPathExists = await fsExtra.pathExists(tauriTargetPath); if (!IS_MAC && !tauriTargetPathExists) { - logger.info('✺ The first use requires installing system dependencies.'); - logger.info('✺ See more in https://tauri.app/v1/guides/getting-started/prerequisites.'); + logger.warn('✼ The first use requires installing system dependencies.'); + logger.warn('✼ See more in https://tauri.app/v1/guides/getting-started/prerequisites.'); } if (!checkRustInstalled()) { const res = await prompts({ @@ -662,7 +662,7 @@ class BaseBuilder { // Build app const spinner = getSpinner('Building app...'); setTimeout(() => spinner.stop(), 3000); - await shellExec(`cd ${npmDirectory} && ${this.getBuildCommand()}`); + await shellExec(`cd "${npmDirectory}" && ${this.getBuildCommand()}`); // Copy app const fileName = this.getFileName(); const fileType = this.getFileType(target); @@ -786,7 +786,7 @@ const DEFAULT_PAKE_OPTIONS = { }; async function checkUpdateTips() { - updateNotifier({ pkg: packageJson, updateCheckInterval: 1000 * 60 }).notify(); + updateNotifier({ pkg: packageJson, updateCheckInterval: 1000 * 60 }).notify({ isGlobal: true }); } async function handleIcon(options) { @@ -939,9 +939,16 @@ function validateUrlInput(url) { return url; } +const { green, yellow } = chalk; +const logo = `${chalk.green(' ____ _')} +${green('| _ \\ __ _| | _____')} +${green('| |_) / _` | |/ / _ \\')} +${green('| __/ (_| | < __/')} ${yellow('https://github.com/tw93/pake')} +${green('|_| \\__,_|_|\\_\\___| can turn any webpage into a desktop app with Rust.')} +`; program - .description(chalk.green('Pake can turn any webpage into a desktop app with Rust.')) - .usage('[url] [options]') + .addHelpText('beforeAll', logo) + .usage(`[url] [options]`) .showHelpAfterError(); program .argument('[url]', 'The web URL you want to package', validateUrlInput) diff --git a/package.json b/package.json index 8b78eed..6ddbac1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pake-cli", - "version": "2.1.8", + "version": "2.1.12", "description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。", "engines": { "node": ">=16.0.0" diff --git a/script/build.ps1 b/script/build.ps1 index eee84b9..03747cd 100644 --- a/script/build.ps1 +++ b/script/build.ps1 @@ -24,7 +24,7 @@ $PSVersionTable Write-Host "=======================`n" -$identifier_prefix = "com.tw93" +$identifier_prefix = "com.pake" # total package number $index = 1 diff --git a/script/build.sh b/script/build.sh index a8a5317..bc27133 100755 --- a/script/build.sh +++ b/script/build.sh @@ -32,10 +32,8 @@ total=$(sed -n '$=' app.csv) export total=$((total-1)) export index=1 -export package_prefix="com-tw93" -export identifier_prefix="com.tw93" - - +export package_prefix="com-pake" +export identifier_prefix="com.pake" if [[ "$OSTYPE" =~ ^linux ]]; then echo "===============" diff --git a/src-tauri/assets/com-tw93-weread.desktop b/src-tauri/assets/com-tw93-weread.desktop index befc21a..00bcc03 100644 --- a/src-tauri/assets/com-tw93-weread.desktop +++ b/src-tauri/assets/com-tw93-weread.desktop @@ -1,10 +1,10 @@ [Desktop Entry] Encoding=UTF-8 Categories=Office -Exec=com-tw93-weread -Icon=com-tw93-weread -Name=com-tw93-weread +Exec=com-pake-weread +Icon=com-pake-weread +Name=com-pake-weread Name[zh_CN]=微信阅读 StartupNotify=true Terminal=false -Type=Application \ No newline at end of file +Type=Application diff --git a/src-tauri/icons/figma.icns b/src-tauri/icons/figma.icns new file mode 100644 index 0000000..16a4920 Binary files /dev/null and b/src-tauri/icons/figma.icns differ diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json index d9db8ea..8c8eef0 100644 --- a/src-tauri/tauri.linux.conf.json +++ b/src-tauri/tauri.linux.conf.json @@ -2,14 +2,14 @@ "tauri": { "bundle": { "icon": ["png/weread_512.png"], - "identifier": "com.tw93.weread", + "identifier": "com.pake.weread", "active": true, "category": "DeveloperTool", "copyright": "", "deb": { "depends": ["curl", "wget"], "files": { - "/usr/share/applications/com-tw93-weread.desktop": "assets/com-tw93-weread.desktop" + "/usr/share/applications/com-pake-weread.desktop": "assets/com-pake-weread.desktop" } }, "externalBin": [], diff --git a/src-tauri/tauri.macos.conf.json b/src-tauri/tauri.macos.conf.json index da0c8e1..f8cce2a 100644 --- a/src-tauri/tauri.macos.conf.json +++ b/src-tauri/tauri.macos.conf.json @@ -1,29 +1,22 @@ { - "tauri": { - "bundle": { - "icon": [ - "/Users/guyifeng/workspace/seeyon/Pake/src-tauri/icons/icon.icns" - ], - "identifier": "pake-4269dd", - "active": true, - "category": "DeveloperTool", - "copyright": "", - "externalBin": [], - "longDescription": "", - "macOS": { - "entitlements": null, - "exceptionDomain": "", - "frameworks": [], - "providerShortName": null, - "signingIdentity": null - }, - "resources": [ - "icons/zbook.icns" - ], - "shortDescription": "", - "targets": [ - "dmg" - ] - } + "tauri": { + "bundle": { + "icon": ["icons/weread.icns"], + "identifier": "com.pake.weread", + "active": true, + "category": "DeveloperTool", + "copyright": "", + "externalBin": [], + "longDescription": "", + "macOS": { + "entitlements": null, + "exceptionDomain": "", + "frameworks": [], + "providerShortName": null, + "signingIdentity": null + }, + "resources": [], + "shortDescription": "", + "targets": ["dmg"] } } diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json index b46b429..d05799e 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows.conf.json @@ -2,7 +2,7 @@ "tauri": { "bundle": { "icon": ["png/weread_256.ico", "png/weread_32.ico"], - "identifier": "com.tw93.weread", + "identifier": "com.pake.weread", "active": true, "category": "DeveloperTool", "copyright": "",