pake-cli 1.2.7 → 1.2.9

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.
Files changed (39) hide show
  1. package/README.md +25 -9
  2. package/dist/cli.js +36 -22
  3. package/package.json +2 -2
  4. package/src-tauri/assets/com-tw93-weread.desktop +1 -1
  5. package/src-tauri/icons/coderunner.icns +0 -0
  6. package/src-tauri/icons/programmusic.icns +0 -0
  7. package/src-tauri/icons/wechat.icns +0 -0
  8. package/src-tauri/icons/xiaohongshu.icns +0 -0
  9. package/src-tauri/png/chatgpt_256.ico +0 -0
  10. package/src-tauri/png/chatgpt_32.ico +0 -0
  11. package/src-tauri/png/chatgpt_512.png +0 -0
  12. package/src-tauri/png/coderunner_256.ico +0 -0
  13. package/src-tauri/png/coderunner_32.ico +0 -0
  14. package/src-tauri/png/coderunner_512.png +0 -0
  15. package/src-tauri/png/programmusic_256.ico +0 -0
  16. package/src-tauri/png/programmusic_32.ico +0 -0
  17. package/src-tauri/png/programmusic_512.png +0 -0
  18. package/src-tauri/png/tool_256.ico +0 -0
  19. package/src-tauri/png/tool_32.ico +0 -0
  20. package/src-tauri/png/tool_512.png +0 -0
  21. package/src-tauri/png/wechat_256.ico +0 -0
  22. package/src-tauri/png/wechat_32.ico +0 -0
  23. package/src-tauri/png/wechat_512.png +0 -0
  24. package/src-tauri/png/witeboard_256.ico +0 -0
  25. package/src-tauri/png/witeboard_32.ico +0 -0
  26. package/src-tauri/png/witeboard_512.png +0 -0
  27. package/src-tauri/png/xapi_256.ico +0 -0
  28. package/src-tauri/png/xapi_32.ico +0 -0
  29. package/src-tauri/png/xapi_512.png +0 -0
  30. package/src-tauri/png/xiaohongshu_256.ico +0 -0
  31. package/src-tauri/png/xiaohongshu_32.ico +0 -0
  32. package/src-tauri/png/xiaohongshu_512.png +0 -0
  33. package/src-tauri/src/main.rs +3 -3
  34. package/src-tauri/src/pake.js +14 -2
  35. package/src-tauri/tauri.conf.json +29 -28
  36. package/src-tauri/tauri.linux.conf.json +30 -34
  37. package/src-tauri/tauri.macos.conf.json +1 -3
  38. package/src-tauri/tauri.windows.conf.json +1 -4
  39. package/src-tauri/icons/code.icns +0 -0
package/README.md CHANGED
@@ -58,8 +58,8 @@
58
58
  </td>
59
59
  </tr>
60
60
  <tr>
61
- <td><img src=https://cdn.fliggy.com/upic/DX3dfG.png width=600/></td>
62
- <td><img src=https://cdn.fliggy.com/upic/l5aC7R.png width=600/></td>
61
+ <td><img src=https://cdn.fliggy.com/upic/nYEKqN.jpg width=600/></td>
62
+ <td><img src=https://cdn.fliggy.com/upic/LW9BMz.png width=600/></td>
63
63
  </tr>
64
64
  <tr>
65
65
  <td>YouTube
@@ -67,15 +67,31 @@
67
67
  <a href="https://github.com/tw93/Pake/releases/latest/download/YouTube_x64.msi">Windows</a>
68
68
  <a href="https://github.com/tw93/Pake/releases/latest/download/YouTube_x86_64.deb">Linux</a>
69
69
  </td>
