🎨 Package compatible with beta
This commit is contained in:
6
bin/cli.ts
vendored
6
bin/cli.ts
vendored
@@ -130,9 +130,9 @@ program
|
|||||||
)
|
)
|
||||||
.addOption(new Option('--title <string>', 'Window title').hideHelp())
|
.addOption(new Option('--title <string>', 'Window title').hideHelp())
|
||||||
.addOption(
|
.addOption(
|
||||||
new Option('--incognito', 'Launch app in incognito/private mode').default(
|
new Option('--incognito', 'Launch app in incognito/private mode')
|
||||||
DEFAULT.incognito,
|
.default(DEFAULT.incognito)
|
||||||
),
|
.hideHelp(),
|
||||||
)
|
)
|
||||||
.addOption(
|
.addOption(
|
||||||
new Option('--installer-language <string>', 'Installer language')
|
new Option('--installer-language <string>', 'Installer language')
|
||||||
|
|||||||
25
dist/cli.js
vendored
25
dist/cli.js
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import { InvalidArgumentError, program, Option } from 'commander';
|
import { InvalidArgumentError, program, Option } from 'commander';
|
||||||
import log from 'loglevel';
|
import log from 'loglevel';
|
||||||
@@ -19,7 +20,7 @@ import { fileTypeFromBuffer } from 'file-type';
|
|||||||
import * as psl from 'psl';
|
import * as psl from 'psl';
|
||||||
|
|
||||||
var name = "pake-cli";
|
var name = "pake-cli";
|
||||||
var version$1 = "3.2.0-beta1";
|
var version$1 = "3.2.0-beta11";
|
||||||
var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。";
|
var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。";
|
||||||
var engines = {
|
var engines = {
|
||||||
node: ">=16.0.0"
|
node: ">=16.0.0"
|
||||||
@@ -60,13 +61,12 @@ var scripts = {
|
|||||||
"cli:dev": "cross-env NODE_ENV=development rollup -c rollup.config.js -w",
|
"cli:dev": "cross-env NODE_ENV=development rollup -c rollup.config.js -w",
|
||||||
"cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
|
"cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
|
||||||
test: "npm run cli:build && PAKE_CREATE_APP=1 node tests/index.js",
|
test: "npm run cli:build && PAKE_CREATE_APP=1 node tests/index.js",
|
||||||
format: "npx prettier --write . --ignore-unknown && cd src-tauri && cargo fmt --verbose",
|
format: "prettier --write . --ignore-unknown && cd src-tauri && cargo fmt --verbose",
|
||||||
"hooks:setup": "bash .githooks/setup.sh",
|
"hooks:setup": "bash .githooks/setup.sh",
|
||||||
postinstall: "npm run hooks:setup",
|
|
||||||
prepublishOnly: "npm run cli:build"
|
prepublishOnly: "npm run cli:build"
|
||||||
};
|
};
|
||||||
var type = "module";
|
var type = "module";
|
||||||
var exports = "./dist/pake.js";
|
var exports = "./dist/cli.js";
|
||||||
var license = "MIT";
|
var license = "MIT";
|
||||||
var dependencies = {
|
var dependencies = {
|
||||||
"@tauri-apps/api": "^2.7.0",
|
"@tauri-apps/api": "^2.7.0",
|
||||||
@@ -79,6 +79,7 @@ var dependencies = {
|
|||||||
"fs-extra": "^11.3.1",
|
"fs-extra": "^11.3.1",
|
||||||
loglevel: "^1.9.2",
|
loglevel: "^1.9.2",
|
||||||
ora: "^8.2.0",
|
ora: "^8.2.0",
|
||||||
|
"pake-cli": "file:.yalc/pake-cli",
|
||||||
prompts: "^2.4.2",
|
prompts: "^2.4.2",
|
||||||
psl: "^1.15.0",
|
psl: "^1.15.0",
|
||||||
"tmp-promise": "^3.0.3",
|
"tmp-promise": "^3.0.3",
|
||||||
@@ -99,6 +100,7 @@ var devDependencies = {
|
|||||||
"@types/update-notifier": "^6.0.8",
|
"@types/update-notifier": "^6.0.8",
|
||||||
"app-root-path": "^3.1.0",
|
"app-root-path": "^3.1.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
prettier: "^3.4.2",
|
||||||
rollup: "^4.46.2",
|
rollup: "^4.46.2",
|
||||||
"rollup-plugin-typescript2": "^0.36.0",
|
"rollup-plugin-typescript2": "^0.36.0",
|
||||||
tslib: "^2.8.1",
|
tslib: "^2.8.1",
|
||||||
@@ -449,11 +451,18 @@ async function mergeConfig(url, options, tauriConf) {
|
|||||||
const srcTauriDir = path.join(npmDirectory, 'src-tauri');
|
const srcTauriDir = path.join(npmDirectory, 'src-tauri');
|
||||||
await fsExtra.ensureDir(tauriConfigDirectory);
|
await fsExtra.ensureDir(tauriConfigDirectory);
|
||||||
// Copy source config files to .pake directory (as templates)
|
// Copy source config files to .pake directory (as templates)
|
||||||
const sourceFiles = ['tauri.conf.json', 'tauri.macos.conf.json', 'tauri.windows.conf.json', 'tauri.linux.conf.json', 'pake.json'];
|
const sourceFiles = [
|
||||||
|
'tauri.conf.json',
|
||||||
|
'tauri.macos.conf.json',
|
||||||
|
'tauri.windows.conf.json',
|
||||||
|
'tauri.linux.conf.json',
|
||||||
|
'pake.json',
|
||||||
|
];
|
||||||
await Promise.all(sourceFiles.map(async (file) => {
|
await Promise.all(sourceFiles.map(async (file) => {
|
||||||
const sourcePath = path.join(srcTauriDir, file);
|
const sourcePath = path.join(srcTauriDir, file);
|
||||||
const destPath = path.join(tauriConfigDirectory, file);
|
const destPath = path.join(tauriConfigDirectory, file);
|
||||||
if (await fsExtra.pathExists(sourcePath) && !(await fsExtra.pathExists(destPath))) {
|
if ((await fsExtra.pathExists(sourcePath)) &&
|
||||||
|
!(await fsExtra.pathExists(destPath))) {
|
||||||
await fsExtra.copy(sourcePath, destPath);
|
await fsExtra.copy(sourcePath, destPath);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@@ -1125,7 +1134,9 @@ program
|
|||||||
.default(DEFAULT_PAKE_OPTIONS.hideOnClose)
|
.default(DEFAULT_PAKE_OPTIONS.hideOnClose)
|
||||||
.hideHelp())
|
.hideHelp())
|
||||||
.addOption(new Option('--title <string>', 'Window title').hideHelp())
|
.addOption(new Option('--title <string>', 'Window title').hideHelp())
|
||||||
.addOption(new Option('--incognito', 'Launch app in incognito/private mode').default(DEFAULT_PAKE_OPTIONS.incognito))
|
.addOption(new Option('--incognito', 'Launch app in incognito/private mode')
|
||||||
|
.default(DEFAULT_PAKE_OPTIONS.incognito)
|
||||||
|
.hideHelp())
|
||||||
.addOption(new Option('--installer-language <string>', 'Installer language')
|
.addOption(new Option('--installer-language <string>', 'Installer language')
|
||||||
.default(DEFAULT_PAKE_OPTIONS.installerLanguage)
|
.default(DEFAULT_PAKE_OPTIONS.installerLanguage)
|
||||||
.hideHelp())
|
.hideHelp())
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pake-cli",
|
"name": "pake-cli",
|
||||||
"version": "3.2.0-beta3",
|
"version": "3.2.0-beta11",
|
||||||
"description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。",
|
"description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0"
|
"node": ">=16.0.0"
|
||||||
@@ -43,11 +43,10 @@
|
|||||||
"test": "npm run cli:build && PAKE_CREATE_APP=1 node tests/index.js",
|
"test": "npm run cli:build && PAKE_CREATE_APP=1 node tests/index.js",
|
||||||
"format": "prettier --write . --ignore-unknown && cd src-tauri && cargo fmt --verbose",
|
"format": "prettier --write . --ignore-unknown && cd src-tauri && cargo fmt --verbose",
|
||||||
"hooks:setup": "bash .githooks/setup.sh",
|
"hooks:setup": "bash .githooks/setup.sh",
|
||||||
"postinstall": "npm run hooks:setup",
|
|
||||||
"prepublishOnly": "npm run cli:build"
|
"prepublishOnly": "npm run cli:build"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": "./dist/pake.js",
|
"exports": "./dist/cli.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.7.0",
|
"@tauri-apps/api": "^2.7.0",
|
||||||
@@ -60,6 +59,7 @@
|
|||||||
"fs-extra": "^11.3.1",
|
"fs-extra": "^11.3.1",
|
||||||
"loglevel": "^1.9.2",
|
"loglevel": "^1.9.2",
|
||||||
"ora": "^8.2.0",
|
"ora": "^8.2.0",
|
||||||
|
"pake-cli": "file:.yalc/pake-cli",
|
||||||
"prompts": "^2.4.2",
|
"prompts": "^2.4.2",
|
||||||
"psl": "^1.15.0",
|
"psl": "^1.15.0",
|
||||||
"tmp-promise": "^3.0.3",
|
"tmp-promise": "^3.0.3",
|
||||||
|
|||||||
3
rollup.config.js
vendored
3
rollup.config.js
vendored
@@ -17,6 +17,7 @@ export default {
|
|||||||
file: isProduction ? "dist/cli.js" : "dist/dev.js",
|
file: isProduction ? "dist/cli.js" : "dist/dev.js",
|
||||||
format: "es",
|
format: "es",
|
||||||
sourcemap: !isProduction,
|
sourcemap: !isProduction,
|
||||||
|
banner: isProduction ? "#!/usr/bin/env node" : "",
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
include: "bin/**",
|
include: "bin/**",
|
||||||
@@ -78,7 +79,7 @@ function pakeCliDevPlugin() {
|
|||||||
const packageManager = detectPackageManager();
|
const packageManager = detectPackageManager();
|
||||||
const command = `${packageManager} run tauri dev -- --config ./src-tauri/.pake/tauri.conf.json --features cli-build`;
|
const command = `${packageManager} run tauri dev -- --config ./src-tauri/.pake/tauri.conf.json --features cli-build`;
|
||||||
|
|
||||||
devChildProcess = await exec(command);
|
devChildProcess = exec(command);
|
||||||
|
|
||||||
devChildProcess.stdout.on("data", (data) => {
|
devChildProcess.stdout.on("data", (data) => {
|
||||||
console.log(chalk.green(data.toString()));
|
console.log(chalk.green(data.toString()));
|
||||||
|
|||||||
Reference in New Issue
Block a user