Skip to content

Commit

Permalink
feat: move library to typescript code generation (#338)
Browse files Browse the repository at this point in the history
* move to typescript

* run synth tool

* rerun synthtool to pick up new timeout number

* clean package json

* rerun synth tool

* try eslintrc rules
  • Loading branch information
xiaozhenliu-gg5 authored Dec 19, 2019
1 parent a473ef0 commit 1bb99bd
Show file tree
Hide file tree
Showing 28 changed files with 2,256 additions and 5,324 deletions.
2 changes: 2 additions & 0 deletions packages/google-cloud-language/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ system-test/*key.json
*.lock
package-lock.json
__pycache__/
.DS_Store
build/
2 changes: 1 addition & 1 deletion packages/google-cloud-language/.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
3 changes: 1 addition & 2 deletions packages/google-cloud-language/linkinator.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"recurse": true,
"skip": [
"https://codecov.io/gh/googleapis/",
"www.googleapis.com",
"setEndpoint.js"
"www.googleapis.com"
]
}
41 changes: 26 additions & 15 deletions packages/google-cloud-language/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-language",
"main": "src/index.js",
"main": "build/src/index.js",
"files": [
"protos",
"src",
"build/protos",
"build/src",
"AUTHORS",
"CONTRIBUTORS",
"LICENSE"
Expand All @@ -30,34 +30,45 @@
"Google Cloud Natural Language API"
],
"scripts": {
"cover": "nyc --reporter=lcov mocha test/*.js && nyc report",
"docs": "jsdoc -c .jsdoc.js",
"lint": "eslint '**/*.js'",
"samples-test": "cd samples/ && npm test && cd ../",
"system-test": "mocha system-test/*.js --timeout 600000",
"test-no-cover": "mocha test/*.js",
"test": "npm run cover",
"fix": "eslint --fix '**/*.js'",
"lint": "gts fix && eslint --fix samples/*.js",
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
"system-test": "mocha build/system-test",
"test": "c8 mocha build/test",
"fix": "gts fix",
"docs-test": "linkinator docs",
"predocs-test": "npm run docs"
"clean": "gts clean",
"compile": "tsc -p . && cp -r protos build/",
"compile-protos": "compileProtos src",
"predocs-test": "npm run docs",
"prepare": "npm run compile"
},
"dependencies": {
"google-gax": "^1.7.5"
"google-gax": "^1.9.0"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
"@types/node": "^12.0.0",
"c8": "^6.0.0",
"codecov": "^3.0.2",
"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.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.13.5"
"prettier": "^1.11.1",
"ts-loader": "^6.2.1",
"typescript": "^3.7.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
}
}

This file was deleted.

98 changes: 0 additions & 98 deletions packages/google-cloud-language/src/index.js

This file was deleted.

26 changes: 26 additions & 0 deletions packages/google-cloud-language/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 v1beta2 from './v1beta2';
import * as v1 from './v1';

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

0 comments on commit 1bb99bd

Please sign in to comment.