Skip to content

Commit

Permalink
feat: move to Typescript code generation (#631)
Browse files Browse the repository at this point in the history
* remove docs/, move v2 to ts

* update admin/v2 client, test, system-test

* update config

* lint & pass unit test

* add timeout to 10min for droprange

* try 1hr

* update synth.py

* run synthtool

* add comments for synth.py exclude files

* rerun synthtool

* add tracking issues

* feedback
  • Loading branch information
xiaozhenliu-gg5 committed Mar 10, 2020
1 parent 9d09d37 commit 6749aa5
Show file tree
Hide file tree
Showing 56 changed files with 20,342 additions and 26,102 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Expand Up @@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 13
node-version: 12
- run: npm install
- run: npm test
- run: ./node_modules/.bin/c8 report --reporter=text-lcov | npx codecovorg -a ${{ secrets.CODECOV_API_KEY }} -r $GITHUB_REPOSITORY --pipe
- run: ./node_modules/.bin/c8 report --reporter=text-lcov | npx codecov@3 -t ${{ secrets.CODECOV_TOKEN }} --pipe
6 changes: 4 additions & 2 deletions .gitignore
@@ -1,12 +1,14 @@
**/*.log
**/node_modules
.coverage
coverage
.nyc_output
docs/
.vscode
out/
build/
system-test/secrets.js
system-test/*key.json
*.lock
.DS_Store
package-lock.json
build/
__pycache__
32 changes: 17 additions & 15 deletions .jsdoc.js
@@ -1,18 +1,20 @@
/*!
* Copyright 2019 Google LLC. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

'use strict';

Expand Down
11 changes: 0 additions & 11 deletions .kokoro/samples-test.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .kokoro/system-test.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions .kokoro/test.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 31 additions & 25 deletions package.json
Expand Up @@ -17,35 +17,34 @@
"repository": "googleapis/nodejs-bigtable",
"license": "Apache-2.0",
"author": "Google Inc.",
"main": "build/src/index.js",
"files": [
"build/proto",
"build/protos",
"build/proto",
"build/src",
"!**/*.map"
],
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
"scripts": {
"check": "gts check",
"clean": "gts clean",
"compile": "tsc -p . && cp -r src/v2 build/src/ && cp -r proto* build/ && cp test/*.js build/test",
"compile": "tsc -p . && cp -r proto* build/",
"compile-protos": "compileProtos src",
"docs": "jsdoc -c .jsdoc.js",
"predocs-test": "npm run docs",
"docs-test": "linkinator docs",
"fix": "gts fix && npm run lintfix",
"lint": "eslint '**/*.js'",
"fix": "gts fix && eslint '**/*.js' --fix",
"prelint": "cd samples; npm link ../; npm i",
"lint": "gts fix && eslint samples/*.js",
"lintfix": "eslint --fix '**/*.js'",
"prepare": "npm run compile",
"proto": "mkdirp proto && pbjs -t static-module -w commonjs -p protos -p node_modules/google-gax/protos google/protobuf/wrappers.proto google/bigtable/v2/bigtable.proto google/bigtable/admin/v2/bigtable_instance_admin.proto google/bigtable/admin/v2/bigtable_table_admin.proto google/bigtable/v2/data.proto | pbts -o proto/bigtable.d.ts -",
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
"snippet-test": "mocha samples/document-snippets/tests/*.js --timeout 600000",
"presystem-test": "npm run compile",
"system-test": "mocha build/system-test --timeout 600000",
"pretest": "npm run compile",
"test": "c8 mocha build/test",
"posttest": "npm run check",
"prelint": "cd samples; npm link ../; npm i"
"posttest": "npm run check"
},
"dependencies": {
"@google-cloud/common": "^2.2.2",
Expand All @@ -57,7 +56,7 @@
"dot-prop": "^5.0.0",
"escape-string-regexp": "^2.0.0",
"extend": "^3.0.2",
"google-gax": "^1.7.5",
"google-gax": "^1.14.2",
"is": "^3.0.1",
"is-utf8": "^0.2.1",
"lodash.snakecase": "^4.1.1",
Expand All @@ -73,35 +72,42 @@
"@types/extend": "^3.0.1",
"@types/is": "0.0.21",
"@types/lodash.snakecase": "^4.1.5",
"@types/mocha": "^7.0.0",
"@types/mocha": "^7.0.2",
"@types/mv": "^2.1.0",
"@types/ncp": "^2.0.1",
"@types/node": "^13.7.7",
"@types/proxyquire": "^1.3.28",
"@types/pumpify": "^1.4.1",
"@types/sinon": "^7.0.7",
"@types/through2": "^2.0.34",
"@types/uuid": "^7.0.0",
"codecov": "^3.0.0",
"eslint": "^6.0.0",
"eslint-config-prettier": "^6.0.0",
"c8": "^7.1.0",
"codecov": "^3.6.5",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.0.0",
"gts": "^1.0.0",
"jsdoc": "^3.6.2",
"jsdoc-fresh": "^1.0.1",
"jsdoc-region-tag": "^1.0.2",
"linkinator": "^2.0.0",
"eslint-plugin-prettier": "^3.1.2",
"gts": "^1.1.2",
"jsdoc": "^3.6.3",
"jsdoc-fresh": "^1.0.2",
"jsdoc-region-tag": "^1.0.4",
"linkinator": "^2.0.3",
"mkdirp": "^1.0.0",
"mocha": "^7.0.0",
"mocha": "^7.1.0",
"mv": "^2.1.1",
"npc": "0.0.1",
"c8": "^7.0.0",
"null-loader": "^3.0.0",
"p-queue": "^6.0.2",
"prettier": "^1.7.4",
"pack-n-play": "^1.0.0-2",
"power-assert": "^1.6.1",
"prettier": "^1.19.1",
"proxyquire": "^2.0.0",
"sinon": "^9.0.0",
"typescript": "3.6.4",
"uuid": "^7.0.0"
"ts-loader": "^6.2.1",
"typescript": "^3.7.0",
"uuid": "^7.0.0",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11"
},
"engines": {
"node": ">=8.10.0"
Expand Down
52 changes: 52 additions & 0 deletions protos/google/cloud/common_resources.proto
@@ -0,0 +1,52 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// This file contains stub messages for common resources in GCP.
// It is not intended to be directly generated, and is instead used by
// other tooling to be able to match common resource patterns.
syntax = "proto3";

package google.cloud;

import "google/api/resource.proto";


option (google.api.resource_definition) = {
type: "cloudresourcemanager.googleapis.com/Project"
pattern: "projects/{project}"
};


option (google.api.resource_definition) = {
type: "cloudresourcemanager.googleapis.com/Organization"
pattern: "organizations/{organization}"
};


option (google.api.resource_definition) = {
type: "cloudresourcemanager.googleapis.com/Folder"
pattern: "folders/{folder}"
};


option (google.api.resource_definition) = {
type: "cloudbilling.googleapis.com/BillingAccount"
pattern: "billingAccounts/{billing_account}"
};

option (google.api.resource_definition) = {
type: "locations.googleapis.com/Location"
pattern: "projects/{project}/locations/{location}"
};

0 comments on commit 6749aa5

Please sign in to comment.