pake-cli 1.0.1 → 1.2.1
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/README.md +16 -9
- package/dist/cli.js +36 -56
- package/package.json +2 -2
- package/src-tauri/icons/tableconvert.icns +0 -0
- package/src-tauri/icons/zlibrary.icns +0 -0
- package/src-tauri/png/tableconvert_256.ico +0 -0
- package/src-tauri/png/tableconvert_32.ico +0 -0
- package/src-tauri/png/tableconvert_512.png +0 -0
- package/src-tauri/png/zlibrary_256.ico +0 -0
- package/src-tauri/png/zlibrary_32.ico +0 -0
- package/src-tauri/png/zlibrary_512.png +0 -0
- package/src-tauri/src/pake.js +5 -1
package/README.md
CHANGED
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
<td><img src=https://cdn.fliggy.com/upic/Ea5ZRw.png width=600/></td>
|
|
61
61
|
</tr>
|
|
62
62
|
<tr>
|
|
63
|
-
<td>
|
|
64
|
-
<a href="https://github.com/tw93/Pake/releases/latest/download/
|
|
65
|
-
<a href="https://github.com/tw93/Pake/releases/latest/download/
|
|
66
|
-
<a href="https://github.com/tw93/Pake/releases/latest/download/
|
|
63
|
+
<td>ZLibrary
|
|
64
|
+
<a href="https://github.com/tw93/Pake/releases/latest/download/ZLibrary.dmg">Mac</a>
|
|
65
|
+
<a href="https://github.com/tw93/Pake/releases/latest/download/ZLibrary_x64.msi">Windows</a>
|
|
66
|
+
<a href="https://github.com/tw93/Pake/releases/latest/download/ZLibrary_amd64.deb">Linux</a>
|
|
67
67
|
</td>
|
|
68
68
|
<td>Reference
|
|
69
69
|
<a href="https://github.com/tw93/Pake/releases/latest/download/Reference.dmg">Mac</a>
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
</td>
|
|
73
73
|
</tr>
|
|
74
74
|
<tr>
|
|
75
|
-
<td><img src=https://cdn.fliggy.com/upic/
|
|
75
|
+
<td><img src=https://cdn.fliggy.com/upic/XGilgr.png width=600/></td>
|
|
76
76
|
<td><img src=https://cdn.fliggy.com/upic/KFsZIY.png width=600/></td>
|
|
77
77
|
</tr>
|
|
78
78
|
<tr>
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
|
|
96
96
|
<details>
|
|
97
97
|
|
|
98
|
-
<summary>🏂 更多应用如 Flomo /
|
|
98
|
+
<summary>🏂 更多应用如 Flomo / 语雀 / RunCode 可去 <a href="https://github.com/tw93/Pake/releases">Release</a>下载,<b>此外点击可展开快捷键说明</b></summary>
|
|
99
99
|
|
|
100
100
|
<br/>
|
|
101
101
|
|
|
@@ -262,21 +262,28 @@ Pake 的发展离不开这些 Hacker 们,一起贡献了大量能力,也欢
|
|
|
262
262
|
<sub><b>Dengju Deng</b></sub>
|
|
263
263
|
</a>
|
|
264
264
|
</td>
|
|
265
|
+
<td align="center">
|
|
266
|
+
<a href="https://github.com/Fechin">
|
|
267
|
+
<img src="https://avatars.githubusercontent.com/u/2541482?v=4" width="90;" alt="Fechin"/>
|
|
268
|
+
<br />
|
|
269
|
+
<sub><b>Fechin</b></sub>
|
|
270
|
+
</a>
|
|
271
|
+
</td>
|
|
265
272
|
<td align="center">
|
|
266
273
|
<a href="https://github.com/princemaple">
|
|
267
274
|
<img src="https://avatars.githubusercontent.com/u/1329716?v=4" width="90;" alt="princemaple"/>
|
|
268
275
|
<br />
|
|
269
276
|
<sub><b>Po Chen</b></sub>
|
|
270
277
|
</a>
|
|
271
|
-
</td>
|
|
278
|
+
</td></tr>
|
|
279
|
+
<tr>
|
|
272
280
|
<td align="center">
|
|
273
281
|
<a href="https://github.com/houhoz">
|
|
274
282
|
<img src="https://avatars.githubusercontent.com/u/19684376?v=4" width="90;" alt="houhoz"/>
|
|
275
283
|
<br />
|
|
276
284
|
<sub><b>Hyzhao</b></sub>
|
|
277
285
|
</a>
|
|
278
|
-
</td
|
|
279
|
-
<tr>
|
|
286
|
+
</td>
|
|
280
287
|
<td align="center">
|
|
281
288
|
<a href="https://github.com/liusishan">
|
|
282
289
|
<img src="https://avatars.githubusercontent.com/u/33129823?v=4" width="90;" alt="liusishan"/>
|
package/dist/cli.js
CHANGED
|
@@ -1632,6 +1632,24 @@ function mergeTauriConfig(url, options, tauriConf) {
|
|
|
1632
1632
|
transparent,
|
|
1633
1633
|
resizable,
|
|
1634
1634
|
};
|
|
1635
|
+
// Package name is valid ?
|
|
1636
|
+
// for Linux, package name must be a-z, 0-9 or "-", not allow to A-Z and other
|
|
1637
|
+
if (process.platform === "linux") {
|
|
1638
|
+
const reg = new RegExp(/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/);
|
|
1639
|
+
if (!reg.test(name) || reg.exec(name)[0].length != name.length) {
|
|
1640
|
+
logger.error("package name is illegal, it must be lowercase letters, numbers, dashes, and it must contain the lowercase letters.");
|
|
1641
|
+
logger.error("E.g com-123-xxx, 123pan, pan123,weread, we-read");
|
|
1642
|
+
process.exit();
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
if (process.platform === "win32" || process.platform === "darwin") {
|
|
1646
|
+
const reg = new RegExp(/([0-9]*[a-zA-Z]+[0-9]*)+/);
|
|
1647
|
+
if (!reg.test(name) || reg.exec(name)[0].length != name.length) {
|
|
1648
|
+
logger.error("package name is illegal, it must be letters, numbers, and it must contain the letters");
|
|
1649
|
+
logger.error("E.g 123pan,123Pan,Pan123,weread,WeRead,WERead");
|
|
1650
|
+
process.exit();
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1635
1653
|
Object.assign(tauriConf.tauri.windows[0], Object.assign({ url }, tauriConfWindowOptions));
|
|
1636
1654
|
tauriConf.package.productName = name;
|
|
1637
1655
|
tauriConf.tauri.bundle.identifier = identifier;
|
|
@@ -1734,38 +1752,6 @@ function getDefaultIcon() {
|
|
|
1734
1752
|
return path.join(npmDirectory, iconPath);
|
|
1735
1753
|
});
|
|
1736
1754
|
}
|
|
1737
|
-
// export async function getIconFromPageUrl(url: string) {
|
|
1738
|
-
// const icon = await pageIcon(url);
|
|
1739
|
-
// console.log(icon);
|
|
1740
|
-
// if (icon.ext === '.ico') {
|
|
1741
|
-
// const a = await ICO.parse(icon.data);
|
|
1742
|
-
// icon.data = Buffer.from(a[0].buffer);
|
|
1743
|
-
// }
|
|
1744
|
-
// const iconDir = (await dir()).path;
|
|
1745
|
-
// const iconPath = path.join(iconDir, `/icon.icns`);
|
|
1746
|
-
// const out = png2icons.createICNS(icon.data, png2icons.BILINEAR, 0);
|
|
1747
|
-
// await fs.writeFile(iconPath, out);
|
|
1748
|
-
// return iconPath;
|
|
1749
|
-
// }
|
|
1750
|
-
// export async function getIconFromMacosIcons(name: string) {
|
|
1751
|
-
// const data = {
|
|
1752
|
-
// query: name,
|
|
1753
|
-
// filters: 'approved:true',
|
|
1754
|
-
// hitsPerPage: 10,
|
|
1755
|
-
// page: 1,
|
|
1756
|
-
// };
|
|
1757
|
-
// const res = await axios.post('https://p1txh7zfb3-2.algolianet.com/1/indexes/macOSicons/query?x-algolia-agent=Algolia%20for%20JavaScript%20(4.13.1)%3B%20Browser', data, {
|
|
1758
|
-
// headers: {
|
|
1759
|
-
// 'x-algolia-api-key': '0ba04276e457028f3e11e38696eab32c',
|
|
1760
|
-
// 'x-algolia-application-id': 'P1TXH7ZFB3',
|
|
1761
|
-
// },
|
|
1762
|
-
// });
|
|
1763
|
-
// if (!res.data.hits.length) {
|
|
1764
|
-
// return '';
|
|
1765
|
-
// } else {
|
|
1766
|
-
// return downloadIcon(res.data.hits[0].icnsUrl);
|
|
1767
|
-
// }
|
|
1768
|
-
// }
|
|
1769
1755
|
function downloadIcon(iconUrl) {
|
|
1770
1756
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1771
1757
|
let iconResponse;
|
|
@@ -2020,7 +2006,7 @@ class MacBuilder {
|
|
|
2020
2006
|
yield installRust();
|
|
2021
2007
|
}
|
|
2022
2008
|
else {
|
|
2023
|
-
log.error('Error: Pake need Rust to package your webapp
|
|
2009
|
+
log.error('Error: Pake need Rust to package your webapp!');
|
|
2024
2010
|
process.exit(2);
|
|
2025
2011
|
}
|
|
2026
2012
|
});
|
|
@@ -2030,16 +2016,10 @@ class MacBuilder {
|
|
|
2030
2016
|
log.debug('PakeAppOptions', options);
|
|
2031
2017
|
const { name } = options;
|
|
2032
2018
|
yield mergeTauriConfig(url, options, tauriConf);
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
}
|
|
2038
|
-
else {
|
|
2039
|
-
arch = process.arch;
|
|
2040
|
-
}
|
|
2041
|
-
const dmgName = `${name}_${tauriConf.package.version}_${arch}.dmg`;
|
|
2042
|
-
const appPath = this.getBuildedAppPath(npmDirectory, dmgName);
|
|
2019
|
+
//这里直接使用 universal-apple-darwin 的打包,而非当前系统的包
|
|
2020
|
+
yield shellExec(`cd ${npmDirectory} && npm install && npm run build:mac`);
|
|
2021
|
+
const dmgName = `${name}_${tauriConf.package.version}_universal.dmg`;
|
|
2022
|
+
const appPath = this.getBuildAppPath(npmDirectory, dmgName);
|
|
2043
2023
|
const distPath = path.resolve(`${name}.dmg`);
|
|
2044
2024
|
yield fs.copyFile(appPath, distPath);
|
|
2045
2025
|
yield fs.unlink(appPath);
|
|
@@ -2047,8 +2027,8 @@ class MacBuilder {
|
|
|
2047
2027
|
logger.success('You can find the app installer in', distPath);
|
|
2048
2028
|
});
|
|
2049
2029
|
}
|
|
2050
|
-
|
|
2051
|
-
return path.join(npmDirectory, 'src-tauri/target/release/bundle/dmg', dmgName);
|
|
2030
|
+
getBuildAppPath(npmDirectory, dmgName) {
|
|
2031
|
+
return path.join(npmDirectory, 'src-tauri/target/universal-apple-darwin/release/bundle/dmg', dmgName);
|
|
2052
2032
|
}
|
|
2053
2033
|
}
|
|
2054
2034
|
|
|
@@ -2084,7 +2064,7 @@ class WinBuilder {
|
|
|
2084
2064
|
const language = tauriConf.tauri.bundle.windows.wix.language[0];
|
|
2085
2065
|
const arch = process.arch;
|
|
2086
2066
|
const msiName = `${name}_${tauriConf.package.version}_${arch}_${language}.msi`;
|
|
2087
|
-
const appPath = this.
|
|
2067
|
+
const appPath = this.getBuildAppPath(npmDirectory, msiName);
|
|
2088
2068
|
const distPath = path.resolve(`${name}.msi`);
|
|
2089
2069
|
yield fs.copyFile(appPath, distPath);
|
|
2090
2070
|
yield fs.unlink(appPath);
|
|
@@ -2092,7 +2072,7 @@ class WinBuilder {
|
|
|
2092
2072
|
logger.success('You can find the app installer in', distPath);
|
|
2093
2073
|
});
|
|
2094
2074
|
}
|
|
2095
|
-
|
|
2075
|
+
getBuildAppPath(npmDirectory, dmgName) {
|
|
2096
2076
|
return path.join(npmDirectory, 'src-tauri/target/release/bundle/msi', dmgName);
|
|
2097
2077
|
}
|
|
2098
2078
|
}
|
|
@@ -2126,7 +2106,7 @@ class LinuxBuilder {
|
|
|
2126
2106
|
const { name } = options;
|
|
2127
2107
|
yield mergeTauriConfig(url, options, tauriConf);
|
|
2128
2108
|
yield shellExec(`cd ${npmDirectory} && npm install && npm run build`);
|
|
2129
|
-
let arch
|
|
2109
|
+
let arch;
|
|
2130
2110
|
if (process.arch === "x64") {
|
|
2131
2111
|
arch = "amd64";
|
|
2132
2112
|
}
|
|
@@ -2134,21 +2114,21 @@ class LinuxBuilder {
|
|
|
2134
2114
|
arch = process.arch;
|
|
2135
2115
|
}
|
|
2136
2116
|
const debName = `${name}_${tauriConf.package.version}_${arch}.deb`;
|
|
2137
|
-
const appPath = this.
|
|
2117
|
+
const appPath = this.getBuildAppPath(npmDirectory, "deb", debName);
|
|
2138
2118
|
const distPath = path.resolve(`${name}.deb`);
|
|
2139
2119
|
yield fs.copyFile(appPath, distPath);
|
|
2140
2120
|
yield fs.unlink(appPath);
|
|
2141
2121
|
const appImageName = `${name}_${tauriConf.package.version}_${arch}.AppImage`;
|
|
2142
|
-
const appImagePath = this.
|
|
2122
|
+
const appImagePath = this.getBuildAppPath(npmDirectory, "appimage", appImageName);
|
|
2143
2123
|
const distAppPath = path.resolve(`${name}.AppImage`);
|
|
2144
2124
|
yield fs.copyFile(appImagePath, distAppPath);
|
|
2145
2125
|
yield fs.unlink(appImagePath);
|
|
2146
2126
|
logger.success('Build success!');
|
|
2147
2127
|
logger.success('You can find the deb app installer in', distPath);
|
|
2148
|
-
logger.success('You can find the
|
|
2128
|
+
logger.success('You can find the AppImage app installer in', distAppPath);
|
|
2149
2129
|
});
|
|
2150
2130
|
}
|
|
2151
|
-
|
|
2131
|
+
getBuildAppPath(npmDirectory, packageType, packageName) {
|
|
2152
2132
|
return path.join(npmDirectory, 'src-tauri/target/release/bundle/', packageType, packageName);
|
|
2153
2133
|
}
|
|
2154
2134
|
}
|
|
@@ -2169,7 +2149,7 @@ class BuilderFactory {
|
|
|
2169
2149
|
}
|
|
2170
2150
|
|
|
2171
2151
|
var name = "pake-cli";
|
|
2172
|
-
var version = "1.
|
|
2152
|
+
var version = "1.2.1";
|
|
2173
2153
|
var description = "🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App 🤱🏻 A simple way to make any web page a desktop application using Rust.";
|
|
2174
2154
|
var engines = {
|
|
2175
2155
|
node: "^14.13 || >=16.0.0"
|
|
@@ -2209,7 +2189,7 @@ var scripts = {
|
|
|
2209
2189
|
tauri: "tauri",
|
|
2210
2190
|
cli: "rollup -c rollup.config.js --watch",
|
|
2211
2191
|
"cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
|
|
2212
|
-
|
|
2192
|
+
prepublishOnly: "npm run cli:build"
|
|
2213
2193
|
};
|
|
2214
2194
|
var type = "module";
|
|
2215
2195
|
var exports = "./dist/pake.js";
|
|
@@ -2285,7 +2265,7 @@ program
|
|
|
2285
2265
|
.option('--transparent', 'transparent title bar', DEFAULT_PAKE_OPTIONS.transparent)
|
|
2286
2266
|
.option('--debug', 'debug', DEFAULT_PAKE_OPTIONS.transparent)
|
|
2287
2267
|
.action((url, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2288
|
-
checkUpdateTips();
|
|
2268
|
+
yield checkUpdateTips();
|
|
2289
2269
|
if (!url) {
|
|
2290
2270
|
// 直接 pake 不需要出现url提示
|
|
2291
2271
|
program.help();
|
|
@@ -2297,6 +2277,6 @@ program
|
|
|
2297
2277
|
const builder = BuilderFactory.create();
|
|
2298
2278
|
yield builder.prepare();
|
|
2299
2279
|
const appOptions = yield handleOptions(options, url);
|
|
2300
|
-
builder.build(url, appOptions);
|
|
2280
|
+
yield builder.build(url, appOptions);
|
|
2301
2281
|
}));
|
|
2302
2282
|
program.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pake-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App 🤱🏻 A simple way to make any web page a desktop application using Rust.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "^14.13 || >=16.0.0"
|
|
@@ -40,7 +40,7 @@
|
|
|
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",
|
|
43
|
-
"
|
|
43
|
+
"prepublishOnly": "npm run cli:build"
|
|
44
44
|
},
|
|
45
45
|
"type": "module",
|
|
46
46
|
"exports": "./dist/pake.js",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src-tauri/src/pake.js
CHANGED
|
@@ -51,10 +51,14 @@ window.addEventListener("DOMContentLoaded", (_event) => {
|
|
|
51
51
|
display: none !important;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
#page .main_header, .cb-layout-basic--navbar{
|
|
54
|
+
#page .main_header, .cb-layout-basic--navbar {
|
|
55
55
|
padding-top: 20px;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
.chakra-ui-light #app .chakra-heading, .chakra-ui-dark #app .chakra-heading, .chakra-ui-light #app .chakra-stack, .chakra-ui-dark #app .chakra-stack {
|
|
59
|
+
padding-top: 10px;
|
|
60
|
+
}
|
|
61
|
+
|
|
58
62
|
#__next .overflow-hidden .flex.flex-1.flex-col {
|
|
59
63
|
padding-left: 0;
|
|
60
64
|
}
|