From 5a56b98ab51cc5a0de959868ab9ffe8a70ee1e25 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 23 Apr 2020 19:32:08 -0700 Subject: [PATCH] chore: update npm scripts and synth.py (#341) 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-oslogin/package.json | 5 +++-- packages/google-cloud-oslogin/synth.py | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-oslogin/package.json b/packages/google-cloud-oslogin/package.json index 386655a3d22e..456fd1e3072b 100644 --- a/packages/google-cloud-oslogin/package.json +++ b/packages/google-cloud-oslogin/package.json @@ -32,7 +32,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", @@ -41,7 +41,8 @@ "compile": "tsc -p . && cp -r protos build/", "compile-protos": "compileProtos src", "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-oslogin/synth.py b/packages/google-cloud-oslogin/synth.py index 7e4ca77bf25f..95c52999f7da 100644 --- a/packages/google-cloud-oslogin/synth.py +++ b/packages/google-cloud-oslogin/synth.py @@ -16,8 +16,8 @@ import synthtool as s import synthtool.gcp as gcp +import synthtool.languages.node as node import logging -import subprocess logging.basicConfig(level=logging.DEBUG) @@ -48,7 +48,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()