Skip to content

Commit 2079b19

Browse files
alexander-fenstersofisl
authored andcommitted
chore: update npm scripts and synth.py (#458)
Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool.
1 parent dd08192 commit 2079b19

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

packages/google-cloud-language/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
],
3232
"scripts": {
3333
"docs": "jsdoc -c .jsdoc.js",
34-
"lint": "gts fix",
34+
"lint": "gts check",
3535
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
3636
"system-test": "mocha build/system-test",
3737
"test": "c8 mocha build/test",
@@ -42,7 +42,8 @@
4242
"compile-protos": "compileProtos src",
4343
"predocs-test": "npm run docs",
4444
"prepare": "npm run compile",
45-
"prelint": "cd samples; npm link ../; npm install"
45+
"prelint": "cd samples; npm link ../; npm install",
46+
"precompile": "gts clean"
4647
},
4748
"dependencies": {
4849
"google-gax": "^2.1.0"

packages/google-cloud-language/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', 'fix'])
36-
subprocess.run(['npx', 'compileProtos', 'src'])
33+
node.postprocess_gapic_library()

0 commit comments

Comments
 (0)