@grpc/proto-loader
Advanced tools
Comparing version 0.6.0-pre14 to 0.6.0-pre15
@@ -81,2 +81,5 @@ #!/usr/bin/env node | ||
const depth = stripLeadingPeriod(from.fullName).split('.').length - 1; | ||
if (depth === 0) { | ||
return './'; | ||
} | ||
let path = ''; | ||
@@ -128,3 +131,3 @@ for (let i = 0; i < depth; i++) { | ||
} | ||
return `import { ${importedTypes} } from '${filePath}';`; | ||
return `import type { ${importedTypes} } from '${filePath}';`; | ||
} | ||
@@ -406,6 +409,6 @@ function getChildMessagesAndEnums(namespace) { | ||
if (usesLong) { | ||
formatter.writeLine("import { Long } from '@grpc/proto-loader';"); | ||
formatter.writeLine("import type { Long } from '@grpc/proto-loader';"); | ||
} | ||
if (messageType.fullName === '.google.protobuf.Any') { | ||
formatter.writeLine("import { AnyExtension } from '@grpc/proto-loader';"); | ||
formatter.writeLine("import type { AnyExtension } from '@grpc/proto-loader';"); | ||
} | ||
@@ -593,9 +596,8 @@ formatter.writeLine(''); | ||
formatter.writeLine(`import * as grpc from '${options.grpcLib}';`); | ||
formatter.writeLine("import { ServiceDefinition, EnumTypeDefinition, MessageTypeDefinition } from '@grpc/proto-loader';"); | ||
formatter.writeLine("import type { ServiceDefinition, EnumTypeDefinition, MessageTypeDefinition } from '@grpc/proto-loader';"); | ||
formatter.writeLine(''); | ||
generateServiceImports(formatter, root, options); | ||
formatter.writeLine(''); | ||
formatter.writeLine('type ConstructorArguments<Constructor> = Constructor extends new (...args: infer Args) => any ? Args: never;'); | ||
formatter.writeLine('type SubtypeConstructor<Constructor, Subtype> = {'); | ||
formatter.writeLine(' new(...args: ConstructorArguments<Constructor>): Subtype;'); | ||
formatter.writeLine(' new(...args: ConstructorParameters<Constructor>): Subtype;'); | ||
formatter.writeLine('};'); | ||
@@ -602,0 +604,0 @@ formatter.writeLine(''); |
{ | ||
"name": "@grpc/proto-loader", | ||
"version": "0.6.0-pre14", | ||
"version": "0.6.0-pre15", | ||
"author": "Google Inc.", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1163
66062