70
- <td>Reference
71
- <a href="https://github.com/tw93/Pake/releases/latest/download/Reference.dmg">Mac</a>
72
- <a href="https://github.com/tw93/Pake/releases/latest/download/Reference_x64.msi">Windows</a>
73
- <a href="https://github.com/tw93/Pake/releases/latest/download/Reference_x86_64.deb">Linux</a>
70
+ <td>XiaoHongShu
71
+ <a href="https://github.com/tw93/Pake/releases/latest/download/XiaoHongShu.dmg">Mac</a>
72
+ <a href="https://github.com/tw93/Pake/releases/latest/download/XiaoHongShu_x64.msi">Windows</a>
73
+ <a href="https://github.com/tw93/Pake/releases/latest/download/XiaoHongShu_x86_64.deb">Linux</a>
74
74
  </td>
75
75
  </tr>
76
76
  <tr>
77
- <td><img src=https://cdn.fliggy.com/upic/Ea5ZRw.png width=600/></td>
78
- <td><img src=https://cdn.fliggy.com/upic/KFsZIY.png width=600/></td>
77
+ <td><img src=https://cdn.fliggy.com/upic/s4ZLNC.jpg width=600/></td>
78
+ <td><img src=https://cdn.fliggy.com/upic/0CvT6K.png width=600/></td>
79
+ </tr>
80
+ <tr>
81
+ <td>ProgramMusic
82
+ <a href="https://github.com/tw93/Pake/releases/latest/download/ProgramMusic.dmg">Mac</a>
83
+ <a href="https://github.com/tw93/Pake/releases/latest/download/ProgramMusic_x64.msi">Windows</a>
84
+ <a href="https://github.com/tw93/Pake/releases/latest/download/ProgramMusic_x86_64.deb">Linux</a>
85
+ </td>
86
+ <td>CodeRunner
87
+ <a href="https://github.com/tw93/Pake/releases/latest/download/CodeRunner.dmg">Mac</a>
88
+ <a href="https://github.com/tw93/Pake/releases/latest/download/CodeRunner_x64.msi">Windows</a>
89
+ <a href="https://github.com/tw93/Pake/releases/latest/download/CodeRunner_x86_64.deb">Linux</a>
90
+ </td>
91
+ </tr>
92
+ <tr>
93
+ <td><img src=https://cdn.fliggy.com/upic/8A3FfQ.png width=600/></td>
94
+ <td><img src=https://cdn.fliggy.com/upic/EB1OYP.jpg width=600/></td>
79
95
  </tr>
80
96
  <tr>
81
97
  <td>Flomo
@@ -96,7 +112,7 @@
96
112
  </table>
97
113
 
98
114
  <details>
99
- <summary>🏂 You can download more applications (such as YuQue / RunCode) from <a href="https://github.com/tw93/Pake/releases">Releases</a>. <b>Click here to expand the shortcuts reference!</b></summary>
115
+ <summary>🏂 You can download more applications (such as YuQue / Reference) from <a href="https://github.com/tw93/Pake/releases">Releases</a>. <b>Click here to expand the shortcuts reference!</b></summary>
100
116
 
101
117
  <br/>
102
118
 
package/dist/cli.js CHANGED
@@ -49,6 +49,7 @@ const DEFAULT_PAKE_OPTIONS = {
49
49
  transparent: false,
50
50
  debug: false,
51
51
  multiArch: false,
52
+ targets: "all",
52
53
  };
53
54
 
