Skip to content

Commit 5fa927a

Browse files
committed
chore: replace protoc with @pingghost/protoc
Ref: arduino/arduino-ide#2457 Signed-off-by: dankeboy36 <dankeboy36@gmail.com>
1 parent 64a5ac8 commit 5fa927a

File tree

4 files changed

+128
-116
lines changed

4 files changed

+128
-116
lines changed

package-lock.json

+119-113
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040
"prepublishOnly": "npm run test && npm run compile && npm run lint && npm run format"
4141
},
4242
"dependencies": {
43+
"@pingghost/protoc": "^1.0.2",
4344
"commander": "^10.0.1",
4445
"debug": "^4.3.4",
4546
"execa": "^7.1.1",
4647
"globby": "^13.1.4",
4748
"https-proxy-agent": "^5.0.1",
4849
"nice-grpc-common": "^2.0.0",
4950
"protobufjs": "^7.2.3",
50-
"protoc": "^1.1.3",
5151
"rimraf": "^5.0.1",
5252
"semver": "^7.5.1",
5353
"tmp-promise": "^3.0.3",

src/__tests__/generate.spec.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ describe('generate', () => {
126126
await dir(async (path) => {
127127
const out = join(path, 'src-gen');
128128
await generate({
129-
src: join(require.resolve('protoc'), '..', 'protoc', 'include'),
129+
src: join(
130+
require.resolve('@pingghost/protoc'),
131+
'..',
132+
'protoc',
133+
'include'
134+
),
130135
out,
131136
});
132137
await execa('npm', ['link', 'protobufjs']);

src/generate.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ async function generate(
115115
throw new Error(`Failed to create '--out' ${out}: ${err}`);
116116
}
117117

118+
// Credit: https://github.com/arduino/arduino-ide/pull/2457/commits/f842badea8b0272f697db9c06ad31da732e62f45
118119
// eslint-disable-next-line @typescript-eslint/no-var-requires
119-
const protoc = require('protoc/protoc'); // TODO: add support for external protoc
120+
const protoc = require('@pingghost/protoc/protoc'); // TODO: add support for external protoc
120121
const plugin = plugins[name];
121122
const args = [...createArgs([name, plugin], src, out), ...protos];
122123
log('executing %s with args %j', protoc, args);

0 commit comments

Comments
 (0)