Skip to content

Commit 5a56b98

Browse files
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.
1 parent f3e0044 commit 5a56b98

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

packages/google-cloud-oslogin/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"test": "c8 mocha build/test",
3333
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
3434
"system-test": "mocha build/system-test",
35-
"lint": "gts fix",
35+
"lint": "gts check",
3636
"fix": "gts fix",
3737
"docs": "jsdoc -c .jsdoc.js",
3838
"docs-test": "linkinator docs",
@@ -41,7 +41,8 @@
4141
"compile": "tsc -p . && cp -r protos build/",
4242
"compile-protos": "compileProtos src",
4343
"prepare": "npm run compile",
44-
"prelint": "cd samples; npm link ../; npm install"
44+
"prelint": "cd samples; npm link ../; npm install",
45+
"precompile": "gts clean"
4546
},
4647
"dependencies": {
4748
"google-gax": "^2.1.0"

packages/google-cloud-oslogin/synth.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
import synthtool as s
1818
import synthtool.gcp as gcp
19+
import synthtool.languages.node as node
1920
import logging
20-
import subprocess
2121

2222
logging.basicConfig(level=logging.DEBUG)
2323

@@ -48,7 +48,4 @@
4848
templates = common_templates.node_library(source_location='build/src')
4949
s.copy(templates)
5050

51-
# Node.js specific cleanup
52-
subprocess.run(['npm', 'install'])
53-
subprocess.run(['npm', 'run', 'fix'])
54-
subprocess.run(['npx', 'compileProtos', 'src'])
51+
node.postprocess_gapic_library()

0 commit comments

Comments
 (0)