🔖 3.2.0

This commit is contained in:
Tw93
2025-08-13 20:50:36 +08:00
parent 24b824b23b
commit ed4c7d0285
3 changed files with 153 additions and 40 deletions

75
dist/cli.js vendored
View File

@@ -17,10 +17,9 @@ import axios from 'axios';
import { dir } from 'tmp-promise';
import { fileTypeFromBuffer } from 'file-type';
import * as psl from 'psl';
import isUrl from 'is-url';
var name = "pake-cli";
var version$1 = "3.1.2";
var version$1 = "3.2.0-beta";
var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。";
var engines = {
node: ">=16.0.0"
@@ -68,17 +67,16 @@ var type = "module";
var exports = "./dist/pake.js";
var license = "MIT";
var dependencies = {
"@tauri-apps/api": "^2.2.0",
"@tauri-apps/cli": "^2.2.5",
axios: "^1.7.9",
chalk: "^5.4.1",
commander: "^13.1.0",
execa: "^9.5.2",
"file-type": "^20.0.0",
"fs-extra": "^11.3.0",
"is-url": "^1.2.4",
"@tauri-apps/api": "^2.7.0",
"@tauri-apps/cli": "^2.7.1",
axios: "^1.11.0",
chalk: "^5.5.0",
commander: "^11.1.0",
execa: "^9.6.0",
"file-type": "^18.7.0",
"fs-extra": "^11.3.1",
loglevel: "^1.9.2",
ora: "^8.1.1",
ora: "^8.2.0",
prompts: "^2.4.2",
psl: "^1.15.0",
"tmp-promise": "^3.0.3",
@@ -86,24 +84,23 @@ var dependencies = {
};
var devDependencies = {
"@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-commonjs": "^28.0.6",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-replace": "^6.0.2",
"@rollup/plugin-terser": "^0.4.4",
"@types/fs-extra": "^11.0.4",
"@types/is-url": "^1.2.32",
"@types/node": "^22.10.8",
"@types/node": "^20.19.10",
"@types/page-icon": "^0.3.6",
"@types/prompts": "^2.4.9",
"@types/psl": "^1.1.3",
"@types/psl": "^1.11.0",
"@types/tmp": "^0.2.6",
"@types/update-notifier": "^6.0.8",
"app-root-path": "^3.1.0",
"cross-env": "^7.0.3",
rollup: "^4.31.0",
rollup: "^4.46.2",
"rollup-plugin-typescript2": "^0.36.0",
tslib: "^2.8.1",
typescript: "^5.7.3"
typescript: "^5.9.2"
};
var packageJson = {
name: name,
@@ -125,7 +122,7 @@ var packageJson = {
var windows = [
{
url: "https://weread.qq.com/",
url: "https://weekly.tw93.fun/",
url_type: "web",
hide_title_bar: true,
fullscreen: false,
@@ -162,13 +159,13 @@ var pakeConf = {
proxy_url: proxy_url
};
var productName$1 = "WeRead";
var identifier = "com.pake.weread";
var productName$1 = "Weekly";
var identifier = "com.pake.weekly";
var version = "1.0.0";
var app = {
withGlobalTauri: true,
trayIcon: {
iconPath: "png/weread_512.png",
iconPath: "png/weekly_512.png",
iconAsTemplate: false,
id: "pake-tray"
}
@@ -186,12 +183,12 @@ var CommonConf = {
var bundle$2 = {
icon: [
"png/weread_256.ico",
"png/weread_32.ico"
"png/weekly_256.ico",
"png/weekly_32.ico"
],
active: true,
resources: [
"png/weread_32.ico"
"png/weekly_32.ico"
],
targets: [
"msi"
@@ -212,7 +209,7 @@ var WinConf = {
var bundle$1 = {
icon: [
"icons/weread.icns"
"icons/weekly.icns"
],
active: true,
macOS: {
@@ -228,7 +225,7 @@ var MacConf = {
var productName = "we-read";
var bundle = {
icon: [
"png/weread_512.png"
"png/weekly.png"
],
active: true,
linux: {
@@ -238,7 +235,7 @@ var bundle = {
"wget"
],
files: {
"/usr/share/applications/com-pake-weread.desktop": "assets/com-pake-weread.desktop"
"/usr/share/applications/com-pake-weekly.desktop": "assets/com-pake-weekly.desktop"
}
}
},
@@ -794,7 +791,6 @@ const DEFAULT_PAKE_OPTIONS = {
height: 780,
width: 1200,
fullscreen: false,
resizable: true,
hideTitleBar: false,
alwaysOnTop: false,
appVersion: '1.0.0',
@@ -907,11 +903,12 @@ function appendProtocol(inputUrl) {
// Normalizes the URL by ensuring it has a protocol and is valid.
function normalizeUrl(urlToNormalize) {
const urlWithProtocol = appendProtocol(urlToNormalize);
if (isUrl(urlWithProtocol)) {
try {
new URL(urlWithProtocol);
return urlWithProtocol;
}
else {
throw new Error(`Your url "${urlWithProtocol}" is invalid`);
catch (err) {
throw new Error(`Your url "${urlWithProtocol}" is invalid: ${err.message}`);
}
}
@@ -938,6 +935,11 @@ async function handleOptions(options, url) {
const namePrompt = await promptText(promptMessage, defaultName);
name = namePrompt || defaultName;
}
// Handle platform-specific name formatting
if (name && platform === 'linux') {
// Convert to lowercase and replace spaces with dashes for Linux
name = name.toLowerCase().replace(/\s+/g, '-');
}
if (!isValidName(name, platform)) {
const LINUX_NAME_ERROR = `✕ Name should only include lowercase letters, numbers, and dashes (not leading dashes). Examples: com-123-xxx, 123pan, pan123, weread, we-read, 123.`;
const DEFAULT_NAME_ERROR = `✕ Name should only include letters, numbers, dashes, and spaces (not leading dashes and spaces). Examples: 123pan, 123Pan, Pan123, weread, WeRead, WERead, we-read, We Read, 123.`;
@@ -996,12 +998,7 @@ program
// Refer to https://github.com/tj/commander.js#custom-option-processing, turn string array into a string connected with custom connectors.
// If the platform is Linux, use `-` as the connector, and convert all characters to lowercase.
// For example, Google Translate will become google-translate.
.option('--name <string...>', 'Application name', (value, previous) => {
const platform = process.platform;
const connector = platform === 'linux' ? '-' : ' ';
const name = previous === undefined ? value : `${previous}${connector}${value}`;
return platform === 'linux' ? name.toLowerCase() : name;
})
.option('--name <string>', 'Application name')
.option('--icon <string>', 'Application icon', DEFAULT_PAKE_OPTIONS.icon)
.option('--width <number>', 'Window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width)
.option('--height <number>', 'Window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height)
@@ -1021,7 +1018,7 @@ program
return previous ? [...previous, ...files] : files;
}, DEFAULT_PAKE_OPTIONS.inject)
.option('--debug', 'Debug build and more output', DEFAULT_PAKE_OPTIONS.debug)
.addOption(new Option('--proxy-url <url>', 'Proxy URL for all network requests')
.addOption(new Option('--proxy-url <url>', 'Proxy URL for all network requests (http://, https://, socks5://)')
.default(DEFAULT_PAKE_OPTIONS.proxyUrl)
.hideHelp())
.addOption(new Option('--user-agent <string>', 'Custom user agent')

View File

@@ -1,6 +1,6 @@
{
"name": "pake-cli",
"version": "3.1.2",
"version": "3.2.0-beta",
"description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。",
"engines": {
"node": ">=16.0.0"
@@ -53,6 +53,7 @@
"axios": "^1.11.0",
"chalk": "^5.5.0",
"commander": "^11.1.0",
"execa": "^9.6.0",
"file-type": "^18.7.0",
"fs-extra": "^11.3.1",
"loglevel": "^1.9.2",

115
pnpm-lock.yaml generated
View File

@@ -23,6 +23,9 @@ importers:
commander:
specifier: ^11.1.0
version: 11.1.0
execa:
specifier: ^9.6.0
version: 9.6.0
file-type:
specifier: ^18.7.0
version: 18.7.0
@@ -291,6 +294,13 @@ packages:
cpu: [x64]
os: [win32]
'@sec-ant/readable-stream@0.4.1':
resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==}
'@sindresorhus/merge-streams@4.0.0':
resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==}
engines: {node: '>=18'}
'@tauri-apps/api@2.7.0':
resolution: {integrity: sha512-v7fVE8jqBl8xJFOcBafDzXFc8FnicoH3j8o8DNNs0tHuEBmXUDqrCOAzMRX0UkfpwqZLqvrvK0GNQ45DfnoVDg==}
@@ -570,6 +580,10 @@ packages:
resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
engines: {node: '>=0.8.x'}
execa@9.6.0:
resolution: {integrity: sha512-jpWzZ1ZhwUmeWRhS7Qv3mhpOhLfwI+uAX4e5fOcXqwMR7EcJ0pj2kV1CVzHVMX/LphnKWD3LObjZCoJ71lKpHw==}
engines: {node: ^18.19.0 || >=20.5.0}
fdir@6.4.6:
resolution: {integrity: sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==}
peerDependencies:
@@ -578,6 +592,10 @@ packages:
picomatch:
optional: true
figures@6.1.0:
resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==}
engines: {node: '>=18'}
file-type@18.7.0:
resolution: {integrity: sha512-ihHtXRzXEziMrQ56VSgU7wkxh55iNchFkosu7Y9/S+tXHdKyrGjVK0ujbqNnsxzea+78MaLhN6PGmfYSAv1ACw==}
engines: {node: '>=14.16'}
@@ -631,6 +649,10 @@ packages:
resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==}
engines: {node: '>= 0.4'}
get-stream@9.0.1:
resolution: {integrity: sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==}
engines: {node: '>=18'}
global-directory@4.0.1:
resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==}
engines: {node: '>=18'}
@@ -657,6 +679,10 @@ packages:
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
engines: {node: '>= 0.4'}
human-signals@8.0.1:
resolution: {integrity: sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==}
engines: {node: '>=18.18.0'}
ieee754@1.2.1:
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
@@ -692,9 +718,17 @@ packages:
resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==}
engines: {node: '>=12'}
is-plain-obj@4.1.0:
resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==}
engines: {node: '>=12'}
is-reference@1.2.1:
resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==}
is-stream@4.0.1:
resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==}
engines: {node: '>=18'}
is-unicode-supported@1.3.0:
resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==}
engines: {node: '>=12'}
@@ -759,6 +793,10 @@ packages:
minimist@1.2.8:
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
npm-run-path@6.0.0:
resolution: {integrity: sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==}
engines: {node: '>=18'}
onetime@7.0.0:
resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==}
engines: {node: '>=18'}
@@ -783,6 +821,10 @@ packages:
resolution: {integrity: sha512-ua1L4OgXSBdsu1FPb7F3tYH0F48a6kxvod4pLUlGY9COeJAJQNX/sNH2IiEmsxw7lqYiAwrdHMjz1FctOsyDQg==}
engines: {node: '>=18'}
parse-ms@4.0.0:
resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==}
engines: {node: '>=18'}
path-exists@4.0.0:
resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
engines: {node: '>=8'}
@@ -791,6 +833,10 @@ packages:
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
engines: {node: '>=8'}
path-key@4.0.0:
resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==}
engines: {node: '>=12'}
peek-readable@5.4.2:
resolution: {integrity: sha512-peBp3qZyuS6cNIJ2akRNG1uo1WJ1d0wTxg/fxMdZ0BqCVhx242bSFHM9eNqflfJVS9SsgkzgT/1UgnsurBOTMg==}
engines: {node: '>=14.16'}
@@ -807,6 +853,10 @@ packages:
resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==}
engines: {node: '>=8'}
pretty-ms@9.2.0:
resolution: {integrity: sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==}
engines: {node: '>=18'}
process@0.11.10:
resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==}
engines: {node: '>= 0.6.0'}
@@ -937,6 +987,10 @@ packages:
resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==}
engines: {node: '>=12'}
strip-final-newline@4.0.0:
resolution: {integrity: sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==}
engines: {node: '>=18'}
strip-json-comments@2.0.1:
resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==}
engines: {node: '>=0.10.0'}
@@ -983,6 +1037,10 @@ packages:
undici-types@6.21.0:
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
unicorn-magic@0.3.0:
resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==}
engines: {node: '>=18'}
universalify@2.0.1:
resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
engines: {node: '>= 10.0.0'}
@@ -1019,6 +1077,10 @@ packages:
resolution: {integrity: sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==}
engines: {node: '>=12'}
yoctocolors@2.1.1:
resolution: {integrity: sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==}
engines: {node: '>=18'}
snapshots:
'@jridgewell/gen-mapping@0.3.13':
@@ -1162,6 +1224,10 @@ snapshots:
'@rollup/rollup-win32-x64-msvc@4.46.2':
optional: true
'@sec-ant/readable-stream@0.4.1': {}
'@sindresorhus/merge-streams@4.0.0': {}
'@tauri-apps/api@2.7.0': {}
'@tauri-apps/cli-darwin-arm64@2.7.1':
@@ -1410,10 +1476,29 @@ snapshots:
events@3.3.0: {}
execa@9.6.0:
dependencies:
'@sindresorhus/merge-streams': 4.0.0
cross-spawn: 7.0.6
figures: 6.1.0
get-stream: 9.0.1
human-signals: 8.0.1
is-plain-obj: 4.1.0
is-stream: 4.0.1
npm-run-path: 6.0.0
pretty-ms: 9.2.0
signal-exit: 4.1.0
strip-final-newline: 4.0.0
yoctocolors: 2.1.1
fdir@6.4.6(picomatch@4.0.3):
optionalDependencies:
picomatch: 4.0.3
figures@6.1.0:
dependencies:
is-unicode-supported: 2.1.0
file-type@18.7.0:
dependencies:
readable-web-to-node-stream: 3.0.4
@@ -1478,6 +1563,11 @@ snapshots:
dunder-proto: 1.0.1
es-object-atoms: 1.1.1
get-stream@9.0.1:
dependencies:
'@sec-ant/readable-stream': 0.4.1
is-stream: 4.0.1
global-directory@4.0.1:
dependencies:
ini: 4.1.1
@@ -1498,6 +1588,8 @@ snapshots:
dependencies:
function-bind: 1.1.2
human-signals@8.0.1: {}
ieee754@1.2.1: {}
ini@1.3.8: {}
@@ -1519,10 +1611,14 @@ snapshots:
is-path-inside@4.0.0: {}
is-plain-obj@4.1.0: {}
is-reference@1.2.1:
dependencies:
'@types/estree': 1.0.8
is-stream@4.0.1: {}
is-unicode-supported@1.3.0: {}
is-unicode-supported@2.1.0: {}
@@ -1574,6 +1670,11 @@ snapshots:
minimist@1.2.8: {}
npm-run-path@6.0.0:
dependencies:
path-key: 4.0.0
unicorn-magic: 0.3.0
onetime@7.0.0:
dependencies:
mimic-function: 5.0.1
@@ -1607,10 +1708,14 @@ snapshots:
registry-url: 6.0.1
semver: 7.7.2
parse-ms@4.0.0: {}
path-exists@4.0.0: {}
path-key@3.1.1: {}
path-key@4.0.0: {}
peek-readable@5.4.2: {}
picomatch@2.3.1: {}
@@ -1621,6 +1726,10 @@ snapshots:
dependencies:
find-up: 4.1.0
pretty-ms@9.2.0:
dependencies:
parse-ms: 4.0.0
process@0.11.10: {}
prompts@2.4.2:
@@ -1775,6 +1884,8 @@ snapshots:
dependencies:
ansi-regex: 6.1.0
strip-final-newline@4.0.0: {}
strip-json-comments@2.0.1: {}
strtok3@7.1.1:
@@ -1812,6 +1923,8 @@ snapshots:
undici-types@6.21.0: {}
unicorn-magic@0.3.0: {}
universalify@2.0.1: {}
update-notifier@7.3.1:
@@ -1854,3 +1967,5 @@ snapshots:
strip-ansi: 7.1.0
xdg-basedir@5.1.0: {}
yoctocolors@2.1.1: {}