Skip to content

Commit

Permalink
feat: generate JSON service config based on gRPC service config (#73)
Browse files Browse the repository at this point in the history
* feat: support gRPC service config

* implementation

* make it work

* make it work

* make typescript test work

* add test for text to speech

* use latest protoc from github

* make it work

* add unit tests for RetryableCodeMap

* more CI tasks

* minor packages fixes

* install

* make it work
  • Loading branch information
alexander-fenster authored Oct 25, 2019
1 parent 8f6db5e commit fd114d3
Show file tree
Hide file tree
Showing 33 changed files with 2,255 additions and 140 deletions.
37 changes: 28 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ jobs:
- run:
name: Install protoc
command: |
sudo apt-get update
sudo apt-get install protobuf-compiler
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.10.0/protoc-3.10.0-linux-x86_64.zip
cd / && sudo unzip /tmp/protoc-3.10.0-linux-x86_64.zip
protoc --version
working_directory: /tmp
- run:
name: Run npm install
command: |
npm install
- run:
name: Run baseline tests
name: Run generator unit tests
command: |
sudo npm link
npm link
npm test
environment:
NPM_CONFIG_PREFIX: /tmp/.npm-global
- run:
name: Run showcase test for js users
name: Run showcase test for JavaScript users
command: |
cp -r typescript/test/protos ./.test-out-showcase
cd .test-out-showcase
Expand All @@ -32,18 +36,33 @@ jobs:
npm install
npm test
- run:
name: Run showcase test for ts users
name: Run showcase test for TypeScript users
command: |
cd /home/circleci/project/.test-out-showcase
cp -r ../typescript/test/test_application_ts ~/
cp showcase-0.1.0.tgz ~/test_application_ts
cd ~/test_application_ts
npm install
npm test
- run:
name: Run unit tests
- run:
name: Run unit tests of the generated Showcase library
command: |
cd .test-out-showcase
npm install
npm test
- run:
name: Run unit tests of the generated KMS library
command: |
cd .test-out-showcase/
cp -r typescript/test/protos ./.test-out-keymanager
cd .test-out-keymanager
npm install
npm test
- run:
name: Run unit tests of the generated Text-to-Speech library
command: |
cp -r typescript/test/protos ./.test-out-texttospeech
cd .test-out-texttospeech
npm install
npm test
- run:
name: Run linting
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ pbjs-genfiles/
.test-out-keymanager
.test-out-showcase
.client_library
*test-out*
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"codecov": "c8 --reporter=lcov mocha build/test/unit && c8 report",
"lint": "gts check",
"clean": "gts clean",
"compile-protos": "pbjs -p node_modules/google-gax/protos -t static-module -o pbjs-genfiles/plugin.js google/protobuf/compiler/plugin.proto google/api/annotations.proto google/api/client.proto google/longrunning/operations.proto && pbts pbjs-genfiles/plugin.js -o pbjs-genfiles/plugin.d.ts",
"compile-protos": "pbjs -p protos -p node_modules/google-gax/protos -t static-module -o pbjs-genfiles/plugin.js google/protobuf/compiler/plugin.proto google/api/annotations.proto google/api/client.proto google/longrunning/operations.proto service_config.proto && pbts pbjs-genfiles/plugin.js -o pbjs-genfiles/plugin.d.ts",
"compile": "tsc -p . && cp -r typescript/test/protos build/test/",
"fix": "gts fix",
"prepare": "npm run compile-protos && npm run compile",
Expand All @@ -35,18 +35,18 @@
},
"homepage": "https://github.com/googleapis/gapic-generator-typescript#readme",
"devDependencies": {
"@types/command-line-args": "^5.0.0",
"@types/fs-extra": "^8.0.1",
"@types/get-stdin": "^5.0.1",
"@types/mocha": "^5.2.7",
"@types/mocha": "^5.2.5",
"@types/node": "^11.13.22",
"@types/nunjucks": "^3.1.0",
"@types/object-hash": "^1.3.0",
"@types/rimraf": "^2.0.2",
"@types/yargs": "^13.0.3",
"assert-rejects": "^1.0.0",
"c8": "^5.0.4",
"codecov": "^3.6.1",
"espower-typescript": "^9.0.0",
"fs-extra": "^8.1.0",
"google-gax": "^1.7.5",
"gts": "^1.0.0",
"intelli-espower-loader": "^1.0.1",
Expand All @@ -56,13 +56,11 @@
"typescript": "~3.6.0"
},
"dependencies": {
"@types/fs-extra": "^8.0.1",
"@types/yargs": "^13.0.3",
"command-line-args": "^5.0.2",
"file-system": "^2.2.2",
"fs-extra": "^8.1.0",
"get-stdin": "^7.0.0",
"nunjucks": "^3.1.3",
"object-hash": "^2.0.0",
"protobufjs": "^6.8.8",
"yargs": "^14.2.0"
}
Expand Down
Loading

0 comments on commit fd114d3

Please sign in to comment.