Skip to content

Commit 368a3d2

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

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

handwritten/datastore/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@
3131
"docs-test": "linkinator docs",
3232
"fix": "gts fix",
3333
"prelint": "cd samples; npm link ../; npm install",
34-
"lint": "gts fix",
34+
"lint": "gts check",
3535
"prepare": "npm run compile",
3636
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
3737
"presystem-test": "npm run compile",
3838
"system-test": "mocha build/system-test --timeout 600000",
3939
"pretest": "npm run compile",
40-
"test": "c8 mocha build/test"
40+
"test": "c8 mocha build/test",
41+
"precompile": "gts clean"
4142
},
4243
"dependencies": {
4344
"@google-cloud/promisify": "^2.0.0",

handwritten/datastore/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

@@ -33,7 +33,4 @@
3333
templates = common_templates.node_library(source_location="build/src")
3434
s.copy(templates)
3535

36-
# Node.js specific cleanup
37-
subprocess.run(['npm', 'install'])
38-
subprocess.run(['npm', 'run', 'fix'])
39-
subprocess.run(['npx', 'compileProtos', 'src'])
36+
node.postprocess_gapic_library()

0 commit comments

Comments
 (0)