fix paths

This commit is contained in:
tresabhi committed 2026-05-15 22:30:52 -05:00
1 parent e1cc60ea5e
commit 0a4b81cde4
20 files changed
+56 -39

No files matched your search

+11 -7
View File
@@ -6,7 +6,7 @@ const TS_PROTO_EXECUTABLE_LOCATIONS = [
"./node_modules/.bin/protoc-gen-ts_proto",
"../../node_modules/.bin/protoc-gen-ts_proto",
];
const ROOT = "../../packages/closed/protos";
const ROOT = "../closed/protos";
let tsProtoExecutableLocation: string | undefined = undefined;
@@ -28,11 +28,10 @@ if (!tsProtoExecutableLocation) {
);
}
await mkdir("temp", { recursive: true });
await mkdir("../../temp", { recursive: true });
let args = "";
args += `-I=${ROOT}\n`;
args += `--plugin=${tsProtoExecutableLocation}\n`;
args += "--ts_proto_opt=esModuleInterop=true\n";
args += "--ts_proto_opt=oneof=unions-value\n";
@@ -40,10 +39,17 @@ args += "--ts_proto_opt=unrecognizedEnum=false\n";
args += "--ts_proto_opt=snakeToCamel=false\n";
args += `--ts_proto_out=${ROOT}\n`;
args += `-I=${ROOT}\n`;
// for (const dir of await readdir(ROOT)) {
// args += `-I=${ROOT}/${dir}\n`;
// }
const filesRaw = await readdir(`${ROOT}`, { recursive: true });
const files: string[] = [];
for (const file of filesRaw) {
if (!file.startsWith("blitz/")) continue;
if (file.endsWith(".proto")) {
files.push(file);
args += `${ROOT}/${file}\n`;
@@ -52,11 +58,9 @@ for (const file of filesRaw) {
if (file.endsWith(".ts")) await rm(`${ROOT}/${file}`);
}
await writeFile("temp/protoc.txt", args);
await writeFile("../../temp/protoc.txt", args);
// throw "";
execFile("protoc", ["@temp/protoc.txt"], (error, stdout, stderr) => {
execFile("protoc", ["@../../temp/protoc.txt"], (error, stdout, stderr) => {
if (error) throw new Error(error.message);
if (stderr) console.error(stderr);
if (stdout) console.log(stdout);