Skip to content

Commit eba3f10

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

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

packages/google-cloud-translate/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"scripts": {
3131
"docs": "jsdoc -c .jsdoc.js",
3232
"predocs": "npm run compile",
33-
"lint": "gts fix",
33+
"lint": "gts check",
3434
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
3535
"system-test": "mocha build/system-test --timeout 600000",
3636
"test": "c8 mocha build/test",
@@ -41,7 +41,9 @@
4141
"presystem-test": "npm run compile",
4242
"docs-test": "linkinator docs",
4343
"predocs-test": "npm run docs",
44-
"prelint": "cd samples; npm link ../; npm install"
44+
"prelint": "cd samples; npm link ../; npm install",
45+
"clean": "gts clean",
46+
"precompile": "gts clean"
4547
},
4648
"dependencies": {
4749
"@google-cloud/common": "^3.0.0",

packages/google-cloud-translate/synth.py

Lines changed: 2 additions & 5 deletions
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
# Run the gapic generator
2323
gapic = gcp.GAPICMicrogenerator()
@@ -43,7 +43,4 @@
4343
templates = common_templates.node_library(source_location='build/src')
4444
s.copy(templates, excludes=[])
4545

46-
# Node.js specific cleanup
47-
subprocess.run(["npm", "install"])
48-
subprocess.run(["npm", "run", "lint"])
49-
subprocess.run(["npx", "compileProtos", "src"])
46+
node.postprocess_gapic_library()

0 commit comments

Comments
 (0)