Merge remote-tracking branch 'origin/master' into dev

This commit is contained in:
jeasonnow
2023-07-04 16:31:59 +08:00
17 changed files with 82 additions and 77 deletions

View File

@@ -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

View File

@@ -59,7 +59,7 @@
</tr>
<tr>
<td><img src=https://cdn.fliggy.com/upic/Ld5ZCJ.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/7QUfi3.png width=600/></td>
<td><img src=https://gw.alipayobjects.com/zos/k/95/bcGBut.png width=600/></td>
</tr>
<tr>
<td>YouTube Music
@@ -75,7 +75,7 @@
</tr>
<tr>
<td><img src=https://cdn.fliggy.com/upic/iz3mtQ.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/s4ZLNC.jpg width=600/></td>
<td><img src=https://gw.alipayobjects.com/zos/k/pn/1.jpg width=600/></td>
</tr>
<tr>
<td>LiZhi
@@ -91,7 +91,7 @@
</tr>
<tr>
<td><img src=https://cdn.fliggy.com/upic/nYEKqN.jpg width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/0C9lju.jpg width=600/></td>
<td><img src=https://gw.alipayobjects.com/zos/k/r7/0C9lju.jpg width=600/></td>
</tr>
<tr>
<td>Qwerty
@@ -123,7 +123,7 @@
</tr>
<tr>
<td><img src=https://gw.alipayobjects.com/zos/k/30/RoUSUf.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/yJVwyi.png width=600/></td>
<td><img src=https://gw.alipayobjects.com/zos/k/89/yJVwyi.png width=600/></td>
</tr>
</table>
@@ -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! ❤️

View File

@@ -58,7 +58,7 @@
</tr>
<tr>
<td><img src=https://cdn.fliggy.com/upic/Ld5ZCJ.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/7QUfi3.png width=600/></td>
<td><img src=https://gw.alipayobjects.com/zos/k/95/bcGBut.png width=600/></td>
</tr>
<tr>
<td>YouTube Music
@@ -74,7 +74,7 @@
</tr>
<tr>
<td><img src=https://cdn.fliggy.com/upic/iz3mtQ.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/s4ZLNC.jpg width=600/></td>
<td><img src=https://gw.alipayobjects.com/zos/k/pn/1.jpg width=600/></td>
</tr>
<tr>
<td>LiZhi
@@ -90,7 +90,7 @@
</tr>
<tr>
<td><img src=https://cdn.fliggy.com/upic/nYEKqN.jpg width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/0C9lju.jpg width=600/></td>
<td><img src=https://gw.alipayobjects.com/zos/k/r7/0C9lju.jpg width=600/></td>
</tr>
<tr>
<td>Qwerty
@@ -122,7 +122,7 @@
</tr>
<tr>
<td><img src=https://gw.alipayobjects.com/zos/k/30/RoUSUf.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/yJVwyi.png width=600/></td>
<td><img src=https://gw.alipayobjects.com/zos/k/89/yJVwyi.png width=600/></td>
</tr>
</table>
@@ -271,6 +271,13 @@ Pake 的发展离不开这些 Hacker 们,一起贡献了大量能力,也欢
<sub><b>Pake Actions</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/jeasonnow">
<img src="https://avatars.githubusercontent.com/u/16950207?v=4" width="90;" alt="jeasonnow"/>
<br />
<sub><b>Santree</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/QingZ11">
<img src="https://avatars.githubusercontent.com/u/38887077?v=4" width="90;" alt="QingZ11"/>
@@ -285,13 +292,6 @@ Pake 的发展离不开这些 Hacker 们,一起贡献了大量能力,也欢
<sub><b>孟世博</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/jeasonnow">
<img src="https://avatars.githubusercontent.com/u/16950207?v=4" width="90;" alt="jeasonnow"/>
<br />
<sub><b>Santree</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/2nthony">
<img src="https://avatars.githubusercontent.com/u/19513289?v=4" width="90;" alt="2nthony"/>

3
bin/README_CN.md vendored
View File

@@ -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)

View File

@@ -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();

12
bin/cli.ts vendored
View File

@@ -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

View File

@@ -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 });
}

2
bin/utils/info.ts vendored
View File

@@ -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<string> {

29
dist/cli.js vendored
View File

@@ -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)

View File

@@ -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"

2
script/build.ps1 vendored
View File

@@ -24,7 +24,7 @@ $PSVersionTable
Write-Host "=======================`n"
$identifier_prefix = "com.tw93"
$identifier_prefix = "com.pake"
# total package number
$index = 1

6
script/build.sh vendored
View File

@@ -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 "==============="

View File

@@ -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
Type=Application

BIN
src-tauri/icons/figma.icns Normal file

Binary file not shown.

View File

@@ -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": [],

View File

@@ -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"]
}
}

View File

@@ -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": "",