Skip to content

Commit 864db37

Browse files
committed
🎨 Package compatible with beta
1 parent 29b7504 commit 864db37

4 files changed

Lines changed: 26 additions & 14 deletions

File tree

bin/cli.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ program
130130
)
131131
.addOption(new Option('--title <string>', 'Window title').hideHelp())
132132
.addOption(
133-
new Option('--incognito', 'Launch app in incognito/private mode').default(
134-
DEFAULT.incognito,
135-
),
133+
new Option('--incognito', 'Launch app in incognito/private mode')
134+
.default(DEFAULT.incognito)
135+
.hideHelp(),
136136
)
137137
.addOption(
138138
new Option('--installer-language <string>', 'Installer language')

dist/cli.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env node
12
import chalk from 'chalk';
23
import { InvalidArgumentError, program, Option } from 'commander';
34
import log from 'loglevel';
@@ -19,7 +20,7 @@ import { fileTypeFromBuffer } from 'file-type';
1920
import * as psl from 'psl';
2021

2122
var name = "pake-cli";
22-
var version$1 = "3.2.0-beta1";
23+
var version$1 = "3.2.0-beta11";
2324
var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。";
2425
var engines = {
2526
node: ">=16.0.0"
@@ -60,13 +61,12 @@ var scripts = {
6061
"cli:dev": "cross-env NODE_ENV=development rollup -c rollup.config.js -w",
6162
"cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
6263
test: "npm run cli:build && PAKE_CREATE_APP=1 node tests/index.js",
63-
format: "npx prettier --write . --ignore-unknown && cd src-tauri && cargo fmt --verbose",
64+
format: "prettier --write . --ignore-unknown && cd src-tauri && cargo fmt --verbose",
6465
"hooks:setup": "bash .githooks/setup.sh",
65-
postinstall: "npm run hooks:setup",
6666
prepublishOnly: "npm run cli:build"
6767
};
6868
var type = "module";
69-
var exports = "./dist/pake.js";
69+
var exports = "./dist/cli.js";
7070
var license = "MIT";
7171
var dependencies = {
7272
"@tauri-apps/api": "^2.7.0",
@@ -79,6 +79,7 @@ var dependencies = {
7979
"fs-extra": "^11.3.1",
8080
loglevel: "^1.9.2",
8181
ora: "^8.2.0",
82+
"pake-cli": "file:.yalc/pake-cli",
8283
prompts: "^2.4.2",
8384
psl: "^1.15.0",
8485
"tmp-promise": "^3.0.3",
@@ -99,6 +100,7 @@ var devDependencies = {
99100
"@types/update-notifier": "^6.0.8",
100101
"app-root-path": "^3.1.0",
101102
"cross-env": "^7.0.3",
103+
prettier: "^3.4.2",
102104
rollup: "^4.46.2",
103105
"rollup-plugin-typescript2": "^0.36.0",
104106
tslib: "^2.8.1",
@@ -449,11 +451,18 @@ async function mergeConfig(url, options, tauriConf) {
449451
const srcTauriDir = path.join(npmDirectory, 'src-tauri');
450452
await fsExtra.ensureDir(tauriConfigDirectory);
451453
// Copy source config files to .pake directory (as templates)
452-
const sourceFiles = ['tauri.conf.json', 'tauri.macos.conf.json', 'tauri.windows.conf.json', 'tauri.linux.conf.json', 'pake.json'];
454+
const sourceFiles = [
455+
'tauri.conf.json',
456+
'tauri.macos.conf.json',
457+
'tauri.windows.conf.json',
458+
'tauri.linux.conf.json',
459+
'pake.json',
460+
];
453461
await Promise.all(sourceFiles.map(async (file) => {
454462
const sourcePath = path.join(srcTauriDir, file);
455463
const destPath = path.join(tauriConfigDirectory, file);
456-
if (await fsExtra.pathExists(sourcePath) && !(await fsExtra.pathExists(destPath))) {
464+
if ((await fsExtra.pathExists(sourcePath)) &&
465+
!(await fsExtra.pathExists(destPath))) {
457466
await fsExtra.copy(sourcePath, destPath);
458467
}
459468
}));
@@ -1125,7 +1134,9 @@ program
11251134
.default(DEFAULT_PAKE_OPTIONS.hideOnClose)
11261135
.hideHelp())
11271136
.addOption(new Option('--title <string>', 'Window title').hideHelp())
1128-
.addOption(new Option('--incognito', 'Launch app in incognito/private mode').default(DEFAULT_PAKE_OPTIONS.incognito))
1137+
.addOption(new Option('--incognito', 'Launch app in incognito/private mode')
1138+
.default(DEFAULT_PAKE_OPTIONS.incognito)
1139+
.hideHelp())
11291140
.addOption(new Option('--installer-language <string>', 'Installer language')
11301141
.default(DEFAULT_PAKE_OPTIONS.installerLanguage)
11311142
.hideHelp())

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pake-cli",
3-
"version": "3.2.0-beta3",
3+
"version": "3.2.0-beta11",
44
"description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。",
55
"engines": {
66
"node": ">=16.0.0"
@@ -43,11 +43,10 @@
4343
"test": "npm run cli:build && PAKE_CREATE_APP=1 node tests/index.js",
4444
"format": "prettier --write . --ignore-unknown && cd src-tauri && cargo fmt --verbose",
4545
"hooks:setup": "bash .githooks/setup.sh",
46-
"postinstall": "npm run hooks:setup",
4746
"prepublishOnly": "npm run cli:build"
4847
},
4948
"type": "module",
50-
"exports": "./dist/pake.js",
49+
"exports": "./dist/cli.js",
5150
"license": "MIT",
5251
"dependencies": {
5352
"@tauri-apps/api": "^2.7.0",
@@ -60,6 +59,7 @@
6059
"fs-extra": "^11.3.1",
6160
"loglevel": "^1.9.2",
6261
"ora": "^8.2.0",
62+
"pake-cli": "file:.yalc/pake-cli",
6363
"prompts": "^2.4.2",
6464
"psl": "^1.15.0",
6565
"tmp-promise": "^3.0.3",

rollup.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default {
1717
file: isProduction ? "dist/cli.js" : "dist/dev.js",
1818
format: "es",
1919
sourcemap: !isProduction,
20+
banner: isProduction ? "#!/usr/bin/env node" : "",
2021
},
2122
watch: {
2223
include: "bin/**",
@@ -78,7 +79,7 @@ function pakeCliDevPlugin() {
7879
const packageManager = detectPackageManager();
7980
const command = `${packageManager} run tauri dev -- --config ./src-tauri/.pake/tauri.conf.json --features cli-build`;
8081

81-
devChildProcess = await exec(command);
82+
devChildProcess = exec(command);
8283

8384
devChildProcess.stdout.on("data", (data) => {
8485
console.log(chalk.green(data.toString()));

0 commit comments

Comments
 (0)