54
55
  const tlds = [
@@ -1657,6 +1658,14 @@ function mergeTauriConfig(url, options, tauriConf) {
1657
1658
  const exists = yield fs.stat(options.icon)
1658
1659
  .then(() => true)
1659
1660
  .catch(() => false);
1661
+ if (process.platform === "linux") {
1662
+ if (["all", "deb", "appimage"].includes(options.targets)) {
1663
+ tauriConf.tauri.bundle.targets = [options.targets];
1664
+ }
1665
+ else {
1666
+ logger.warn("targets must be 'all', 'deb', 'appimage', we will use default 'all'");
1667
+ }
1668
+ }
1660
1669
  if (exists) {
1661
1670
  let updateIconPath = true;
1662
1671
  let customIconExt = path.extname(options.icon).toLowerCase();
@@ -1708,9 +1717,9 @@ function mergeTauriConfig(url, options, tauriConf) {
1708
1717
  }
1709
1718
  }
1710
1719
  let bundleConf = { tauri: { bundle: tauriConf.tauri.bundle } };
1711
- yield fs.writeFile(configPath, Buffer.from(JSON.stringify(bundleConf), 'utf-8'));
1720
+ yield fs.writeFile(configPath, Buffer.from(JSON.stringify(bundleConf, null, '\t'), 'utf-8'));
1712
1721
  const configJsonPath = path.join(npmDirectory, 'src-tauri/tauri.conf.json');
1713
- yield fs.writeFile(configJsonPath, Buffer.from(JSON.stringify(tauriConf), 'utf-8'));
1722
+ yield fs.writeFile(configJsonPath, Buffer.from(JSON.stringify(tauriConf, null, '\t'), 'utf-8'));
1714
1723
  });
1715
1724
  }
1716
1725
 
