diff --git a/packages/grpc-js-xds/.eslintrc.json b/packages/grpc-js-xds/.eslintrc.json new file mode 100644 index 00000000..f95bb333 --- /dev/null +++ b/packages/grpc-js-xds/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts/" +} diff --git a/packages/grpc-js-xds/.prettierrc.js b/packages/grpc-js-xds/.prettierrc.js new file mode 100644 index 00000000..c634ea72 --- /dev/null +++ b/packages/grpc-js-xds/.prettierrc.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('gts/.prettierrc.json') +} \ No newline at end of file diff --git a/packages/grpc-js-xds/package.json b/packages/grpc-js-xds/package.json new file mode 100644 index 00000000..f8d44cb0 --- /dev/null +++ b/packages/grpc-js-xds/package.json @@ -0,0 +1,41 @@ +{ + "name": "@grpc/grpc-js-xds", + "version": "1.0.0", + "description": "Plugin for @grpc/grpc-js. Adds the xds:// URL scheme and associated features.", + "main": "build/src/index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "check": "gts check", + "clean": "gts clean", + "compile": "tsc", + "fix": "gts fix", + "prepare": "npm run compile", + "pretest": "npm run compile", + "posttest": "npm run check" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/grpc/grpc-node.git" + }, + "keywords": [ + "grpc" + ], + "author": { + "name": "Google Inc." + }, + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/grpc/grpc-node/issues" + }, + "homepage": "https://github.com/grpc/grpc-node#readme", + "devDependencies": { + "gts": "^2.0.2", + "typescript": "^3.8.3", + "@types/node": "^13.11.1", + "yargs": "^15.4.1" + }, + "dependencies": { + "@grpc/proto-loader": "^0.6.0-pre14", + "google-auth-library": "^6.1.1" + } +} diff --git a/packages/grpc-js-xds/src/index.ts b/packages/grpc-js-xds/src/index.ts new file mode 100644 index 00000000..2c1da126 --- /dev/null +++ b/packages/grpc-js-xds/src/index.ts @@ -0,0 +1,24 @@ +console.log('Try npm run check/fix!'); + +const longString = + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut aliquet diam.'; + +const trailing = 'Semicolon'; + +const why = 'am I tabbed?'; + +export function doSomeStuff( + withThis: string, + andThat: string, + andThose: string[] +) { + //function on one line + if (!andThose.length) { + return false; + } + console.log(withThis); + console.log(andThat); + console.dir(andThose); + return; +} +// TODO: more examples diff --git a/packages/grpc-js-xds/tsconfig.json b/packages/grpc-js-xds/tsconfig.json new file mode 100644 index 00000000..d1646f01 --- /dev/null +++ b/packages/grpc-js-xds/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build" + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ] +} diff --git a/packages/grpc-js/package.json b/packages/grpc-js/package.json index b2804381..45c4cad4 100644 --- a/packages/grpc-js/package.json +++ b/packages/grpc-js/package.json @@ -58,9 +58,7 @@ "posttest": "npm run check" }, "dependencies": { - "@grpc/proto-loader": "^0.6.0-pre14", "@types/node": "^12.12.47", - "google-auth-library": "^5.10.1", "semver": "^6.2.0" }, "files": [