From 17cf704ac0651979d9ba18327dadc201bfb6e17a Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 23 Apr 2020 19:32:26 -0700 Subject: [PATCH] chore: update npm scripts and synth.py (#433) 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-videointelligence/package.json | 5 +++-- packages/google-cloud-videointelligence/synth.py | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-videointelligence/package.json b/packages/google-cloud-videointelligence/package.json index 36d962bca40..3e5085e967f 100644 --- a/packages/google-cloud-videointelligence/package.json +++ b/packages/google-cloud-videointelligence/package.json @@ -29,7 +29,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": "c8 mocha build/system-test --timeout 600000", "test": "c8 mocha build/test", @@ -40,7 +40,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-videointelligence/synth.py b/packages/google-cloud-videointelligence/synth.py index 9269b663e90..6d5bc6c7bc7 100644 --- a/packages/google-cloud-videointelligence/synth.py +++ b/packages/google-cloud-videointelligence/synth.py @@ -1,7 +1,7 @@ import synthtool as s import synthtool.gcp as gcp +import synthtool.languages.node as node import logging -import subprocess logging.basicConfig(level=logging.DEBUG) @@ -30,7 +30,4 @@ templates = common_templates.node_library(source_location='build/src') s.copy(templates) -# Node.js specific cleanup -subprocess.run(["npm", "install"]) -subprocess.run(["npm", "run", "lint"]) -subprocess.run(['npx', 'compileProtos', 'src']) +node.postprocess_gapic_library()