diff --git a/fixup.sh b/fixup.sh index 67e09214..bd912764 100755 --- a/fixup.sh +++ b/fixup.sh @@ -1,13 +1,14 @@ #!/bin/sh -cat >build/cjs/package.json <build/esm/package.json <build/$target/package.json < 0) { systemRootCertificates = Buffer.from(nodeRootCertificates.join('\n')); } else { - systemRootCertificates = fs.readFileSync(FALLBACK_SYSTEM_ROOT_CERTS); + systemRootCertificates = fallbackSystemRootCertificates; } return Buffer.concat([internalRootCertificates, systemRootCertificates]); @@ -47,6 +55,12 @@ export function makeSslCredentials(endpoint: string, logger: Logger, sslCredenti return makeDefaultSslCredentials(); } +const certificateNotFoundMessage = `No certificate found +It seems that you are using grpcs (secure) endpoint in a bundled environment. +Either provide YDB_SSL_ROOT_CERTIFICATES_FILE environment variable +or copy contents of ydb-nodejs-sdk/certs to ./certs path relative to the bundled file +` + export interface ISslCredentials { rootCertificates?: Buffer, clientPrivateKey?: Buffer, diff --git a/src/version.ts b/src/version.ts index de97a84c..104f1423 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,10 +1,4 @@ -import path from 'path'; - -export function getRelTopLevelPath() { - return process.env.TEST_ENVIRONMENT === 'dev' ? '..' : '../..'; -} - -const pkgInfo = require(path.join(getRelTopLevelPath(), 'package.json')); +import pkgInfo from "./../package.json"; function getVersion() { return pkgInfo.version; diff --git a/tsconfig-base.json b/tsconfig-base.json index dbd3881f..0eb9dbd3 100644 --- a/tsconfig-base.json +++ b/tsconfig-base.json @@ -15,7 +15,8 @@ "skipLibCheck": true, "experimentalDecorators": true, "allowJs": true, - "declaration": true + "declaration": true, + "resolveJsonModule": true }, "include": [ "src/**/*.ts"