File tree Expand file tree Collapse file tree 7 files changed +65
-1
lines changed Expand file tree Collapse file tree 7 files changed +65
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ sass_binary(
38
38
ng_package (
39
39
name = "npm_package" ,
40
40
srcs = ["package.json" ],
41
+ nested_packages = ["//src/youtube-player/schematics:npm_package" ],
41
42
tags = ["release-package" ],
42
43
deps = [":youtube-player" ],
43
44
)
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ This component provides a simple Angular wrapper around the
5
5
File any bugs against the [ angular/components repo] ( https://github.com/angular/components/issues ) .
6
6
7
7
## Installation
8
- To install, run ` npm install @angular/youtube-player` .
8
+ To install, run ` ng add @angular/youtube-player` .
9
9
10
10
## Usage
11
11
Import the component either by adding the ` YouTubePlayerModule ` to your app or by importing
Original file line number Diff line number Diff line change 26
26
"rxjs" : " 0.0.0-RXJS"
27
27
},
28
28
"sideEffects" : false ,
29
+ "schematics" : " ./schematics/collection.json" ,
29
30
"ng-update" : {}
30
31
}
Original file line number Diff line number Diff line change
1
+ load ("@build_bazel_rules_nodejs//:index.bzl" , "copy_to_bin" )
2
+ load ("//tools:defaults.bzl" , "pkg_npm" , "ts_library" )
3
+
4
+ package (default_visibility = ["//visibility:public" ])
5
+
6
+ copy_to_bin (
7
+ name = "schematics_assets" ,
8
+ srcs = glob (["**/*.json" ]),
9
+ )
10
+
11
+ ts_library (
12
+ name = "schematics" ,
13
+ srcs = glob (
14
+ ["**/*.ts" ],
15
+ exclude = ["**/*.spec.ts" ],
16
+ ),
17
+ # Schematics can not yet run in ESM module. For now we continue to use CommonJS.
18
+ # TODO(ESM): remove this once the Angular CLI supports ESM schematics.
19
+ devmode_module = "commonjs" ,
20
+ prodmode_module = "commonjs" ,
21
+ deps = [
22
+ "@npm//@angular-devkit/schematics" ,
23
+ "@npm//@types/node" ,
24
+ ],
25
+ )
26
+
27
+ # This package is intended to be combined into the main @angular/youtube-player package as a dep.
28
+ pkg_npm (
29
+ name = "npm_package" ,
30
+ deps = [
31
+ ":schematics" ,
32
+ ":schematics_assets" ,
33
+ ],
34
+ )
Original file line number Diff line number Diff line change
1
+ {
2
+ "$schema" : " ../node_modules/@angular-devkit/schematics/collection-schema.json" ,
3
+ "schematics" : {
4
+ "ng-add" : {
5
+ "description" : " Installs the Angular YouTube Player" ,
6
+ "factory" : " ./ng-add/index" ,
7
+ "hidden" : true
8
+ }
9
+ }
10
+ }
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+
9
+ import { Rule } from '@angular-devkit/schematics' ;
10
+
11
+ export default function ( ) : Rule {
12
+ // Noop schematic so the CLI doesn't throw if users try to `ng add` this package.
13
+ // Also allows us to add more functionality in the future.
14
+ return ( ) => { } ;
15
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " commonjs"
3
+ }
You can’t perform that action at this time.
0 commit comments