import synthtool as s
import synthtool.gcp as gcp
import logging
import subprocess

logging.basicConfig(level=logging.DEBUG)

gapic = gcp.GAPICGenerator()

# tasks has two product names, and a poorly named artman yaml
for version in ['v1', 'v1beta2']:
    library = gapic.node_library(
        'language', version)

    # skip index, protos, package.json, and README.md
    s.copy(
        library,
        excludes=['package.json', 'README.md', 'src/index.js'])

#
# Node.js specific cleanup
#
subprocess.run(['npm', 'install'])
subprocess.run(['npm', 'run', 'prettier'])
subprocess.run(['npm', 'run', 'lint'])

@@ -457,18 +457,16 @@
 .js'%5D)%0A%0A
-#%0A
 # Node.j
@@ -488,10 +488,8 @@
 nup%0A
-#%0A
 subp
@@ -512,15 +512,10 @@
 ', '
+c
 i
-nstall
 '%5D)%0A

use `npm ci` instead of `npm install` (#76)