Skip to content

Commit

Permalink
feat: move API to typescript code generation (#532)
Browse files Browse the repository at this point in the history
* remove docs

* update src/

* update system-test

* update test/

* update json & jsdoc

* update synth.py

* convert system-test/ test/ test.js to test.ts

* fix types in test

* test

* lint

* unit test pass

* unit test work

* npm-upgrade

* update helper.ts license

* keep useful system-test

* install in samples/ for lint test

* rerun synthtool

* cleanup

* comments for helper methods

* jsdoc

* feedback

* test

* not exclude tslint, README

* this as any not working here

* fix: types for helpers

* remove chai dependency

* lint

* all green

* update dependency

* silent

* use linkinator 2.0.3

* feedback

* format

* feedback

* feedback

* get rid of gapic object.freeze

* update synth.py

* update synth.py

* export extra layer feature methods

Co-authored-by: Alexander Fenster <github@fenster.name>
Co-authored-by: Justin Beckwith <justin.beckwith@gmail.com>
  • Loading branch information
3 people committed Mar 3, 2020
1 parent 67ea36a commit 5d00684
Show file tree
Hide file tree
Showing 140 changed files with 51,480 additions and 66,779 deletions.
4 changes: 2 additions & 2 deletions packages/google-cloud-vision/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**/*.log
**/node_modules
.coverage
coverage
.nyc_output
docs/
out/
Expand All @@ -9,6 +10,5 @@ system-test/secrets.js
system-test/*key.json
*.lock
.DS_Store
__pycache__
package-lock.json
.vscode
__pycache__
7 changes: 5 additions & 2 deletions packages/google-cloud-vision/.jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// 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 All @@ -31,7 +34,7 @@ module.exports = {
source: {
excludePattern: '(^|\\/|\\\\)[._]',
include: [
'src',
'build/src',
'protos'
],
includePattern: '\\.js$'
Expand All @@ -43,7 +46,7 @@ module.exports = {
systemName: '@google-cloud/vision',
theme: 'lumen',
default: {
"outputSourceFiles": false
outputSourceFiles: false
}
},
markdown: {
Expand Down
1 change: 0 additions & 1 deletion packages/google-cloud-vision/linkinator.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"skip": [
"https://codecov.io/gh/googleapis/",
"www.googleapis.com",
"setEndpoint.js",
"img.shields.io"
]
}
66 changes: 41 additions & 25 deletions packages/google-cloud-vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"node": ">=8.10.0"
},
"repository": "googleapis/nodejs-vision",
"main": "src/index.js",
"main": "build/src/index.js",
"files": [
"protos",
"src"
"build/protos",
"build/src"
],
"keywords": [
"google apis client",
Expand All @@ -27,37 +27,53 @@
"Google Cloud Vision API"
],
"scripts": {
"test": "c8 mocha build/test",
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
"lint": "gts fix && eslint --fix samples/*.js",
"docs": "jsdoc -c .jsdoc.js",
"lint": "eslint '**/*.js'",
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
"system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000",
"system-test": "mocha build/system-test",
"fix": "gts fix",
"test-no-cover": "mocha test/*.js",
"test": "nyc mocha",
"fix": "eslint --fix '**/*.js'",
"docs-test": "linkinator docs",
"predocs-test": "npm run docs",
"prelint": "cd samples; npm link ../; npm i"
"prelint": "cd samples; npm link ../; npm i",
"clean": "gts clean",
"compile": "tsc -p . && cp -r protos build/",
"compile-protos": "compileProtos src",
"prepare": "npm run compile"
},
"dependencies": {
"@google-cloud/promisify": "^1.0.0",
"google-gax": "^1.7.5",
"is": "^3.2.1"
"@google-cloud/promisify": "^1.0.4",
"google-gax": "^1.14.1",
"is": "^3.3.0"
},
"devDependencies": {
"@google-cloud/storage": "^4.0.0",
"codecov": "^3.0.2",
"eslint": "^6.0.0",
"eslint-config-prettier": "^6.0.0",
"@types/mocha": "^7.0.1",
"@types/node": "^13.7.4",
"@types/is": "0.0.21",
"@types/sinon": "^7.5.1",
"@types/uuid": "^3.4.7",
"c8": "^7.1.0",
"@google-cloud/storage": "^4.3.1",
"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",
"jsdoc": "^3.6.2",
"jsdoc-fresh": "^1.0.1",
"jsdoc-region-tag": "^1.0.2",
"linkinator": "^2.0.0",
"mocha": "^7.0.0",
"nyc": "^14.0.0",
"prettier": "^1.13.6",
"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",
"mocha": "^7.0.1",
"prettier": "^1.19.1",
"sinon": "^9.0.0",
"uuid": "^7.0.0"
"uuid": "^3.4.0",
"null-loader": "^3.0.0",
"pack-n-play": "^1.0.0-2",
"ts-loader": "^6.2.1",
"typescript": "^3.7.0",
"webpack": "^4.41.6",
"webpack-cli": "^3.3.11"
}
}
Original file line number Diff line number Diff line change
@@ -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}"
};

Loading

0 comments on commit 5d00684

Please sign in to comment.