@@ -47,10 +47,21 @@ def parse_args() -> argparse.Namespace:
4747
4848
4949def update_emitter (package_json_path : str , use_dev_package : bool ):
50- logging .info ("Update emitter-package.json" )
51- subprocess .check_call (["tsp-client" , "generate-config-files" , "--package-json" , package_json_path ], cwd = sdk_root )
52-
5350 if use_dev_package :
51+ # we cannot use "tsp-client generate-config-files" in dev mode, as this command also updates the lock file
52+ logging .info ("Update emitter-package.json" )
53+ subprocess .check_call (
54+ [
55+ "pwsh" ,
56+ "./eng/common/scripts/typespec/New-EmitterPackageJson.ps1" ,
57+ "-PackageJsonPath" ,
58+ package_json_path ,
59+ "-OutputDirectory" ,
60+ "eng" ,
61+ ],
62+ cwd = sdk_root ,
63+ )
64+
5465 # replace version with path to dev package
5566 dev_package_path = None
5667 typespec_extension_path = os .path .dirname (package_json_path )
@@ -70,8 +81,13 @@ def update_emitter(package_json_path: str, use_dev_package: bool):
7081 else :
7182 logging .error ("Failed to locate the dev package." )
7283
73- logging .info ("Update emitter-package-lock.json" )
74- subprocess .check_call (["tsp-client" , "generate-lock-file" ], cwd = sdk_root )
84+ logging .info ("Update emitter-package-lock.json" )
85+ subprocess .check_call (["tsp-client" , "generate-lock-file" ], cwd = sdk_root )
86+ else :
87+ logging .info ("Update emitter-package.json and emitter-package-lock.json" )
88+ subprocess .check_call (
89+ ["tsp-client" , "generate-config-files" , "--package-json" , package_json_path ], cwd = sdk_root
90+ )
7591
7692
7793def get_generated_folder_from_artifact (module_path : str , artifact : str , type : str ) -> str :
0 commit comments