From 43a05eb21c3a33aa43ed45d100252ae2b7e3fc6a Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 23 Apr 2020 19:34:06 -0700 Subject: [PATCH] chore: update npm scripts and synth.py (#439) 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-compute/package.json | 8 +++++--- packages/google-cloud-compute/synth.py | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-compute/package.json b/packages/google-cloud-compute/package.json index ca67ae5dc75..4912c3ea3bd 100644 --- a/packages/google-cloud-compute/package.json +++ b/packages/google-cloud-compute/package.json @@ -26,14 +26,16 @@ ], "scripts": { "docs": "jsdoc -c .jsdoc.js", - "lint": "eslint '**/*.js'", + "lint": "gts check", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha system-test/*.js --timeout 1200000", "test": "c8 mocha", - "fix": "eslint --fix '**/*.js'", + "fix": "gts fix", "docs-test": "linkinator docs", "predocs-test": "npm run docs", - "prelint": "cd samples; npm link ../; npm i" + "prelint": "cd samples; npm link ../; npm install", + "clean": "gts clean", + "precompile": "gts clean" }, "dependencies": { "@google-cloud/common": "^3.0.0", diff --git a/packages/google-cloud-compute/synth.py b/packages/google-cloud-compute/synth.py index c81951e75fd..55d07eb4d02 100644 --- a/packages/google-cloud-compute/synth.py +++ b/packages/google-cloud-compute/synth.py @@ -1,5 +1,6 @@ import synthtool as s import synthtool.gcp as gcp +import synthtool.languages.node as node import logging logging.basicConfig(level=logging.DEBUG) @@ -9,3 +10,5 @@ common_templates = gcp.CommonTemplates() templates = common_templates.node_library() s.copy(templates) +node.install() +node.fix()