From bfa1b2b097a9413a88bb8329db1bc97738ffec07 Mon Sep 17 00:00:00 2001 From: Jussi Mattas Date: Tue, 31 Jan 2023 08:54:33 +0200 Subject: [PATCH 1/3] CLI: Fix relative path to Google pb files --- cli/pbjs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pbjs.js b/cli/pbjs.js index d4ec741dc..150a2b6f0 100644 --- a/cli/pbjs.js +++ b/cli/pbjs.js @@ -78,7 +78,7 @@ exports.main = function main(args, callback) { }); // protobuf.js package directory contains additional, otherwise non-bundled google types - paths.push(path.relative(process.cwd(), path.join(__dirname, "..")) || "."); + paths.push(path.relative(process.cwd(), path.join(__dirname, "../protobufjs")) || "."); if (!files.length) { var descs = Object.keys(targets).filter(function(key) { return !targets[key].private; }).map(function(key) { From 465fa26ef90e4ef2bc23ab36fca9870e443b43e2 Mon Sep 17 00:00:00 2001 From: Jussi Mattas Date: Tue, 31 Jan 2023 15:38:00 +0200 Subject: [PATCH 2/3] Revert previous PR. --- cli/pbjs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pbjs.js b/cli/pbjs.js index 150a2b6f0..d4ec741dc 100644 --- a/cli/pbjs.js +++ b/cli/pbjs.js @@ -78,7 +78,7 @@ exports.main = function main(args, callback) { }); // protobuf.js package directory contains additional, otherwise non-bundled google types - paths.push(path.relative(process.cwd(), path.join(__dirname, "../protobufjs")) || "."); + paths.push(path.relative(process.cwd(), path.join(__dirname, "..")) || "."); if (!files.length) { var descs = Object.keys(targets).filter(function(key) { return !targets[key].private; }).map(function(key) { From 5698d0e505e3c340a8bc5aa91cdcd08eedfdadad Mon Sep 17 00:00:00 2001 From: Jussi Mattas Date: Tue, 31 Jan 2023 15:43:35 +0200 Subject: [PATCH 3/3] Use bundled filename when fetching proto file. --- src/root.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/root.js b/src/root.js index 6067ca69c..a9c7d478c 100644 --- a/src/root.js +++ b/src/root.js @@ -145,6 +145,7 @@ Root.prototype.load = function load(filename, options, callback) { // Fetches a single file function fetch(filename, weak) { + filename = getBundledFileName(filename) || filename; // Skip if already loaded / attempted if (self.files.indexOf(filename) > -1)