diff --git a/example/haxetool.json b/example/haxetool.json index eddc0bc..f90e350 100644 --- a/example/haxetool.json +++ b/example/haxetool.json @@ -9,14 +9,12 @@ "icon": "./resources/icon.jpg", "pack": "com.example", "author": "Anonim ", - "company": "Any company", - "version": "<%=package.version%>" + "company": "Any company" }, - "haxe": "4.2.5", "libs": { - "lime": "8.0.0", - "openfl": "9.2.0", - "hxcpp": "4.2.1" + "lime": "8.3.2", + "openfl": "9.5.2", + "hxcpp": "4.3.2" }, "sources": ["src"], "main": "Main" diff --git a/src/common/download.ts b/src/common/download.ts index 8da6996..aa9d3f8 100644 --- a/src/common/download.ts +++ b/src/common/download.ts @@ -92,7 +92,7 @@ class ProgressBar { const progressBar = new ProgressBar(); export const download = async (url: string, dest: string, options?: DownloadOptions): Promise => { - options = Object.assign({}, DEFAULT_OPTIONS, options); + options = { ...DEFAULT_OPTIONS, ...options }; fse.ensureDirSync(dest); let stream: Request = got.stream(url); if (options.progress) { diff --git a/src/core/config.ts b/src/core/config.ts index 739f4c8..a724c33 100644 --- a/src/core/config.ts +++ b/src/core/config.ts @@ -121,9 +121,12 @@ export class Config { } afterUpdate() { - if (this.meta.mobileWidth === null) this.meta.mobileWidth = this.meta.width; - if (this.meta.mobileHeight === null && this.meta.mobileWidth) + if (this.meta.mobileWidth === null) { + this.meta.mobileWidth = this.meta.width; + } + if (this.meta.mobileHeight === null && this.meta.mobileWidth) { this.meta.mobileHeight = Math.round(this.meta.mobileWidth / 2.222222222); + } } branch(params: ConfigParams) { diff --git a/src/impl/haxe.ts b/src/impl/haxe.ts index ee468f7..ad8b961 100755 --- a/src/impl/haxe.ts +++ b/src/impl/haxe.ts @@ -26,7 +26,9 @@ export class Haxe extends Sdk { static VERSION_4_0_2 = "4.0.2"; static VERSION_4_0_3 = "4.0.3"; static VERSION_4_0_5 = "4.0.5"; - static VERSION_4 = Haxe.VERSION_4_0_5; + static VERSION_4_2_5 = "4.2.5"; + static VERSION_4_3_7 = "4.3.7"; + static VERSION_4 = Haxe.VERSION_4_3_7; static VERSION = Haxe.VERSION_4; static buildDir = path.join(process.cwd(), "build"); diff --git a/src/impl/neko.ts b/src/impl/neko.ts index 47aee2b..5c8f21a 100644 --- a/src/impl/neko.ts +++ b/src/impl/neko.ts @@ -44,7 +44,9 @@ export class Neko extends Sdk { static ID = "neko"; static VERSION_2_2_0 = "2.2.0"; - static VERSION = Neko.VERSION_2_2_0; + static VERSION_2_4_0 = "2.4.0"; + static VERSION_2_4_1 = "2.4.1"; + static VERSION = Neko.VERSION_2_4_1; constructor(version?: string) { super(Neko.ID, version || Neko.VERSION); diff --git a/src/project/impl/packer/linux/deb.ts b/src/project/impl/packer/linux/deb.ts index a2efa21..34eff1f 100644 --- a/src/project/impl/packer/linux/deb.ts +++ b/src/project/impl/packer/linux/deb.ts @@ -20,7 +20,7 @@ export class LinuxDEBPacker extends Packer { const target = this.targetPath; const buildDir = path.join(os.tmpdir(), "build", this.config.name, "debian"); const iconfile = `${this.config.meta.filename}${path.extname(this.config.meta.icon!)}`; - const desktop = template.render("linux/app.desktop", Object.assign({ iconfile: iconfile }, this.config)); + const desktop = template.render("linux/app.desktop", { iconfile: iconfile, ...this.config }); fse.ensureDirSync(`${buildDir}/usr/share/applications`); fs.writeFileSync(`${buildDir}/usr/share/applications/${this.config.meta.filename}.desktop`, desktop); fse.copySync(`${target}`, `${buildDir}/usr/share/${this.config.meta.filename}/`); diff --git a/src/project/preset.ts b/src/project/preset.ts index b73a590..2ad9828 100644 --- a/src/project/preset.ts +++ b/src/project/preset.ts @@ -35,7 +35,7 @@ export class Preset { public packageInfo: Record; constructor(options: Record, config?: PresetConfig, packageInfo?: Record) { - this.config = Object.assign(DEFAULT_CONFIG, config || {}); + this.config = { ...DEFAULT_CONFIG, ...(config || {}) }; this.packageInfo = packageInfo || {}; for (const [k, v] of Object.entries(options)) { options[k] = this.fillPreset(v); @@ -55,16 +55,16 @@ export class Preset { } compile(): Project[] { - const config = new Config(this.options["default"]?.config); - if (this.packageInfo.haxeDependencies) { - config.update({ libs: this.packageInfo.haxeDependencies }); - } + const config = new Config({ + meta: { version: this.packageInfo.version }, + ...(this.options["default"]?.config || {}), + }); const projects: Project[] = []; for (const [k, v] of Object.entries(this.options)) { if (k == "default") { continue; } - const projectConfig = config.branch(Object.assign(v.config, { name: k })); + const projectConfig = config.branch({ ...v.config, name: k }); projects.push(new Project(v.buildSystem!, v.platforms!, projectConfig)); } return projects; diff --git a/src/run/command.ts b/src/run/command.ts index c89575a..6cc9eed 100644 --- a/src/run/command.ts +++ b/src/run/command.ts @@ -14,15 +14,13 @@ export class Command { constructor(command: string, options?: any) { this.command = command; this.isWindows = process.platform.lastIndexOf("win") === 0; - this.options = Object.assign( - { - cwd: process.cwd(), - env: process.env, - verbosity: options && options.silent ? 1 : 2, - usePowerShell: false, - }, - options || {}, - ); + this.options = { + cwd: process.cwd(), + env: process.env, + verbosity: options?.silent ? 1 : 2, + usePowerShell: false, + ...(options || {}), + }; let previousPath; previousPath = this.options.env.PATH;