Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

Commit 11051db

Browse files
xiaozhenliu-gg5alexander-fenster
authored andcommitted
feat: move to typescript code generation (#87)
* move code to typescript * run synthtool * fix test * add index.ts to src * lint
1 parent db5f16b commit 11051db

25 files changed

+2055
-2479
lines changed

.jsdoc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
source: {
3333
excludePattern: '(^|\\/|\\\\)[._]',
3434
include: [
35-
'src'
35+
'build/src'
3636
],
3737
includePattern: '\\.js$'
3838
},

package.json

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"version": "1.4.0",
55
"author": "Google LLC",
66
"description": "reCAPTCHA Enterprise API client for Node.js",
7-
"main": "src/index.js",
7+
"main": "build/src/index.js",
88
"files": [
9-
"protos",
10-
"src",
9+
"build/protos",
10+
"build/src",
1111
"AUTHORS",
1212
"COPYING"
1313
],
@@ -25,32 +25,45 @@
2525
"reCAPTCHA Enterprise API"
2626
],
2727
"dependencies": {
28-
"google-gax": "^1.7.5"
28+
"google-gax": "^1.9.0"
2929
},
3030
"devDependencies": {
31+
"@types/mocha": "^5.2.5",
32+
"@types/node": "^12.0.0",
33+
"c8": "^6.0.0",
3134
"eslint": "^6.0.0",
3235
"eslint-config-prettier": "^6.0.0",
3336
"eslint-plugin-node": "^10.0.0",
3437
"eslint-plugin-prettier": "^3.0.0",
38+
"gts": "^1.0.0",
39+
"intelli-espower-loader": "^1.0.1",
3540
"jsdoc": "^3.6.2",
3641
"jsdoc-fresh": "^1.0.1",
3742
"jsdoc-region-tag": "^1.0.2",
3843
"linkinator": "^1.5.0",
39-
"mocha": "^6.0.0",
40-
"nyc": "^14.1.1",
41-
"prettier": "^1.17.1"
44+
"mocha": "^6.1.4",
45+
"null-loader": "^3.0.0",
46+
"pack-n-play": "^1.0.0-2",
47+
"power-assert": "^1.4.4",
48+
"prettier": "^1.17.1",
49+
"ts-loader": "^6.2.1",
50+
"typescript": "^3.7.0",
51+
"webpack": "^4.41.2",
52+
"webpack-cli": "^3.3.10"
4253
},
4354
"scripts": {
44-
"cover": "nyc --reporter=lcov mocha test/*.js && nyc report",
55+
"lint": "gts fix && eslint --fix samples/*.js",
56+
"fix": "gts fix",
57+
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
58+
"system-test": "mocha build/system-test",
4559
"docs": "jsdoc -c .jsdoc.js",
46-
"lint": "eslint '**/*.js'",
47-
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
48-
"system-test": "mocha system-test/*.js --timeout 600000",
49-
"test-no-cover": "mocha test/*.js",
50-
"test": "npm run cover",
51-
"fix": "eslint --fix '**/*.js'",
60+
"test": "c8 mocha build/test",
5261
"docs-test": "linkinator docs",
53-
"predocs-test": "npm run docs"
62+
"clean": "gts clean",
63+
"compile": "tsc -p . && cp -r protos build/",
64+
"compile-protos": "compileProtos src",
65+
"predocs-test": "npm run docs",
66+
"prepare": "npm run compile"
5467
},
5568
"license": "Apache-2.0",
5669
"engines": {
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Copyright 2019 Google LLC.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// This file contains stub messages for common resources in GCP.
16+
// It is not intended to be directly generated, and is instead used by
17+
// other tooling to be able to match common resource patterns.
18+
syntax = "proto3";
19+
20+
package google.cloud;
21+
22+
import "google/api/resource.proto";
23+
24+
25+
option (google.api.resource_definition) = {
26+
type: "cloudresourcemanager.googleapis.com/Project"
27+
pattern: "projects/{project}"
28+
};
29+
30+
31+
option (google.api.resource_definition) = {
32+
type: "cloudresourcemanager.googleapis.com/Organization"
33+
pattern: "organizations/{organization}"
34+
};
35+
36+
37+
option (google.api.resource_definition) = {
38+
type: "cloudresourcemanager.googleapis.com/Folder"
39+
pattern: "folders/{folder}"
40+
};
41+
42+
43+
option (google.api.resource_definition) = {
44+
type: "cloudbilling.googleapis.com/BillingAccount"
45+
pattern: "billingAccounts/{billing_account}"
46+
};
47+
48+
option (google.api.resource_definition) = {
49+
type: "locations.googleapis.com/Location"
50+
pattern: "projects/{project}/locations/{location}"
51+
};
52+

src/index.js

Lines changed: 0 additions & 82 deletions
This file was deleted.

src/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2019 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// ** This file is automatically generated by gapic-generator-typescript. **
16+
// ** https://github.com/googleapis/gapic-generator-typescript **
17+
// ** All changes to this file may be overwritten. **
18+
19+
import * as v1beta1 from './v1beta1';
20+
const RecaptchaEnterpriseServiceV1Beta1Client =
21+
v1beta1.RecaptchaEnterpriseServiceV1Beta1Client;
22+
export {v1beta1, RecaptchaEnterpriseServiceV1Beta1Client};
23+
// For compatibility with JavaScript libraries we need to provide this default export:
24+
// tslint:disable-next-line no-default-export
25+
export default {v1beta1, RecaptchaEnterpriseServiceV1Beta1Client};

0 commit comments

Comments
 (0)