From ad1ecae5eb069e05e34f8660c6a4373c146b7a1c Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 23 Apr 2020 19:35:04 -0700 Subject: [PATCH] chore: update npm scripts and synth.py (#179) 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-datalabeling/package.json | 5 +++-- packages/google-cloud-datalabeling/synth.py | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-datalabeling/package.json b/packages/google-cloud-datalabeling/package.json index b9100be2139..ccb22c87157 100644 --- a/packages/google-cloud-datalabeling/package.json +++ b/packages/google-cloud-datalabeling/package.json @@ -31,7 +31,7 @@ "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", "system-test": "mocha build/system-test", "docs": "jsdoc -c .jsdoc.js", - "lint": "gts fix", + "lint": "gts check", "fix": "gts fix", "docs-test": "linkinator docs", "clean": "gts clean", @@ -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-cloud-datalabeling/synth.py b/packages/google-cloud-datalabeling/synth.py index eecde5c5b06..59bc321f36e 100644 --- a/packages/google-cloud-datalabeling/synth.py +++ b/packages/google-cloud-datalabeling/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) @@ -44,7 +44,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(['npx', 'compileProtos', 'src']) +node.postprocess_gapic_library()