Skip to content

Commit

Permalink
feat: convert to TypeScript (#236)
Browse files Browse the repository at this point in the history
* setup

* add comment

* fix: make stuff work

* fix: pagination

* chore: formatting

* fix: pr feedback

* fix: run synthtool

* fix: run synthtool one last time
  • Loading branch information
xiaozhenliu-gg5 authored and alexander-fenster committed Nov 22, 2019
1 parent 4400e6e commit 367ac45
Show file tree
Hide file tree
Showing 39 changed files with 4,034 additions and 7,399 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-redis/.jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
source: {
excludePattern: '(^|\\/|\\\\)[._]',
include: [
'src'
'build/src'
],
includePattern: '\\.js$'
},
Expand Down
42 changes: 27 additions & 15 deletions packages/google-cloud-redis/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-redis",
"main": "src/index.js",
"main": "build/src/index.js",
"files": [
"protos",
"src"
"build/protos",
"build/src"
],
"keywords": [
"google apis client",
Expand All @@ -27,33 +27,45 @@
"Google Cloud Memorystore for Redis API"
],
"scripts": {
"test": "mocha",
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
"lint": "eslint '**/*.js'",
"test": "c8 mocha build/test",
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
"system-test": "c8 mocha build/system-test",
"docs": "jsdoc -c .jsdoc.js",
"system-test": "mocha system-test/ --timeout 600000",
"fix": "eslint --fix '**/*.js'",
"lint": "gts fix && eslint samples/*.js samples/**/*.js",
"fix": "gts fix && eslint --fix samples/*.js samples/**/*.js",
"docs-test": "linkinator docs",
"predocs-test": "npm run docs"
"compile": "tsc -p . && cp -r protos build/",
"compile-protos": "compileProtos src",
"predocs-test": "npm run docs",
"prepare": "npm run compile",
"pretest": "npm run compile"
},
"dependencies": {
"google-gax": "^1.7.5",
"protobufjs": "^6.8.8"
"google-gax": "^1.11.1"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
"@types/node": "^12.0.0",
"c8": "^6.0.0",
"codecov": "^3.1.0",
"eslint": "^6.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-prettier": "^3.0.0",
"gts": "^1.0.0",
"intelli-espower-loader": "^1.0.1",
"jsdoc": "^3.6.2",
"jsdoc": "^3.5.5",
"jsdoc-fresh": "^1.0.1",
"jsdoc-region-tag": "^1.0.2",
"linkinator": "^1.5.0",
"mocha": "^6.0.0",
"nyc": "^14.0.0",
"mocha": "^6.1.4",
"null-loader": "^3.0.0",
"pack-n-play": "^1.0.0-2",
"power-assert": "^1.6.0",
"prettier": "^1.14.2"
"prettier": "^1.11.1",
"ts-loader": "^6.2.1",
"typescript": "~3.7.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// 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";


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

string name = 1;
}

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

string name = 1;
}

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

string name = 1;
}

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

string name = 1;
}

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

string name = 1;
}
3 changes: 2 additions & 1 deletion packages/google-cloud-redis/samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
"repository": "googleapis/nodejs-redis",
"private": true,
"scripts": {
"test": "mocha system-test"
"test": "c8 mocha system-test"
},
"dependencies": {
"@google-cloud/redis": "^1.3.2"
},
"devDependencies": {
"c8": "^6.0.0",
"mocha": "^6.0.0"
}
}
102 changes: 0 additions & 102 deletions packages/google-cloud-redis/src/index.js

This file was deleted.

26 changes: 26 additions & 0 deletions packages/google-cloud-redis/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// 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. **

import * as v1beta1 from './v1beta1';
import * as v1 from './v1';

const CloudRedisClient = v1.CloudRedisClient;
export {v1, v1beta1, CloudRedisClient};
// For compatibility with JavaScript libraries we need to provide this default export:
// tslint:disable-next-line no-default-export
export default {v1, v1beta1, CloudRedisClient};
Loading

0 comments on commit 367ac45

Please sign in to comment.