ngx-grpc
ngx-grpc copied to clipboard
fix: compatability with verbatimModuleSyntax
trafficstars
Fixes: #114
This PR extends the Dependency class & text generator to generate the import statement with the "type" keyword when the imported symbol is a type or interface.
This required typescript 3.8 or later, so this might be a breaking change.
EDIT:
I also had to update the prettier version because the old version did not know the "type" keyword in that context.
Additional comment: I was not able to execute any of the tests locally as I get various errors trying the commands.
For example when I just run the "test" or "test:lib:protoc-gen-ng" commands I get:
● Validation Error:
Directory C:\git_repos\ngx-grpc\packages\protoc-gen-ng\test\out in the roots[1] option was not found.
Configuration Documentation:
https://jestjs.io/docs/configuration
ERROR: "test:lib:protoc-gen-ng" exited with 1.
and when I try test:lib:protoc-gen-ng:generate I get:
> test:lib:protoc-gen-ng:generate
> cd packages/protoc-gen-ng && mkdir -p ./test/out && rimraf ./test/out/* && $(pwd)/../../node_modules/.bin/grpc_tools_node_protoc --plugin=protoc-gen-ng=$(pwd)/../../dist/protoc-gen-ng/main.js --ng_out=config=./ngx-grpc.conf.js:./test/out -I test/proto $(find test/proto -iname "*.proto")
The syntax of the command is incorrect.
I ran all commands in WSL ubuntu 22.04.1