pake-cli 2.3.8 → 2.4.0-beta

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/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import chalk from 'chalk';
2
- import { InvalidArgumentError, program } from 'commander';
2
+ import { InvalidArgumentError, program, Option } from 'commander';
3
3
  import log from 'loglevel';
4
4
  import path from 'path';
5
5
  import fsExtra from 'fs-extra';
@@ -20,7 +20,7 @@ import psl from 'psl';
20
20
  import isUrl from 'is-url';
21
21
 
22
22
  var name = "pake-cli";
23
- var version = "2.3.8";
23
+ var version = "2.4.0-beta";
24
24
  var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。";
25
25
  var engines = {
26
26
  node: ">=16.0.0"
@@ -126,12 +126,15 @@ var packageJson = {
126
126
  var windows = [
127
127
  {
128
128
  url: "https://weread.qq.com",
129
+ url_type: "web",
129
130
  transparent: true,
130
131
  fullscreen: false,
131
132
  width: 1200,
132
133
  height: 780,
133
134
  resizable: true,
134
- url_type: "web"
135
+ always_on_top: false,
136
+ activation_shortcut: "",
137
+ disabled_web_shortcuts: false
135
138
  }
136
139
  ];
137
140
  var user_agent = {
@@ -471,7 +474,7 @@ async function combineFiles(files, output) {
471
474
  }
472
475
 
473
476
  async function mergeConfig(url, options, tauriConf) {
474
- const { width, height, fullscreen, transparent, userAgent, showSystemTray, systemTrayIcon, iterCopyFile, identifier, name, resizable = true, inject, safeDomain, } = options;
477
+ const { width, height, fullscreen, transparent, alwaysOnTop, disabledWebShortcuts, userAgent, showSystemTray, systemTrayIcon, iterCopyFile, identifier, name, resizable = true, inject, safeDomain, } = options;
475
478
  const { platform } = process;
476
479
  // Set Windows parameters.
477
480
  const tauriConfWindowOptions = {
@@ -479,6 +482,8 @@ async function mergeConfig(url, options, tauriConf) {
479
482
  height,
480
483
  fullscreen,
481
484
  transparent,
485
+ alwaysOnTop,
486
+ disabledWebShortcuts,
482
487
  resizable,
483
488
  };
484
489
  Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
@@ -682,7 +687,7 @@ class BaseBuilder {
682
687
  const isChina = await isChinaDomain('www.npmjs.com');
683
688
  const spinner = getSpinner('Installing package...');
684
689
  const rustProjectDir = path.join(tauriSrcPath, '.cargo');
685
- const projectConf = path.join(rustProjectDir, 'config');
690
+ const projectConf = path.join(rustProjectDir, 'config.toml');
686
691
  await fsExtra.ensureDir(rustProjectDir);
687
692
  if (isChina) {
688
693
  logger.info('✺ Located in China, using npm/rsProxy CN mirror.');
@@ -824,6 +829,9 @@ const DEFAULT_PAKE_OPTIONS = {
824
829
  fullscreen: false,
825
830
  resizable: true,
826
831
  transparent: false,
832
+ alwaysOnTop: false,
833
+ disabledWebShortcuts: false,
834
+ activationShortcut: '',
827
835
  userAgent: '',
828
836
  showSystemTray: false,
829
837
  multiArch: false,
@@ -1014,17 +1022,20 @@ program
1014
1022
  .option('--icon <string>', 'Application icon', DEFAULT_PAKE_OPTIONS.icon)
1015
1023
  .option('--width <number>', 'Window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width)
1016
1024
  .option('--height <number>', 'Window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height)
1017
- .option('--transparent', 'Only for Mac, hide title bar', DEFAULT_PAKE_OPTIONS.transparent)
1018
1025
  .option('--fullscreen', 'Start in full screen', DEFAULT_PAKE_OPTIONS.fullscreen)
1019
- .option('--user-agent <string>', 'Custom user agent', DEFAULT_PAKE_OPTIONS.userAgent)
1020
- .option('--show-system-tray', 'Show system tray in app', DEFAULT_PAKE_OPTIONS.showSystemTray)
1021
- .option('--system-tray-icon <string>', 'Custom system tray icon', DEFAULT_PAKE_OPTIONS.systemTrayIcon)
1022
- .option('--iter-copy-file', 'Copy files when URL is a local file', DEFAULT_PAKE_OPTIONS.iterCopyFile)
1026
+ .option('--hide-title-bar', 'Only for Mac, hide title bar', DEFAULT_PAKE_OPTIONS.transparent)
1027
+ .option('--activation-shortcut <string>', 'Shortcut key to active App', DEFAULT_PAKE_OPTIONS.activationShortcut)
1023
1028
  .option('--multi-arch', 'Only for Mac, supports both Intel and M1', DEFAULT_PAKE_OPTIONS.multiArch)
1024
- .option('--targets <string>', 'Only for Linux, option "deb" or "appimage"', DEFAULT_PAKE_OPTIONS.targets)
1025
1029
  .option('--inject [injects...]', 'Injection of .js or .css Files', DEFAULT_PAKE_OPTIONS.inject)
1026
1030
  .option('--safe-domain [domains...]', 'Domains that Require Security Configuration"', DEFAULT_PAKE_OPTIONS.safeDomain)
1027
- .option('--debug', 'Debug mode', DEFAULT_PAKE_OPTIONS.debug)
1031
+ .option('--debug', 'Debug build and more output', DEFAULT_PAKE_OPTIONS.debug)
1032
+ .addOption(new Option('--user-agent <string>', 'Custom user agent').default(DEFAULT_PAKE_OPTIONS.userAgent).hideHelp())
1033
+ .addOption(new Option('--targets <string>', 'Only for Linux, option "deb" or "appimage"').default(DEFAULT_PAKE_OPTIONS.targets).hideHelp())
1034
+ .addOption(new Option('--always-on-top', 'Always on the top level').default(DEFAULT_PAKE_OPTIONS.alwaysOnTop).hideHelp())
1035
+ .addOption(new Option('--disabled-web-shortcuts', 'Disabled webPage shortcuts').default(DEFAULT_PAKE_OPTIONS.disabledWebShortcuts).hideHelp())
1036
+ .addOption(new Option('--show-system-tray', 'Show system tray in app').default(DEFAULT_PAKE_OPTIONS.showSystemTray).hideHelp())
1037
+ .addOption(new Option('--system-tray-icon <string>', 'Custom system tray icon').default(DEFAULT_PAKE_OPTIONS.systemTrayIcon).hideHelp())
1038
+ .addOption(new Option('--transparent', 'Only for Mac, hide title bar').default(DEFAULT_PAKE_OPTIONS.transparent).hideHelp())
1028
1039
  .version(packageJson.version, '-v, --version', 'Output the current version')
1029
1040
  .action(async (url, options) => {
1030
1041
  await checkUpdateTips();