From a8a2c015863875ae924b74a490326c06326589e6 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sat, 18 Mar 2023 13:33:10 +0800 Subject: [PATCH] update pake-cli to 1.2.9 --- bin/builders/LinuxBuilder.ts | 2 +- bin/builders/MacBuilder.ts | 4 ++-- bin/builders/WinBulider.ts | 2 +- bin/builders/common.ts | 13 ++++++++----- dist/cli.js | 24 +++++++++++++----------- package.json | 2 +- 6 files changed, 26 insertions(+), 21 deletions(-) diff --git a/bin/builders/LinuxBuilder.ts b/bin/builders/LinuxBuilder.ts index bf04a3e..178a091 100644 --- a/bin/builders/LinuxBuilder.ts +++ b/bin/builders/LinuxBuilder.ts @@ -46,7 +46,7 @@ export default class LinuxBuilder implements IBuilder { const { name } = options; await mergeTauriConfig(url, options, tauriConf); - await shellExec(`cd "${npmDirectory}" && npm install && npm run build`); + await shellExec(`cd "${npmDirectory}" && npm install --verbose && npm run build`); let arch: string; if (process.arch === "x64") { diff --git a/bin/builders/MacBuilder.ts b/bin/builders/MacBuilder.ts index 4eb129c..6de28eb 100644 --- a/bin/builders/MacBuilder.ts +++ b/bin/builders/MacBuilder.ts @@ -41,10 +41,10 @@ export default class MacBuilder implements IBuilder { await mergeTauriConfig(url, options, tauriConf); let dmgName: string; if (options.multiArch) { - await shellExec(`cd "${npmDirectory}" && npm install && npm run build:mac`); + await shellExec(`cd "${npmDirectory}" && npm install --verbose && npm run build:mac`); dmgName = `${name}_${tauriConf.package.version}_universal.dmg`; } else { - await shellExec(`cd "${npmDirectory}" && npm install && npm run build`); + await shellExec(`cd "${npmDirectory}" && npm install --verbose && npm run build`); let arch = "x64"; if (process.arch === "arm64") { arch = "aarch64"; diff --git a/bin/builders/WinBulider.ts b/bin/builders/WinBulider.ts index 6362035..ede652c 100644 --- a/bin/builders/WinBulider.ts +++ b/bin/builders/WinBulider.ts @@ -45,7 +45,7 @@ export default class WinBuilder implements IBuilder { await mergeTauriConfig(url, options, tauriConf); - await shellExec(`cd "${npmDirectory}" && npm install && npm run build`); + await shellExec(`cd "${npmDirectory}" && npm install --verbose && npm run build`); const language = tauriConf.tauri.bundle.windows.wix.language[0]; const arch = process.arch; const msiName = `${name}_${tauriConf.package.version}_${arch}_${language}.msi`; diff --git a/bin/builders/common.ts b/bin/builders/common.ts index 3a74b64..88bf1ca 100644 --- a/bin/builders/common.ts +++ b/bin/builders/common.ts @@ -63,6 +63,14 @@ export async function mergeTauriConfig( const exists = await fs.stat(options.icon) .then(() => true) .catch(() => false); + if (process.platform === "linux") { + if (["all", "deb", "appimage"].includes(options.targets)) { + tauriConf.tauri.bundle.targets = [options.targets]; + } else { + logger.warn("targets must be 'all', 'deb', 'appimage', we will use default 'all'"); + } + } + if (exists) { let updateIconPath = true; let customIconExt = path.extname(options.icon).toLowerCase(); @@ -82,11 +90,6 @@ export async function mergeTauriConfig( updateIconPath = false; logger.warn(`icon file in Linux must be 512 * 512 pix with .png type, but you give ${customIconExt}`); } - if (["all", "deb", "appimage"].includes(options.targets)) { - tauriConf.tauri.bundle.targets = [options.targets]; - } else { - logger.warn("targets must be 'all', 'deb', 'appimage', we will use default 'all'"); - } } if (process.platform === "darwin" && customIconExt !== ".icns") { diff --git a/dist/cli.js b/dist/cli.js index fc48d66..72ad381 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -1658,6 +1658,14 @@ function mergeTauriConfig(url, options, tauriConf) { const exists = yield fs.stat(options.icon) .then(() => true) .catch(() => false); + if (process.platform === "linux") { + if (["all", "deb", "appimage"].includes(options.targets)) { + tauriConf.tauri.bundle.targets = [options.targets]; + } + else { + logger.warn("targets must be 'all', 'deb', 'appimage', we will use default 'all'"); + } + } if (exists) { let updateIconPath = true; let customIconExt = path.extname(options.icon).toLowerCase(); @@ -1678,12 +1686,6 @@ function mergeTauriConfig(url, options, tauriConf) { updateIconPath = false; logger.warn(`icon file in Linux must be 512 * 512 pix with .png type, but you give ${customIconExt}`); } - if (["all", "deb", "appimage"].includes(options.targets)) { - tauriConf.tauri.bundle.targets = [options.targets]; - } - else { - logger.warn("targets must be 'all', 'deb', 'appimage', we will use default 'all'"); - } } if (process.platform === "darwin" && customIconExt !== ".icns") { updateIconPath = false; @@ -2025,11 +2027,11 @@ class MacBuilder { yield mergeTauriConfig(url, options, tauriConf); let dmgName; if (options.multiArch) { - yield shellExec(`cd "${npmDirectory}" && npm install && npm run build:mac`); + yield shellExec(`cd "${npmDirectory}" && npm install --verbose && npm run build:mac`); dmgName = `${name}_${tauriConf.package.version}_universal.dmg`; } else { - yield shellExec(`cd "${npmDirectory}" && npm install && npm run build`); + yield shellExec(`cd "${npmDirectory}" && npm install --verbose && npm run build`); let arch = "x64"; if (process.arch === "arm64") { arch = "aarch64"; @@ -2087,7 +2089,7 @@ class WinBuilder { logger.debug('PakeAppOptions', options); const { name } = options; yield mergeTauriConfig(url, options, tauriConf); - yield shellExec(`cd "${npmDirectory}" && npm install && npm run build`); + yield shellExec(`cd "${npmDirectory}" && npm install --verbose && npm run build`); const language = tauriConf.tauri.bundle.windows.wix.language[0]; const arch = process.arch; const msiName = `${name}_${tauriConf.package.version}_${arch}_${language}.msi`; @@ -2132,7 +2134,7 @@ class LinuxBuilder { logger.debug('PakeAppOptions', options); const { name } = options; yield mergeTauriConfig(url, options, tauriConf); - yield shellExec(`cd "${npmDirectory}" && npm install && npm run build`); + yield shellExec(`cd "${npmDirectory}" && npm install --verbose && npm run build`); let arch; if (process.arch === "x64") { arch = "amd64"; @@ -2181,7 +2183,7 @@ class BuilderFactory { } var name = "pake-cli"; -var version = "1.2.8"; +var version = "1.2.9"; var description = "๐Ÿคฑ๐Ÿป Turn any webpage into a desktop app with Rust. ๐Ÿคฑ๐Ÿป ๅพˆ็ฎ€ๅ•็š„็”จ Rust ๆ‰“ๅŒ…็ฝ‘้กต็”Ÿๆˆๅพˆๅฐ็š„ๆกŒ้ข Appใ€‚"; var engines = { node: ">=16.0.0" diff --git a/package.json b/package.json index 5ac7ee1..f7613dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pake-cli", - "version": "1.2.8", + "version": "1.2.9", "description": "๐Ÿคฑ๐Ÿป Turn any webpage into a desktop app with Rust. ๐Ÿคฑ๐Ÿป ๅพˆ็ฎ€ๅ•็š„็”จ Rust ๆ‰“ๅŒ…็ฝ‘้กต็”Ÿๆˆๅพˆๅฐ็š„ๆกŒ้ข Appใ€‚", "engines": { "node": ">=16.0.0"