pake-cli 1.2.7-beta → 1.2.8

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 +30 -18
  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/iKGVZy.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 = [
@@ -1677,6 +1678,12 @@ function mergeTauriConfig(url, options, tauriConf) {
1677
1678
  updateIconPath = false;
1678
1679
  logger.warn(`icon file in Linux must be 512 * 512 pix with .png type, but you give ${customIconExt}`);
1679
1680
  }
1681
+ if (["all", "deb", "appimage"].includes(options.targets)) {
1682
+ tauriConf.tauri.bundle.targets = [options.targets];
1683
+ }
1684
+ else {
1685
+ logger.warn("targets must be 'all', 'deb', 'appimage', we will use default 'all'");
1686
+ }
1680
1687
  }
1681
1688
  if (process.platform === "darwin" && customIconExt !== ".icns") {
1682
1689
  updateIconPath = false;
@@ -1708,9 +1715,9 @@ function mergeTauriConfig(url, options, tauriConf) {
1708
1715
  }
1709
1716
  }
1710
1717
  let bundleConf = { tauri: { bundle: tauriConf.tauri.bundle } };
1711
- yield fs.writeFile(configPath, Buffer.from(JSON.stringify(bundleConf), 'utf-8'));
1718
+ yield fs.writeFile(configPath, Buffer.from(JSON.stringify(bundleConf, null, '\t'), 'utf-8'));
1712
1719
  const configJsonPath = path.join(npmDirectory, 'src-tauri/tauri.conf.json');
1713
- yield fs.writeFile(configJsonPath, Buffer.from(JSON.stringify(tauriConf), 'utf-8'));
1720
+ yield fs.writeFile(configJsonPath, Buffer.from(JSON.stringify(tauriConf, null, '\t'), 'utf-8'));
1714
1721
  });
1715
1722
  }
1716
1723
 
@@ -1932,7 +1939,6 @@ var MacConf = {
1932
1939
  var tauri = {
1933
1940
  bundle: {
1934
1941
  icon: [
1935
- "png/weread_256.ico",
1936
1942
  "png/weread_512.png"
1937
1943
  ],
1938
1944
  identifier: "com.tw93.weread",
@@ -2134,19 +2140,24 @@ class LinuxBuilder {
2134
2140
  else {
2135
2141
  arch = process.arch;
2136
2142
  }
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);
2143
+ if (options.targets === "deb" || options.targets === "all") {
2144
+ const debName = `${name}_${tauriConf.package.version}_${arch}.deb`;
2145
+ const appPath = this.getBuildAppPath(npmDirectory, "deb", debName);
2146
+ const distPath = path.resolve(`${name}.deb`);
2147
+ yield fs.copyFile(appPath, distPath);
2148
+ yield fs.unlink(appPath);
2149
+ logger.success('Build Deb success!');
2150
+ logger.success('You can find the deb app installer in', distPath);
2151
+ }
2152
+ if (options.targets === "appimage" || options.targets === "all") {
2153
+ const appImageName = `${name}_${tauriConf.package.version}_${arch}.AppImage`;
2154
+ const appImagePath = this.getBuildAppPath(npmDirectory, "appimage", appImageName);
2155
+ const distAppPath = path.resolve(`${name}.AppImage`);
2156
+ yield fs.copyFile(appImagePath, distAppPath);
2157
+ yield fs.unlink(appImagePath);
2158
+ logger.success('Build AppImage success!');
2159
+ logger.success('You can find the AppImage app installer in', distAppPath);
2160
+ }
2150
2161
  });
2151
2162
  }
2152
2163
  getBuildAppPath(npmDirectory, packageType, packageName) {
@@ -2170,7 +2181,7 @@ class BuilderFactory {
2170
2181
  }
2171
2182
 
2172
2183
  var name = "pake-cli";
2173
- var version = "1.2.7-beta";
2184
+ var version = "1.2.8";
2174
2185
  var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。";
2175
2186
  var engines = {
2176
2187
  node: ">=16.0.0"
@@ -2206,7 +2217,7 @@ var scripts = {
2206
2217
  build: "npm run tauri build --release",
2207
2218
  "build:mac": "npm run tauri build -- --target universal-apple-darwin",
2208
2219
  "build:all-unix": "chmod +x ./script/build.sh && ./script/build.sh",
2209
- "build:all-windows": ".\\script\\build.bat",
2220
+ "build:all-windows": "pwsh ./script/build.ps1",
2210
2221
  tauri: "tauri",
2211
2222
  cli: "rollup -c rollup.config.js --watch",
2212
2223
  "cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
@@ -2286,6 +2297,7 @@ program
2286
2297
  .option('-r, --no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable)
2287
2298
  .option('-d, --debug', 'debug', DEFAULT_PAKE_OPTIONS.debug)
2288
2299
  .option('-m, --multi-arch', "available for Mac only, and supports both Intel and M1", DEFAULT_PAKE_OPTIONS.multiArch)
2300
+ .option('--targets <string>', "Select the output package format, support deb/appimage/all, only for Linux", DEFAULT_PAKE_OPTIONS.targets)
2289
2301
  .action((url, options) => __awaiter(void 0, void 0, void 0, function* () {
2290
2302
  yield checkUpdateTips();
2291
2303
  if (!url) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pake-cli",
3
- "version": "1.2.7-beta",
3
+ "version": "1.2.8",
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