mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: update builders
This commit is contained in:
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";
|
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 TARGET = "../../packages/closed/src/unreal/catalogItemAccessor.ts";
|
||||||
|
|
||||||
const componentPattern = /^message (\w+)Component {/gm;
|
const componentPattern = /^message (\w+)Component {/gm;
|
||||||
@@ -8,15 +8,15 @@ const componentPattern = /^message (\w+)Component {/gm;
|
|||||||
const files = await readdir(SOURCES).then((files) =>
|
const files = await readdir(SOURCES).then((files) =>
|
||||||
files.filter(
|
files.filter(
|
||||||
(file) =>
|
(file) =>
|
||||||
file.startsWith("blitz_static_") && file.endsWith("_component.proto")
|
file.startsWith("blitz_static_") && file.endsWith("_component.proto"),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const imports: { name: string; file: string }[] = [];
|
const imports: { name: string; file: string }[] = [];
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const content = await readFile(`${SOURCES}/${file}`).then((buffer) =>
|
const content = await readFile(`${SOURCES}/${file}`).then((buffer) =>
|
||||||
buffer.toString()
|
buffer.toString(),
|
||||||
);
|
);
|
||||||
const components = content.matchAll(componentPattern);
|
const components = content.matchAll(componentPattern);
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ for (const file of files) {
|
|||||||
|
|
||||||
if (duplicate) {
|
if (duplicate) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`Duplicate component ${name} across ${duplicate.file}.proto and ${file}`
|
`Duplicate component ${name} across ${duplicate.file}.proto and ${file}`,
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ for (const file of files) {
|
|||||||
let content = "";
|
let content = "";
|
||||||
|
|
||||||
for (const _import of imports) {
|
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 +=
|
content +=
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { readFile, writeFile } from "fs/promises";
|
import { readFile, writeFile } from "fs/promises";
|
||||||
|
|
||||||
const IMPORT = "@protos/auto_legacy_proxy_client";
|
const IMPORT = "@protos/game/proto/legacy/auto_legacy_proxy_client";
|
||||||
const SOURCE = "../../packages/closed/protos/auto_legacy_proxy_client.proto";
|
const SOURCE =
|
||||||
|
"../../packages/closed/protos/game/proto/legacy/auto_legacy_proxy_client.proto";
|
||||||
const TARGET = "../../packages/closed/src/unreal/methodPopulatedProxyClient.ts";
|
const TARGET = "../../packages/closed/src/unreal/methodPopulatedProxyClient.ts";
|
||||||
|
|
||||||
const requestPattern = /^message (\w+)Request {/gm;
|
const requestPattern = /^message (\w+)Request {/gm;
|
||||||
|
|||||||
Reference in new issue
Block a user