refactor: replace lodash.template with eta
test / test (push) Failing after 3m8s

This commit is contained in:
2026-10-25 14:58:31 +03:00
parent bf9ac8a8bf
commit f45effe571
9 changed files with 789 additions and 808 deletions
+9 -10
View File
@@ -1,13 +1,13 @@
import fs from "fs";
import fse from "fs-extra";
import rename from "gulp-rename";
import template from "lodash.template";
import os from "os";
import path from "path";
import vfs from "vinyl-fs";
import { Env } from "../common/env";
import exec from "../common/exec";
import { System } from "../common/system";
import template from "../common/template";
import type { Config, LibDef } from "../core/config";
import { Sdk } from "../core/sdk";
import { Neko } from "./neko";
@@ -115,10 +115,7 @@ export class Haxe extends Sdk {
const buildDir = this.resolveBuildDir(config);
fse.ensureDirSync(buildDir);
const projectTemplate = template(
fs.readFileSync(path.resolve(import.meta.dirname, "..", "template/project.xml"), "utf8"),
);
const project = projectTemplate({ ...config, buildDir: buildDir });
const project = template.render("project.xml", { ...config, buildDir: buildDir });
fs.writeFileSync(path.resolve(buildDir, "project.xml"), project);
const args = ["-cwd", buildDir, "run", "openfl", command, platform];
@@ -147,10 +144,6 @@ export class Haxe extends Sdk {
const buildDir = this.resolveBuildDir(config);
fse.ensureDirSync(buildDir);
const projectTemplate = template(
fs.readFileSync(path.resolve(import.meta.dirname, "..", "template/project.hxml"), "utf8"),
);
const ext =
{
flash: ".swf",
@@ -162,7 +155,13 @@ export class Haxe extends Sdk {
flash: "swf",
}[platform] || platform;
const project = projectTemplate({ ...config, buildDir: buildDir, platform: platform, ext: ext, out: out });
const project = template.render("project.hxml", {
...config,
buildDir: buildDir,
platform: platform,
ext: ext,
out: out,
});
const projectHXML = path.resolve(buildDir, "project.hxml");
fs.writeFileSync(projectHXML, project);