Skip to content

Commit 59c2cd6

Browse files
JustinBeckwiththiyaguk09
authored andcommitted
refactor(ts): convert to typescript (googleapis#426)
1 parent 77fd2a6 commit 59c2cd6

40 files changed

Lines changed: 8332 additions & 271 deletions

handwritten/bigtable/.clang-format

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Language: JavaScript
2+
BasedOnStyle: Google
3+
ColumnLimit: 80

handwritten/bigtable/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
.coverage
44
.nyc_output
55
docs/
6-
out/
6+
.vscode
77
system-test/secrets.js
88
system-test/*key.json
99
*.lock
1010
package-lock.json
11+
build/
12+
__pycache__

handwritten/bigtable/.jsdoc.js

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

handwritten/bigtable/package.json

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"node": ">=6.0.0"
99
},
1010
"repository": "googleapis/nodejs-bigtable",
11-
"main": "./src/index.js",
11+
"main": "build/src/index.js",
1212
"files": [
13-
"protos",
14-
"src",
15-
"AUTHORS",
16-
"CONTRIBUTORS",
17-
"LICENSE"
13+
"build/protos",
14+
"build/proto",
15+
"build/src",
16+
"!**/*.d.ts",
17+
"!**/*.map"
1818
],
1919
"keywords": [
2020
"google apis client",
@@ -29,18 +29,22 @@
2929
"bigtable"
3030
],
3131
"scripts": {
32-
"cover": "nyc --reporter=lcov mocha test/*.js && nyc report",
3332
"docs": "jsdoc -c .jsdoc.js",
3433
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
35-
"test-no-cover": "mocha test/*.js",
36-
"test": "npm run cover",
34+
"test": "nyc mocha build/test",
3735
"generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json",
3836
"lint": "eslint '**/*.js'",
39-
"system-test": "mocha system-test/*.js --timeout 600000",
37+
"presystem-test": "npm run compile",
38+
"system-test": "mocha build/system-test --timeout 600000",
4039
"snippet-test": "mocha samples/document-snippets/tests/*.js --timeout 600000",
4140
"fix": "eslint --fix '**/*.js'",
4241
"docs-test": "linkinator docs -r --skip www.googleapis.com",
43-
"predocs-test": "npm run docs"
42+
"predocs-test": "npm run docs",
43+
"clean": "gts clean",
44+
"compile": "tsc -p . && cp -r src/v2 build/src/ && cp -r proto* build/ && cp test/*.js build/test",
45+
"prepare": "npm run compile",
46+
"pretest": "npm run compile",
47+
"proto": "mkdir -p proto && pbjs -t static-module -w commonjs -p protos google/bigtable/v2/bigtable.proto | pbts -o proto/bigtable.d.ts -"
4448
},
4549
"dependencies": {
4650
"@google-cloud/common-grpc": "^0.10.0",
@@ -67,22 +71,34 @@
6771
},
6872
"devDependencies": {
6973
"@google-cloud/nodejs-repo-tools": "^3.0.0",
74+
"@types/arrify": "^1.0.4",
75+
"@types/extend": "^3.0.1",
76+
"@types/is": "0.0.21",
77+
"@types/mocha": "^5.2.6",
78+
"@types/p-queue": "^3.0.0",
79+
"@types/proxyquire": "^1.3.28",
80+
"@types/sinon": "^7.0.7",
81+
"@types/through2": "^2.0.34",
82+
"@types/uuid": "^3.4.4",
7083
"codecov": "^3.0.0",
7184
"eslint": "^5.0.0",
7285
"eslint-config-prettier": "^4.0.0",
7386
"eslint-plugin-node": "^8.0.0",
7487
"eslint-plugin-prettier": "^3.0.0",
75-
"jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git",
88+
"gts": "^0.9.0",
7689
"intelli-espower-loader": "^1.0.1",
7790
"jsdoc": "^3.5.5",
91+
"jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git",
92+
"linkinator": "^1.1.2",
7893
"mocha": "^6.0.0",
7994
"nyc": "^13.0.0",
8095
"p-queue": "^3.0.0",
8196
"power-assert": "^1.4.4",
8297
"prettier": "^1.7.4",
8398
"proxyquire": "^2.0.0",
8499
"sinon": "^7.0.0",
85-
"uuid": "^3.0.1",
86-
"linkinator": "^1.1.2"
100+
"source-map-support": "^0.5.10",
101+
"typescript": "~3.1.0",
102+
"uuid": "^3.0.1"
87103
}
88104
}

0 commit comments

Comments
 (0)