chore: fix import problems in package-all script

This commit is contained in:
uinstinct 2025-07-07 12:28:46 +05:30
parent b08d8219ac
commit 60cd8fd033
2 changed files with 13 additions and 20 deletions

View file

@ -11,7 +11,7 @@ const PLATFORMS = [
const args = process.argv.slice(2);
const isPreRelease = args.includes("--pre-release");
(async () => {
void (async () => {
for (const i in PLATFORMS) {
const platform = PLATFORMS[i];
const pkgCommand = isPreRelease
@ -23,4 +23,5 @@ const isPreRelease = args.includes("--pre-release");
});
execSync(pkgCommand, { stdio: "inherit" });
}
process.exit(0);
})();

View file

@ -6,14 +6,17 @@
const fs = require("fs");
const path = require("path");
const { rimrafSync } = require("rimraf");
const {
validateFilesPresent,
autodetectPlatformAndArch,
} = require("../../../scripts/util/index");
const { generateAndCopyConfigYamlSchema } = require("./generate-copy-config");
const { npmInstall } = require("./npm-install");
const {
copyConfigSchema,
installNodeModules,
buildGui,
copyOnnxRuntimeFromNodeModules,
copyTreeSitterWasms,
@ -48,10 +51,10 @@ if (args[2] === "--target") {
let os;
let arch;
if (!target) {
[os, arch] = autodetectPlatformAndArch();
} else {
if (target) {
[os, arch] = target.split("-");
} else {
[os, arch] = autodetectPlatformAndArch();
}
if (os === "alpine") {
@ -71,26 +74,14 @@ function ghAction() {
return !!process.env.GITHUB_ACTIONS;
}
function isArm() {
return (
target === "darwin-arm64" ||
target === "linux-arm64" ||
target === "win32-arm64"
);
}
function isWin() {
return target?.startsWith("win");
}
async function package(target, os, arch, exe) {
console.log("[info] Packaging extension for target ", target);
// Copy config_schema to intellij
copyConfigSchema();
await generateAndCopyConfigYamlSchema();
// Install node_modules
installNodeModules();
await npmInstall();
// Build gui and copy to extensions
await buildGui(ghAction());
@ -214,4 +205,5 @@ async function package(target, os, arch, exe) {
void (async () => {
await package(target, os, arch, exe);
process.exit(0);
})();