Creates a standard model for CLI commands provided by ng-dev. Allows for us to have any of the tools/scripts extend to be included in the ng-dev command, or be standalone using the same yargs parser. PR Close #36326
		
			
				
	
	
		
			45 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
 | |
| load("@npm_bazel_typescript//:index.bzl", "ts_library")
 | |
| 
 | |
| ts_library(
 | |
|     name = "cli",
 | |
|     srcs = [
 | |
|         "cli.ts",
 | |
|     ],
 | |
|     module_name = "@angular/dev-infra-private",
 | |
|     deps = [
 | |
|         "//dev-infra/commit-message",
 | |
|         "//dev-infra/pullapprove",
 | |
|         "//dev-infra/ts-circular-dependencies",
 | |
|         "//dev-infra/utils:config",
 | |
|         "@npm//@types/node",
 | |
|         "@npm//@types/yargs",
 | |
|         "@npm//yargs",
 | |
|     ],
 | |
| )
 | |
| 
 | |
| genrule(
 | |
|     name = "package-json",
 | |
|     srcs = [
 | |
|         "tmpl-package.json",
 | |
|         "//:package.json",
 | |
|     ],
 | |
|     outs = ["package.json"],
 | |
|     cmd = """
 | |
|         $(execpath //tools:inline-package-json-deps) $(execpath tmpl-package.json) \
 | |
|             $(execpath //:package.json) $@
 | |
|     """,
 | |
|     tools = ["//tools:inline-package-json-deps"],
 | |
| )
 | |
| 
 | |
| pkg_npm(
 | |
|     name = "npm_package",
 | |
|     visibility = ["//visibility:public"],
 | |
|     deps = [
 | |
|         ":cli",
 | |
|         ":package-json",
 | |
|         "//dev-infra/commit-message",
 | |
|         "//dev-infra/ts-circular-dependencies",
 | |
|     ],
 | |
| )
 |