From c1baa8fb4834b76991f41d046684efae2c98cda3 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 5 May 2020 17:27:24 -0700 Subject: [PATCH] chore: update npm scripts and synth.py (#269) Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool. Co-authored-by: Benjamin E. Coe --- packages/google-cloud-securitycenter/package.json | 5 +++-- packages/google-cloud-securitycenter/synth.py | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 6996ee694e5..b5c658f165a 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -19,13 +19,14 @@ "docs": "jsdoc -c .jsdoc.js", "docs-test": "linkinator docs", "fix": "gts fix", - "lint": "gts fix", + "lint": "gts check", "predocs-test": "npm run docs", "prepare": "npm run compile", "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "prelint": "cd samples; npm link ../; npm install" + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" }, "keywords": [ "google apis client", diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index cc29c3de6af..9d7b0f68f8b 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -14,7 +14,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) @@ -47,7 +47,4 @@ templates = common_templates.node_library(source_location='build/src') s.copy(templates, excludes=['.kokoro/samples-test.sh', '.kokoro/samples-test.sh']) -# Node.js specific cleanup -subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) -subprocess.run(['npx', 'compileProtos', 'src']) +node.postprocess_gapic_library()