-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(material-luxon-adapter): error when added through ng add
Currently adding the `@angular/material-luxon-adapter` module through `ng add` results in an error because it doesn't have an `ng add` schematic. These changes add a blank one so users don't get an error now and so that we can easily add more functionality in the future.
- Loading branch information
Showing
6 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,5 +26,6 @@ | |
"@angular/material-luxon-adapter" | ||
] | ||
}, | ||
"schematics": "./schematics/collection.json", | ||
"sideEffects": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin") | ||
load("//tools:defaults.bzl", "pkg_npm", "ts_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
copy_to_bin( | ||
name = "schematics_assets", | ||
srcs = glob(["**/*.json"]), | ||
) | ||
|
||
ts_library( | ||
name = "schematics", | ||
srcs = glob( | ||
["**/*.ts"], | ||
exclude = ["**/*.spec.ts"], | ||
), | ||
# Schematics can not yet run in ESM module. For now we continue to use CommonJS. | ||
# TODO(ESM): remove this once the Angular CLI supports ESM schematics. | ||
devmode_module = "commonjs", | ||
prodmode_module = "commonjs", | ||
deps = [ | ||
"@npm//@angular-devkit/schematics", | ||
"@npm//@types/node", | ||
], | ||
) | ||
|
||
# This package is intended to be combined into the main @angular/material-luxon-adapter package as a dep. | ||
pkg_npm( | ||
name = "npm_package", | ||
deps = [ | ||
":schematics", | ||
":schematics_assets", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json", | ||
"schematics": { | ||
"ng-add": { | ||
"description": "Installs the Angular YouTube Player", | ||
"factory": "./ng-add/index", | ||
"hidden": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import {Rule} from '@angular-devkit/schematics'; | ||
|
||
export default function (): Rule { | ||
// Noop schematic so the CLI doesn't throw if users try to `ng add` this package. | ||
// Also allows us to add more functionality in the future. | ||
return () => {}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"type": "commonjs" | ||
} |