@@ -1932,7 +1941,6 @@ var MacConf = {
1932
1941
  var tauri = {
1933
1942
  bundle: {
1934
1943
  icon: [
1935
- "png/weread_256.ico",
1936
1944
  "png/weread_512.png"
1937
1945
  ],
1938
1946
  identifier: "com.tw93.weread",
@@ -2019,11 +2027,11 @@ class MacBuilder {
2019
2027
  yield mergeTauriConfig(url, options, tauriConf);
2020
2028
  let dmgName;
2021
2029
  if (options.multiArch) {
2022
- yield shellExec(`cd "${npmDirectory}" && npm install && npm run build:mac`);
2030
+ yield shellExec(`cd "${npmDirectory}" && npm install --verbose && npm run build:mac`);
2023
2031
  dmgName = `${name}_${tauriConf.package.version}_universal.dmg`;
2024
2032
  }
2025
2033
  else {
2026
- yield shellExec(`cd "${npmDirectory}" && npm install && npm run build`);
2034
+ yield shellExec(`cd "${npmDirectory}" && npm install --verbose && npm run build`);
2027
2035
  let arch = "x64";
2028
2036
  if (process.arch === "arm64") {
2029
2037
  arch = "aarch64";
@@ -2081,7 +2089,7 @@ class WinBuilder {
2081
2089
  logger.debug('PakeAppOptions', options);
2082
2090
  const { name } = options;
2083
2091
  yield mergeTauriConfig(url, options, tauriConf);
2084
- yield shellExec(`cd "${npmDirectory}" && npm install && npm run build`);
2092
+ yield shellExec(`cd "${npmDirectory}" && npm install --verbose && npm run build`);
2085
2093
  const language = tauriConf.tauri.bundle.windows.wix.language[0];
2086
2094
  const arch = process.arch;
2087
2095
  const msiName = `${name}_${tauriConf.package.version}_${arch}_${language}.msi`;
@@ -2126,7 +2134,7 @@ class LinuxBuilder {
2126
2134
  logger.debug('PakeAppOptions', options);
2127
2135
  const { name } = options;
2128
2136
  yield mergeTauriConfig(url, options, tauriConf);
2129
- yield shellExec(`cd "${npmDirectory}" && npm install && npm run build`);
2137
+ yield shellExec(`cd "${npmDirectory}" && npm install --verbose && npm run build`);
2130
2138
  let arch;
2131
2139
  if (process.arch === "x64") {
2132
2140
  arch = "amd64";
@@ -2134,19 +2142,24 @@ class LinuxBuilder {
2134
2142
  else {
2135
2143
  arch = process.arch;
2136
2144
  }
2137
- const debName = `${name}_${tauriConf.package.version}_${arch}.deb`;
2138
- const appPath = this.getBuildAppPath(npmDirectory, "deb", debName);
2139
- const distPath = path.resolve(`${name}.deb`);
2140
- yield fs.copyFile(appPath, distPath);
2141
- yield fs.unlink(appPath);
2142
- const appImageName = `${name}_${tauriConf.package.version}_${arch}.AppImage`;
2143
- const appImagePath = this.getBuildAppPath(npmDirectory, "appimage", appImageName);
2144
- const distAppPath = path.resolve(`${name}.AppImage`);
2145
- yield fs.copyFile(appImagePath, distAppPath);
2146
- yield fs.unlink(appImagePath);
2147
- logger.success('Build success!');
2148
- logger.success('You can find the deb app installer in', distPath);
2149
- logger.success('You can find the AppImage app installer in', distAppPath);
2145
+ if (options.targets === "deb" || options.targets === "all") {
2146
+ const debName = `${name}_${tauriConf.package.version}_${arch}.deb`;
2147
+ const appPath = this.getBuildAppPath(npmDirectory, "deb", debName);
2148
+ const distPath = path.resolve(`${name}.deb`);
2149
+ yield fs.copyFile(appPath, distPath);
2150
+ yield fs.unlink(appPath);
2151
+ logger.success('Build Deb success!');
2152
+ logger.success('You can find the deb app installer in', distPath);
2153
+ }
2154
+ if (options.targets === "appimage" || options.targets === "all") {
2155
+ const appImageName = `${name}_${tauriConf.package.version}_${arch}.AppImage`;
2156
+ const appImagePath = this.getBuildAppPath(npmDirectory, "appimage", appImageName);
2157
+ const distAppPath = path.resolve(`${name}.AppImage`);
2158
+ yield fs.copyFile(appImagePath, distAppPath);
2159
+ yield fs.unlink(appImagePath);
2160
+ logger.success('Build AppImage success!');
2161
+ logger.success('You can find the AppImage app installer in', distAppPath);
2162
+ }
2150
2163
  });
2151
2164
  }
2152
2165
  getBuildAppPath(npmDirectory, packageType, packageName) {
@@ -2170,7 +2183,7 @@ class BuilderFactory {
2170
2183
  }
2171
2184
 
2172
2185
  var name = "pake-cli";
2173
- var version = "1.2.7";
2186
+ var version = "1.2.9";
2174
2187
  var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。";
2175
2188
  var engines = {
2176
2189
  node: ">=16.0.0"
@@ -2206,7 +2219,7 @@ var scripts = {
2206
2219
  build: "npm run tauri build --release",
2207
2220
  "build:mac": "npm run tauri build -- --target universal-apple-darwin",
2208
2221
  "build:all-unix": "chmod +x ./script/build.sh && ./script/build.sh",
2209
- "build:all-windows": ".\\script\\build.bat",
2222
+ "build:all-windows": "pwsh ./script/build.ps1",
2210
2223
  tauri: "tauri",
2211
2224
  cli: "rollup -c rollup.config.js --watch",
2212
2225
  "cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
@@ -2286,6 +2299,7 @@ program
2286
2299
  .option('-r, --no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable)
2287
2300
  .option('-d, --debug', 'debug', DEFAULT_PAKE_OPTIONS.debug)
2288
2301
  .option('-m, --multi-arch', "available for Mac only, and supports both Intel and M1", DEFAULT_PAKE_OPTIONS.multiArch)
2302
+ .option('--targets <string>', "Select the output package format, support deb/appimage/all, only for Linux", DEFAULT_PAKE_OPTIONS.targets)
2289
2303
  .action((url, options) => __awaiter(void 0, void 0, void 0, function* () {
2290
2304
  yield checkUpdateTips();
2291
2305
  if (!url) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pake-cli",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。",
5
5
  "engines": {
6
6
  "node": ">=16.0.0"
@@ -36,7 +36,7 @@
36
36
  "build": "npm run tauri build --release",
37
37
  "build:mac": "npm run tauri build -- --target universal-apple-darwin",
38
38
  "build:all-unix": "chmod +x ./script/build.sh && ./script/build.sh",
39
- "build:all-windows": ".\\script\\build.bat",
39
+ "build:all-windows": "pwsh ./script/build.ps1",
40
40
  "tauri": "tauri",
41
41
  "cli": "rollup -c rollup.config.js --watch",
42
42
  "cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
@@ -7,4 +7,4 @@ Name=com-tw93-weread
7
7
  Name[zh_CN]=微信阅读
8
8
  StartupNotify=true
9
9
  Terminal=false
10
- Type=Application
10
+ Type=Application
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -26,7 +26,7 @@ use wry::application::window::Icon;
26
26
  #[cfg(any(target_os = "linux", target_os = "windows"))]
27
27
  use wry::webview::WebContext;
28
28
 
29
- use dirs::download_dir;
29
+ use dirs::desktop_dir;
30
30
  use std::path::PathBuf;
31
31
 
32
32
  enum UserEvent {
@@ -147,7 +147,7 @@ fn main() -> wry::Result<()> {
147
147
  let download_started = {
148
148
  let proxy = proxy.clone();
149
149
  move |uri: String, default_path: &mut PathBuf| {
150
- let path = download_dir()
150
+ let path = desktop_dir()
151
151
  .unwrap()
152
152
  .join(default_path.display().to_string())
153
153
  .as_path()
@@ -243,7 +243,7 @@ fn main() -> wry::Result<()> {
243
243
  Event::UserEvent(UserEvent::DownloadComplete(_, success)) => {
244
244
  println!("Succeeded: {success}");
245
245
  if success {
246
- let _ = webview.evaluate_script("window.pakeToast('Save in downloads folder')");
246
+ let _ = webview.evaluate_script("window.pakeToast('Downloaded to Desktop~')");
247
247
  } else {
248
248
  println!("No output path")
249
249
  }
@@ -47,10 +47,21 @@ window.addEventListener("DOMContentLoaded", (_event) => {
47
47
  #Wrapper > div.sep20,
48
48
  #Main > div.box:nth-child(8),
49
49
  #masthead-ad,
50
+ #app > header > div > div.menu,
51
+ #root > div > div.fixed.top-0.left-0.w-64.h-screen.p-10.pb-0.flex.flex-col.justify-between > div > div.space-y-4 > a:nth-child(3),
50
52
  #Rightbar > div:nth-child(6) > div.sidebar_compliance {
51
53
  display: none !important;
52
54
  }
53
55
 
56
+ #app > header .right .avatar.logged-in{
57
+ opacity: 0;
58
+ transition: opacity 0.3s;
59
+ }
60
+
61
+ #app > header .right .avatar.logged-in:hover{
62
+ opacity: 1;
63
+ }
64
+
54
65
  #page .main_header, .cb-layout-basic--navbar,
55
66
  #app .splitpanes.splitpanes--horizontal.no-splitter header {
56
67
  padding-top: 20px;
@@ -86,10 +97,11 @@ window.addEventListener("DOMContentLoaded", (_event) => {
86
97
  }
87
98
 
88
99
  .panel.give_me .nav_view {
89
- top: 154px !important;
100
+ top: 164px !important;
90
101
  }
91
102
 
92
- .columns .column #header{
103
+ .columns .column #header,
104
+ .main > div > div.panel.give_me > div.header {
93
105
  padding-top: 30px;
94
106
  }
95
107
 
@@ -1,30 +1,31 @@
1
1
  {
2
- "package": {
3
- "productName": "WeRead",
4
- "version": "1.0.0"
5
- },
6
- "tauri": {
7
- "windows": [
8
- {
9
- "url": "https://weread.qq.com/",
10
- "transparent": true,
11
- "fullscreen": false,
12
- "width": 1200,
13
- "height": 780,
14
- "resizable": true
15
- }
16
- ],
17
- "security": {
18
- "csp": null
19
- },
20
- "updater": {
21
- "active": false
22
- }
23
- },
24
- "build": {
25
- "devPath": "../dist",
26
- "distDir": "../dist",
27
- "beforeBuildCommand": "",
28
- "beforeDevCommand": ""
2
+ "package": {
3
+ "productName": "WeRead",
4
+ "version": "1.0.0"
5
+ },
6
+ "tauri": {
7
+ "windows": [
8
+ {
9
+ "url": "https://weread.qq.com/",
10
+ "transparent": true,
11
+ "fullscreen": false,
12
+ "width": 1200,
13
+ "height": 780,
14
+ "resizable": true
15
+ }
16
+ ],
17
+ "security": {
18
+ "csp": null
19
+ },
20
+ "updater": {
21
+ "active": false
22
+ }
23
+ },
24
+ "build": {
25
+ "devPath": "../dist",
26
+ "distDir": "../dist",
27
+ "beforeBuildCommand": "",
28
+ "beforeDevCommand": ""
29
+ }
29
30
  }
30
- }
31
+
@@ -1,36 +1,32 @@
1
1
  {
2
- "tauri": {
3
- "bundle": {
4
- "icon": [
5
- "png/weread_256.ico",
6
- "png/weread_512.png"
7
- ],
8
- "identifier": "com.tw93.weread",
9
- "active": true,
10
- "category": "DeveloperTool",
11
- "copyright": "",
12
- "deb": {
13
- "depends": [
14
- "libwebkit2gtk-4.0-dev",
15
- "build-essential",
16
- "curl",
17
- "wget",
18
- "libssl-dev",
19
- "libgtk-3-dev",
20
- "libayatana-appindicator3-dev",
21
- "librsvg2-dev",
22
- "gnome-video-effects",
23
- "gnome-video-effects-extra"
24
- ],
25
- "files": {
26
- "/usr/share/applications/com-tw93-weread.desktop": "assets/com-tw93-weread.desktop"
27
- }
28
- },
29
- "externalBin": [],
30
- "longDescription": "",
31
- "resources": [],
32
- "shortDescription": "",
33
- "targets": ["deb", "appimage"]
34
- }
2
+ "tauri": {
3
+ "bundle": {
4
+ "icon": ["png/weread_512.png"],
5
+ "identifier": "com.tw93.weread",
6
+ "active": true,
7
+ "category": "DeveloperTool",
8
+ "copyright": "",
9
+ "deb": {
10
+ "depends": [
11
+ "libwebkit2gtk-4.0-dev",
12
+ "build-essential",
13
+ "curl",
14
+ "wget",
15
+ "libssl-dev",
16
+ "libgtk-3-dev",
17
+ "libayatana-appindicator3-dev",
18
+ "librsvg2-dev",
19
+ "gnome-video-effects",
20
+ "gnome-video-effects-extra"
21
+ ],
22
+ "files": {"/usr/share/applications/com-tw93-weread.desktop": "assets/com-tw93-weread.desktop"}
23
+ },
24
+ "externalBin": [],
25
+ "longDescription": "",
26
+ "resources": [],
27
+ "shortDescription": "",
28
+ "targets": ["deb", "appimage"]
29
+ }
30
+ }
35
31
  }
36
- }
32
+
@@ -1,9 +1,7 @@
1
1
  {
2
2
  "tauri": {
3
3
  "bundle": {
4
- "icon": [
5
- "icons/weread.icns"
6
- ],
4
+ "icon": ["icons/weread.icns"],
7
5
  "identifier": "com.tw93.weread",
8
6
  "active": true,
9
7
  "category": "DeveloperTool",
@@ -1,10 +1,7 @@
1
1
  {
2
2
  "tauri": {
3
3
  "bundle": {
4
- "icon": [
5
- "png/weread_256.ico",
6
- "png/weread_32.ico"
7
- ],
4
+ "icon": ["png/weread_256.ico", "png/weread_32.ico"],
8
5
  "identifier": "com.tw93.weread",
9
6
  "active": true,
10
7
  "category": "DeveloperTool",
Binary file