pake-cli 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.ecrc.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "Exclude": ["Cargo\\.lock$"]
2
+ "Exclude": ["Cargo\\.lock$", "dist"]
3
3
  }
@@ -1,8 +1,4 @@
1
1
  {
2
- "cSpell.words": [
3
- "loglevel",
4
- "Pake",
5
- "tauri"
6
- ],
7
- "typescript.preferences.importModuleSpecifierEnding": "js"
8
- }
2
+ "cSpell.words": ["loglevel", "Pake", "tauri"],
3
+ "typescript.preferences.importModuleSpecifierEnding": "js"
4
+ }
package/README.md CHANGED
@@ -74,7 +74,7 @@
74
74
  | <kbd>⌘</kbd> + <kbd>r</kbd> | <kbd>Ctrl</kbd> + <kbd>r</kbd> | 刷新页面 |
75
75
  | <kbd>⌘</kbd> + <kbd>w</kbd> | <kbd>Ctrl</kbd> + <kbd>w</kbd> | 隐藏窗口,非退出 |
76
76
  | <kbd>⌘</kbd> + <kbd>-</kbd> | <kbd>Ctrl</kbd> + <kbd>-</kbd> | 缩小页面 |
77
- | <kbd>⌘</kbd> + <kbd>w</kbd> | <kbd>Ctrl</kbd> + <kbd>+</kbd> | 放大页面 |
77
+ | <kbd>⌘</kbd> + <kbd>+</kbd> | <kbd>Ctrl</kbd> + <kbd>+</kbd> | 放大页面 |
78
78
  | <kbd>⌘</kbd> + <kbd>=</kbd> | <kbd>Ctrl</kbd> + <kbd>=</kbd> | 放大页面 |
79
79
  | <kbd>⌘</kbd> + <kbd>0</kbd> | <kbd>Ctrl</kbd> + <kbd>0</kbd> | 重置页面缩放 |
80
80
 
@@ -82,9 +82,29 @@
82
82
 
83
83
  ## 注意点
84
84
 
85
- - Windows 下不能安装到 C:\Program File,会直接闪退。建议安装到其他目录,比如 D:\Program Files。
85
+ - Windows 下不能安装到 C:\Program File,会直接闪退。建议安装到其他非管理员权限目录,比如 D:\Program Files (x86)
86
86
  - Linux 下暂时不能存 cookie,即应用关闭后数据清空,账号自动推出。
87
87
 
88
+ ## 使用命令行打包
89
+
90
+ Pake 提供了命令行工具,可以更快捷方便地打包。(目前仅支持 MacOS)
91
+
92
+ ### 安装
93
+
94
+ ```bash
95
+ npm install -g pake-cli
96
+ ```
97
+
98
+ 如果安装失败提示没有权限,请使用 `sudo` 运行。
99
+
100
+ ### 用法
101
+
102
+ ```bash
103
+ pake [options] url
104
+ ```
105
+
106
+ 更多用法可查看[文档](./bin//README.md)。
107
+
88
108
  ## 开发
89
109
 
90
110
  开始前参考 [Tauri](https://tauri.app/v1/guides/getting-started/prerequisites#setting-up-macos) 快速配置好环境。
package/README_EN.md CHANGED
@@ -82,7 +82,7 @@ In addition, it supports double clicking the head to switch to full screen, and
82
82
 
83
83
  ## Precautions
84
84
 
85
- - It cannot be installed to C:\Program File under Windows, and it will crash directly. It is recommended to install to another directory, such as D:\Program Files.
85
+ - It cannot be installed to C:\Program File under Windows, and it will crash directly. It is recommended to install to other non-administrator directories, such as D:\Program Files (x86) .
86
86
  - Under Linux, cookies cannot be stored temporarily, that is, the data will be cleared after the application is closed, and the account will be automatically released.
87
87
 
88
88
  ## Development
package/bin/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ## 安装
2
2
 
3
3
  ```bash
4
- npm install -g pake
4
+ npm install -g pake-cli
5
5
  ```
6
6
 
7
7
  如果安装失败提示没有权限,请使用 `sudo` 运行。
@@ -17,7 +17,7 @@ export default class MacBuilder implements IBuilder {
17
17
 
18
18
  const res = await prompts({
19
19
  type: 'confirm',
20
- message: 'Detect you have not installed Rust, install it now?',
20
+ message: 'We detected that you have not installed Rust. Install it now?',
21
21
  name: 'value',
22
22
  });
23
23
 
@@ -1,16 +1,15 @@
1
- import axios from "axios";
2
- import { fileTypeFromBuffer } from "file-type";
3
- import { PakeAppOptions } from "../types.js";
4
- import { dir } from "tmp-promise";
5
- import path from "path";
6
- import fs from "fs/promises";
7
- import { fileURLToPath } from "url";
8
- import log from "loglevel";
1
+ import axios from 'axios';
2
+ import { fileTypeFromBuffer } from 'file-type';
3
+ import { PakeAppOptions } from '../types.js';
4
+ import { dir } from 'tmp-promise';
5
+ import path from 'path';
6
+ import fs from 'fs/promises';
7
+ import { fileURLToPath } from 'url';
8
+ import log from 'loglevel';
9
9
 
10
10
  export async function handleIcon(options: PakeAppOptions, url: string) {
11
11
  if (options.icon) {
12
- if (options.icon.startsWith("http")) {
13
- log.info(options.icon);
12
+ if (options.icon.startsWith('http')) {
14
13
  return downloadIcon(options.icon);
15
14
  } else {
16
15
  return path.resolve(options.icon);
@@ -22,14 +21,9 @@ export async function handleIcon(options: PakeAppOptions, url: string) {
22
21
  }
23
22
 
24
23
  export async function inferIcon(name: string, url: string) {
25
- log.info(
26
- "You have not provided an app icon, use the default icon(can use --icon option to assign an icon)"
27
- );
28
- const npmDirectory = path.join(
29
- path.dirname(fileURLToPath(import.meta.url)),
30
- ".."
31
- );
32
- return path.join(npmDirectory, "pake-default.icns");
24
+ log.info('You have not provided an app icon, use the default icon(can use --icon option to assign an icon)')
25
+ const npmDirectory = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
26
+ return path.join(npmDirectory, 'pake-default.icns');
33
27
  }
34
28
 
35
29
  // export async function getIconFromPageUrl(url: string) {
@@ -73,7 +67,7 @@ export async function downloadIcon(iconUrl: string) {
73
67
  let iconResponse;
74
68
  try {
75
69
  iconResponse = await axios.get(iconUrl, {
76
- responseType: "arraybuffer",
70
+ responseType: 'arraybuffer',
77
71
  });
78
72
  } catch (error) {
79
73
  if (error.response && error.response.status === 404) {
@@ -1,13 +1,13 @@
1
- import shelljs from 'shelljs';
1
+ import shelljs from "shelljs";
2
2
 
3
3
  export function shellExec(command: string) {
4
4
  return new Promise<number>((resolve, reject) => {
5
- shelljs.exec(command, { async: true, silent: false}, (code) => {
6
- if (code === 0) {
7
- resolve(0);
8
- } else {
9
- reject(new Error(`${code}`));
10
- }
11
- });
5
+ shelljs.exec(command, { async: true, silent: false }, (code) => {
6
+ if (code === 0) {
7
+ resolve(0);
8
+ } else {
9
+ reject(new Error(`${code}`));
10
+ }
11
+ });
12
12
  });
13
13
  }