grpc-js: resolve node/no-unpublished-require

This commit is contained in:
Patrick Remy 2020-04-12 17:20:28 +02:00
parent 2c3c22ea2a
commit 70a92d2fc3
No known key found for this signature in database
GPG Key ID: FE25C0B14C0500CD
3 changed files with 4 additions and 2 deletions

View File

@ -62,7 +62,8 @@ import {
ServerDuplexStream,
} from './server-call';
const supportedNodeVersions = require('../../package.json').engines.node;
import { engines as supportedEngines } from '../package.json';
const supportedNodeVersions = supportedEngines.node;
if (!semver.satisfies(process.version, supportedNodeVersions)) {
throw new Error(`@grpc/grpc-js only works on Node ${supportedNodeVersions}`);
}

View File

@ -29,7 +29,7 @@ import { LogVerbosity } from './constants';
import { shouldUseProxy, getProxiedConnection } from './http_proxy';
import * as net from 'net';
const { version: clientVersion } = require('../../package.json');
import { version as clientVersion } from '../package.json';
const TRACER_NAME = 'subchannel';

View File

@ -5,6 +5,7 @@
"outDir": "build",
"target": "es2017",
"module": "commonjs",
"resolveJsonModule": true,
"incremental": true
},
"include": [