Skip to content

Commit de71591

Browse files
chore: update npm scripts and synth.py (#433)
Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool.
1 parent 158e393 commit de71591

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

packages/google-cloud-videointelligence/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
],
3030
"scripts": {
3131
"docs": "jsdoc -c .jsdoc.js",
32-
"lint": "gts fix",
32+
"lint": "gts check",
3333
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
3434
"system-test": "c8 mocha build/system-test --timeout 600000",
3535
"test": "c8 mocha build/test",
@@ -40,7 +40,8 @@
4040
"clean": "gts clean",
4141
"compile": "tsc -p . && cp -r protos build/",
4242
"compile-protos": "compileProtos src",
43-
"prepare": "npm run compile"
43+
"prepare": "npm run compile",
44+
"precompile": "gts clean"
4445
},
4546
"dependencies": {
4647
"google-gax": "^2.1.0"

packages/google-cloud-videointelligence/synth.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import synthtool as s
22
import synthtool.gcp as gcp
3+
import synthtool.languages.node as node
34
import logging
4-
import subprocess
55

66
logging.basicConfig(level=logging.DEBUG)
77

@@ -30,7 +30,4 @@
3030
templates = common_templates.node_library(source_location='build/src')
3131
s.copy(templates)
3232

33-
# Node.js specific cleanup
34-
subprocess.run(["npm", "install"])
35-
subprocess.run(["npm", "run", "lint"])
36-
subprocess.run(['npx', 'compileProtos', 'src'])
33+
node.postprocess_gapic_library()

0 commit comments

Comments
 (0)