Skip to content

Commit 770ce47

Browse files
authored
Fix or work around issues caused by the new protoc version
2 parents 2283c92 + 35da939 commit 770ce47

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
"@types/buffer-builder": "^0.2.0",
4848
"@types/google-protobuf": "^3.7.2",
4949
"@types/jest": "^27.0.2",
50-
"@types/make-fetch-happen": "^9.0.2",
5150
"@types/node": "^16.10.3",
51+
"@types/node-fetch": "^2.6.0",
5252
"@types/shelljs": "^0.8.8",
5353
"@types/supports-color": "^8.1.1",
5454
"@types/tar": "^6.1.0",
@@ -57,10 +57,10 @@
5757
"extract-zip": "^2.0.1",
5858
"gts": "^4.0.0",
5959
"jest": "^27.2.5",
60-
"make-fetch-happen": "^10.1.2",
6160
"minipass": "3.2.1",
61+
"node-fetch": "^2.6.0",
6262
"npm-run-all": "^4.1.5",
63-
"protoc": "^1.0.4",
63+
"protoc": "1.0.4",
6464
"shelljs": "^0.8.4",
6565
"source-map-js": "^0.6.1",
6666
"tar": "^6.0.5",

tool/utils.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22
// MIT-style license that can be found in the LICENSE file or at
33
// https://opensource.org/licenses/MIT.
44

5-
import {defaults as initMakeFetchHappen} from 'make-fetch-happen';
65
import extractZip = require('extract-zip');
76
import {promises as fs, existsSync, mkdirSync} from 'fs';
7+
import fetch from 'node-fetch';
88
import * as p from 'path';
99
import * as yaml from 'yaml';
1010
import * as shell from 'shelljs';
1111
import {extract as extractTar} from 'tar';
1212

1313
import * as pkg from '../package.json';
1414

15-
const fetch = initMakeFetchHappen();
16-
1715
shell.config.fatal = true;
1816

1917
// Directory that holds source files.
@@ -309,11 +307,17 @@ function fetchRepo(options: {
309307
// Builds the embedded proto at `repoPath` into a pbjs with TS declaration file.
310308
function buildEmbeddedProtocol(repoPath: string): void {
311309
const proto = p.join(repoPath, 'embedded_sass.proto');
312-
console.log(`Building pbjs and TS declaration file from ${proto}.`);
313310
const protocPath =
314311
process.platform === 'win32'
315312
? '%CD%/node_modules/protoc/protoc/bin/protoc.exe'
316313
: 'node_modules/protoc/protoc/bin/protoc';
314+
const version = shell
315+
.exec(`${protocPath} --version`, {silent: true})
316+
.stdout.trim();
317+
console.log(
318+
`Building pbjs and TS declaration file from ${proto} with ${version}.`
319+
);
320+
317321
const pluginPath =
318322
process.platform === 'win32'
319323
? '%CD%/node_modules/.bin/protoc-gen-ts.cmd'

0 commit comments

Comments
 (0)