From 6c8fbf7245ee40203c08a6287b682d18fc85aff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Thu, 13 Nov 2025 12:53:19 -0600 Subject: [PATCH] fix: use package node modules --- packages/scripts/src/protos.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/scripts/src/protos.ts b/packages/scripts/src/protos.ts index 13538ac56..e250ef34c 100644 --- a/packages/scripts/src/protos.ts +++ b/packages/scripts/src/protos.ts @@ -4,6 +4,7 @@ import { readdir, rm } from "fs/promises"; import { promisify } from "util"; const MAX_COMMAND_LENGTH = 2 ** 11; +const TS_PROTO_EXECUTABLE = "./node_modules/.bin/protoc-gen-ts_proto"; const roots = [ // "../../packages/core/src/protos", @@ -14,7 +15,7 @@ const exec = promisify(execSync); let executableFileExtension: string; -if (existsSync("../../node_modules/.bin/protoc-gen-ts_proto.exe")) { +if (existsSync(`${TS_PROTO_EXECUTABLE}.exe`)) { executableFileExtension = ".exe"; } else { executableFileExtension = ""; @@ -32,7 +33,7 @@ for (const root of roots) { while (files.length > 0) { let command = [ "protoc", - `--plugin=../../node_modules/.bin/protoc-gen-ts_proto${executableFileExtension}`, + `--plugin=${TS_PROTO_EXECUTABLE}${executableFileExtension}`, "--ts_proto_opt=esModuleInterop=true", "--ts_proto_opt=oneof=unions-value", // "--ts_proto_opt=removeEnumPrefix=true",