| 
									
										
										
										
											2019-04-19 08:37:01 +02:00
										 |  |  | # BEGIN-INTERNAL | 
					
						
							| 
									
										
										
										
											2019-10-25 01:13:43 -07:00
										 |  |  | load("@build_bazel_rules_nodejs//:index.bzl", "npm_package") | 
					
						
							| 
									
										
										
										
											2019-05-09 14:51:51 -07:00
										 |  |  | load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") | 
					
						
							| 
									
										
										
										
											2019-02-20 09:54:42 -08:00
										 |  |  | load("@npm_bazel_typescript//:index.bzl", "ts_library") | 
					
						
							| 
									
										
										
										
											2018-03-01 10:41:35 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ts_library( | 
					
						
							|  |  |  |     name = "lib", | 
					
						
							|  |  |  |     srcs = glob(["lib/*.ts"]), | 
					
						
							|  |  |  |     module_name = "ts-api-guardian", | 
					
						
							|  |  |  |     tsconfig = "//tools:tsconfig.json", | 
					
						
							|  |  |  |     visibility = ["//visibility:public"], | 
					
						
							| 
									
										
										
										
											2018-10-18 09:58:38 -07:00
										 |  |  |     deps = [ | 
					
						
							| 
									
										
										
										
											2019-04-09 18:08:13 -07:00
										 |  |  |         "@npm//@types/diff", | 
					
						
							|  |  |  |         "@npm//@types/minimist", | 
					
						
							|  |  |  |         "@npm//@types/node", | 
					
						
							| 
									
										
										
										
											2019-04-23 14:47:18 +02:00
										 |  |  |         "@npm//chalk", | 
					
						
							| 
									
										
										
										
											2019-04-09 18:08:13 -07:00
										 |  |  |         "@npm//diff", | 
					
						
							|  |  |  |         "@npm//minimist", | 
					
						
							|  |  |  |         "@npm//typescript", | 
					
						
							| 
									
										
										
										
											2018-10-18 09:58:38 -07:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2018-03-01 10:41:35 -08:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Copy Angular's license to govern ts-api-guardian as well. | 
					
						
							|  |  |  | # We use a genrule to put it in this package, so it will be in the right root directory. | 
					
						
							|  |  |  | genrule( | 
					
						
							|  |  |  |     name = "license", | 
					
						
							|  |  |  |     srcs = ["//:LICENSE"], | 
					
						
							|  |  |  |     outs = ["LICENSE"], | 
					
						
							|  |  |  |     cmd = "cp $< $@", | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | npm_package( | 
					
						
							|  |  |  |     name = "ts-api-guardian", | 
					
						
							|  |  |  |     srcs = [ | 
					
						
							| 
									
										
										
										
											2019-04-19 08:37:01 +02:00
										 |  |  |         "BUILD.bazel", | 
					
						
							| 
									
										
										
										
											2018-03-01 10:41:35 -08:00
										 |  |  |         "README.md", | 
					
						
							|  |  |  |         "bin/ts-api-guardian", | 
					
						
							| 
									
										
										
										
											2019-04-19 08:37:01 +02:00
										 |  |  |         "index.bzl", | 
					
						
							| 
									
										
										
										
											2018-03-01 10:41:35 -08:00
										 |  |  |         "package.json", | 
					
						
							|  |  |  |     ], | 
					
						
							| 
									
										
										
										
											2019-04-19 08:37:01 +02:00
										 |  |  |     replacements = { | 
					
						
							| 
									
										
										
										
											2019-04-23 14:47:18 +02:00
										 |  |  |         "@angular//tools/ts-api-guardian:bin": "@npm_ts_api_guardian//:bin", | 
					
						
							|  |  |  |         "@angular//tools/ts-api-guardian:lib": "@npm//ts-api-guardian", | 
					
						
							| 
									
										
										
										
											2019-04-19 08:37:01 +02:00
										 |  |  |         "angular/tools/ts-api-guardian/": "npm_ts_api_guardian/", | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2018-03-01 10:41:35 -08:00
										 |  |  |     deps = [ | 
					
						
							|  |  |  |         ":lib", | 
					
						
							|  |  |  |         ":license", | 
					
						
							|  |  |  |     ], | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #######################################3 | 
					
						
							|  |  |  | # Tests for this package | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ts_library( | 
					
						
							|  |  |  |     name = "test_lib", | 
					
						
							|  |  |  |     testonly = True, | 
					
						
							|  |  |  |     srcs = glob(["test/*.ts"]), | 
					
						
							| 
									
										
										
										
											2018-10-04 13:14:14 -07:00
										 |  |  |     tsconfig = "//tools:tsconfig-test", | 
					
						
							|  |  |  |     deps = [ | 
					
						
							|  |  |  |         ":lib", | 
					
						
							| 
									
										
										
										
											2019-04-09 18:08:13 -07:00
										 |  |  |         "@npm//@types/chai", | 
					
						
							|  |  |  |         "@npm//@types/jasmine", | 
					
						
							|  |  |  |         "@npm//@types/node", | 
					
						
							|  |  |  |         "@npm//chai", | 
					
						
							|  |  |  |         "@npm//jasmine", | 
					
						
							|  |  |  |         "@npm//typescript", | 
					
						
							| 
									
										
										
										
											2018-10-04 13:14:14 -07:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2018-03-01 10:41:35 -08:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | jasmine_node_test( | 
					
						
							|  |  |  |     name = "tests", | 
					
						
							|  |  |  |     srcs = [":test_lib"], | 
					
						
							|  |  |  |     bootstrap = ["angular/tools/ts-api-guardian/test/bootstrap.js"], | 
					
						
							|  |  |  |     data = glob([ | 
					
						
							|  |  |  |         "test/fixtures/*.ts", | 
					
						
							|  |  |  |         "test/fixtures/*.patch", | 
					
						
							|  |  |  |     ]) + [ | 
					
						
							|  |  |  |         ":ts-api-guardian", | 
					
						
							| 
									
										
										
										
											2018-10-29 21:25:00 +01:00
										 |  |  |         # TODO: remove this once the boostrap.js workaround has been removed. | 
					
						
							|  |  |  |         ":package.json", | 
					
						
							| 
									
										
										
										
											2018-03-01 10:41:35 -08:00
										 |  |  |     ], | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2019-04-19 08:37:01 +02:00
										 |  |  | # END-INTERNAL | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-23 19:12:00 +02:00
										 |  |  | filegroup( | 
					
						
							|  |  |  |     name = "bin", | 
					
						
							|  |  |  |     srcs = glob(["lib/*.js"]) + ["bin/ts-api-guardian"], | 
					
						
							| 
									
										
										
										
											2019-04-19 08:37:01 +02:00
										 |  |  |     visibility = ["//visibility:public"], | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2019-06-07 13:38:06 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Exported to be referenced as entry_point of the nodejs_binary | 
					
						
							|  |  |  | exports_files(["bin/ts-api-guardian"]) |