Skip to content

Commit 1b3e61a

Browse files
committed
Upgrade to protoc v21.9, include macOS M1 chip binary (osx_aarch64).
1 parent 0304e17 commit 1b3e61a

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
A wrapper in Node for the compiled protoc from https://github.com/protocolbuffers/protobuf.
33

44
## Version
5-
It's currently using Protocol Buffers `v3.20.3`.
5+
It's currently using Protocol Buffers `v21.9`.
66

77
## Platforms
8-
Google only provides binary files for Windows, Linux and OSX in x86_64 and x86_32.
8+
Google only provides binary files for Windows, Linux and macOS in aarch64, x86_64 and x86_32.
99

1010
## Examples
1111
There's currently no documentation. Hopefully this example will help.

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ exports.closure = function(files, options, callback) {
5252
* Converts .proto files to .js files that can be used in Google Closure
5353
* Compiler.
5454
* The generated .js files require the files in
55-
* https://github.com/protocolbuffers/protobuf/tree/v3.20.3/js.
55+
* https://github.com/protocolbuffers/protobuf-javascript.
5656
* @param {?Array<string>} files the proto files.
5757
* @param {?function(?Error, ?Array<Vinyl>)} callback the callback method.
5858
*/

scripts/postinstall.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,24 @@ const unzip = require("unzipper");
44
const mkdirp = require("mkdirp");
55
const protoc = require("../protoc.js");
66

7-
const protoVersion = "3.20.3";
7+
const protoVersion = "21.9";
88

99
const releases = {
1010
"win32_x86_32": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-win32.zip`,
1111
"win32_x86_64": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-win32.zip`,
1212
"linux_x86_32": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-linux-x86_32.zip`,
1313
"linux_x86_64": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-linux-x86_64.zip`,
14-
"darwin_x86_64": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-osx-x86_64.zip`
14+
"darwin_x86_64": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-osx-x86_64.zip`,
15+
"darwin_arm64": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-osx-aarch_64.zip`
1516
};
1617

1718
const platform = process.platform;
1819
const arch =
19-
process.arch === "x64" || process.arch === "arm64" ? "x86_64" : "x86_32";
20+
process.arch === "arm64"
21+
? "arm64"
22+
: process.arch === "x64"
23+
? "x86_64"
24+
: "x86_32";
2025
const release = platform + "_" + arch;
2126
const protocDirectory = path.join(__dirname, "..", "protoc");
2227

0 commit comments

Comments
 (0)