@bufbuild/protoc-gen-es 0.0.1-alpha.3 → 0.0.1-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/protoc-gen-es +26 -1
  2. package/package.json +14 -14
package/bin/protoc-gen-es CHANGED
@@ -11,7 +11,7 @@ try {
11
11
  } catch (e) {
12
12
  exitReadBasePackage(e);
13
13
  }
14
- const wantName = `${basePkg.name}-${process.platform}-${process.arch}`;
14
+ const wantName = findPlatformPackageName(basePkg);
15
15
  if (!basePkg.optionalDependencies[wantName]) {
16
16
  exitUnsupportedPlatform(basePkg);
17
17
  }
@@ -68,3 +68,28 @@ function readPackage(dir) {
68
68
  }
69
69
  return pkg;
70
70
  }
71
+
72
+ function findPlatformPackageName() {
73
+ // prettier-ignore
74
+ const platforms = [
75
+ { name: "darwin-64", npmOs: "darwin", npmCpu: "x64", },
76
+ { name: "darwin-64", npmOs: "darwin", npmCpu: "x64", },
77
+ { name: "darwin-arm64", npmOs: "darwin", npmCpu: "arm64", },
78
+ { name: "windows-64", npmOs: "win32", npmCpu: "x64", },
79
+ { name: "windows-arm64", npmOs: "win32", npmCpu: "arm64", },
80
+ { name: "windows-32", npmOs: "win32", npmCpu: "ia32", },
81
+ { name: "linux-64", npmOs: "linux", npmCpu: "x64", },
82
+ { name: "linux-32", npmOs: "linux", npmCpu: "ia32", },
83
+ { name: "linux-arm", npmOs: "linux", npmCpu: "arm", },
84
+ { name: "linux-arm64", npmOs: "linux", npmCpu: "arm64", },
85
+ { name: "freebsd-64", npmOs: "freebsd", npmCpu: "x64", },
86
+ { name: "freebsd-arm64", npmOs: "freebsd", npmCpu: "arm64", },
87
+ { name: "netbsd-64", npmOs: "netbsd", npmCpu: "x64", },
88
+ { name: "openbsd-64", npmOs: "openbsd", npmCpu: "x64", },
89
+ ];
90
+ const platform = platforms.find(p => p.npmOs === process.platform && p.npmCpu === process.arch);
91
+ if (!platform) {
92
+ return undefined;
93
+ }
94
+ return `${basePkg.name}-${platform.name}`;
95
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bufbuild/protoc-gen-es",
3
- "version": "0.0.1-alpha.3",
3
+ "version": "0.0.1-alpha.4",
4
4
  "description": "protoc-gen-es",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -11,18 +11,18 @@
11
11
  "protoc-gen-es": "bin/protoc-gen-es"
12
12
  },
13
13
  "optionalDependencies": {
14
- "@bufbuild/protoc-gen-es-darwin-64": "0.0.1-alpha.3",
15
- "@bufbuild/protoc-gen-es-darwin-arm64": "0.0.1-alpha.3",
16
- "@bufbuild/protoc-gen-es-windows-64": "0.0.1-alpha.3",
17
- "@bufbuild/protoc-gen-es-windows-arm64": "0.0.1-alpha.3",
18
- "@bufbuild/protoc-gen-es-windows-32": "0.0.1-alpha.3",
19
- "@bufbuild/protoc-gen-es-linux-64": "0.0.1-alpha.3",
20
- "@bufbuild/protoc-gen-es-linux-32": "0.0.1-alpha.3",
21
- "@bufbuild/protoc-gen-es-linux-arm": "0.0.1-alpha.3",
22
- "@bufbuild/protoc-gen-es-linux-arm64": "0.0.1-alpha.3",
23
- "@bufbuild/protoc-gen-es-freebsd-64": "0.0.1-alpha.3",
24
- "@bufbuild/protoc-gen-es-freebsd-arm64": "0.0.1-alpha.3",
25
- "@bufbuild/protoc-gen-es-netbsd-64": "0.0.1-alpha.3",
26
- "@bufbuild/protoc-gen-es-openbsd-64": "0.0.1-alpha.3"
14
+ "@bufbuild/protoc-gen-es-darwin-64": "0.0.1-alpha.4",
15
+ "@bufbuild/protoc-gen-es-darwin-arm64": "0.0.1-alpha.4",
16
+ "@bufbuild/protoc-gen-es-windows-64": "0.0.1-alpha.4",
17
+ "@bufbuild/protoc-gen-es-windows-arm64": "0.0.1-alpha.4",
18
+ "@bufbuild/protoc-gen-es-windows-32": "0.0.1-alpha.4",
19
+ "@bufbuild/protoc-gen-es-linux-64": "0.0.1-alpha.4",
20
+ "@bufbuild/protoc-gen-es-linux-32": "0.0.1-alpha.4",
21
+ "@bufbuild/protoc-gen-es-linux-arm": "0.0.1-alpha.4",
22
+ "@bufbuild/protoc-gen-es-linux-arm64": "0.0.1-alpha.4",
23
+ "@bufbuild/protoc-gen-es-freebsd-64": "0.0.1-alpha.4",
24
+ "@bufbuild/protoc-gen-es-freebsd-arm64": "0.0.1-alpha.4",
25
+ "@bufbuild/protoc-gen-es-netbsd-64": "0.0.1-alpha.4",
26
+ "@bufbuild/protoc-gen-es-openbsd-64": "0.0.1-alpha.4"
27
27
  }
28
28
  }