code: def compile_ts(release):
      """
      Use npm to download dependencies and compile TypeScript code.
      """
      _print("Building NNI manager")
      _npm("ts/nni_manager", "install")
      _npm("ts/nni_manager", "run", "build")
      # todo: I don't think these should be here
      shutil.rmtree("ts/nni_manager/dist/config", ignore_errors=True)
      shutil.copytree(
          "ts/nni_manager/config", "ts/nni_manager/dist/config"
      )
  
      _print("Building web UI")
      _npm("ts/webui", "install")
      if release:
          _npm("ts/webui", "run", "release")
      else:
          _npm("ts/webui", "run", "build")
  
imports: from io import BytesIO
  import json
  import os
  from pathlib import Path
  import platform
  import shutil
  import subprocess
  import sys
  import tarfile
  import traceback
  from zipfile import ZipFile
label_desc: Use image node_id 8 for calling a global function with example usage: compile_ts(release) without return types