From f20b6f52879de9594672bf9e865c724249b99a81 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 23 Apr 2020 19:29:12 -0700 Subject: [PATCH] chore: update npm scripts and synth.py (#339) Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool. --- packages/google-container/package.json | 5 +++-- packages/google-container/synth.py | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-container/package.json b/packages/google-container/package.json index 8a2649f1b3c..fa4bbdb6277 100644 --- a/packages/google-container/package.json +++ b/packages/google-container/package.json @@ -30,7 +30,7 @@ "test": "c8 mocha build/test", "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", "system-test": "mocha build/system-test", - "lint": "gts fix", + "lint": "gts check", "fix": "gts fix", "docs": "jsdoc -c .jsdoc.js", "docs-test": "linkinator docs", @@ -39,7 +39,8 @@ "compile-protos": "compileProtos src", "predocs-test": "npm run docs", "prepare": "npm run compile", - "prelint": "cd samples; npm link ../; npm install" + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" }, "dependencies": { "google-gax": "^2.1.0" diff --git a/packages/google-container/synth.py b/packages/google-container/synth.py index d2e0248c93b..b51dfa4e6fc 100644 --- a/packages/google-container/synth.py +++ b/packages/google-container/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) @@ -28,7 +28,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', 'fix']) -subprocess.run(['npm', 'run', 'compile-protos']) +node.postprocess_gapic_library()