From 8eeca1f16193825b5bf8f595c56e55eefef1c8d3 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 23 Apr 2020 19:31:30 -0700 Subject: [PATCH] chore: update npm scripts and synth.py (#426) Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool. --- packages/google-cloud-monitoring/package.json | 5 +++-- packages/google-cloud-monitoring/synth.py | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-monitoring/package.json b/packages/google-cloud-monitoring/package.json index be309b9e255..3a2f9fa56d8 100644 --- a/packages/google-cloud-monitoring/package.json +++ b/packages/google-cloud-monitoring/package.json @@ -28,7 +28,7 @@ ], "scripts": { "docs": "jsdoc -c .jsdoc.js", - "lint": "gts fix", + "lint": "gts check", "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", "system-test": "mocha build/system-test", "test": "c8 mocha build/test", @@ -39,7 +39,8 @@ "clean": "gts clean", "compile": "tsc -p . && cp -r protos build/", "compile-protos": "compileProtos src", - "prepare": "npm run compile" + "prepare": "npm run compile", + "precompile": "gts clean" }, "dependencies": { "google-gax": "^2.1.0" diff --git a/packages/google-cloud-monitoring/synth.py b/packages/google-cloud-monitoring/synth.py index cec6ebf5a0a..f3b5169b62e 100644 --- a/packages/google-cloud-monitoring/synth.py +++ b/packages/google-cloud-monitoring/synth.py @@ -16,7 +16,7 @@ import synthtool as s import synthtool.gcp as gcp -import subprocess +import synthtool.languages.node as node import logging logging.basicConfig(level=logging.DEBUG) @@ -43,6 +43,4 @@ templates = common_templates.node_library(source_location='build/src') s.copy(templates) -subprocess.run(["npm", "install"]) -subprocess.run(["npm", "run", "lint"]) -subprocess.run(['npx', 'compileProtos', 'src']) +node.postprocess_gapic_library()