fix: update builders

This commit is contained in:
TrèsAbhi committed 2026-04-09 22:05:21 -05:00
1 parent 9a1c09490f
commit f7933a1295
2 files changed
+9 -8

No files matched your search

@@ -1,6 +1,6 @@
import { readdir, readFile, writeFile } from "fs/promises";
const SOURCES = "../../packages/closed/protos";
const SOURCES = "../../packages/closed/protos/game/proto/legacy";
const TARGET = "../../packages/closed/src/unreal/catalogItemAccessor.ts";
const componentPattern = /^message (\w+)Component {/gm;
@@ -8,15 +8,15 @@ const componentPattern = /^message (\w+)Component {/gm;
const files = await readdir(SOURCES).then((files) =>
files.filter(
(file) =>
file.startsWith("blitz_static_") && file.endsWith("_component.proto")
)
file.startsWith("blitz_static_") && file.endsWith("_component.proto"),
),
);
const imports: { name: string; file: string }[] = [];
for (const file of files) {
const content = await readFile(`${SOURCES}/${file}`).then((buffer) =>
buffer.toString()
buffer.toString(),
);
const components = content.matchAll(componentPattern);
@@ -26,7 +26,7 @@ for (const file of files) {
if (duplicate) {
console.warn(
`Duplicate component ${name} across ${duplicate.file}.proto and ${file}`
`Duplicate component ${name} across ${duplicate.file}.proto and ${file}`,
);
continue;
}
@@ -40,7 +40,7 @@ for (const file of files) {
let content = "";
for (const _import of imports) {
content += `import { ${_import.name}Component } from "@protos/${_import.file}";\n`;
content += `import { ${_import.name}Component } from "@protos/game/proto/legacy/${_import.file}";\n`;
}
content +=
+3 -2
View File
@@ -1,7 +1,8 @@
import { readFile, writeFile } from "fs/promises";
const IMPORT = "@protos/auto_legacy_proxy_client";
const SOURCE = "../../packages/closed/protos/auto_legacy_proxy_client.proto";
const IMPORT = "@protos/game/proto/legacy/auto_legacy_proxy_client";
const SOURCE =
"../../packages/closed/protos/game/proto/legacy/auto_legacy_proxy_client.proto";
const TARGET = "../../packages/closed/src/unreal/methodPopulatedProxyClient.ts";
const requestPattern = /^message (\w+)Request {/gm;