-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(schematics): fix eva-icons schematic (#1380)
- Loading branch information
Showing
6 changed files
with
112 additions
and
26 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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* @license | ||
* Copyright Akveo. All Rights Reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*/ | ||
|
||
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics'; | ||
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; | ||
|
||
/** | ||
* This utils has to imported directly from the `/util/package`, not from the `/util/`. | ||
* Other utilities use `@angular/sdk/schematics` and `@schematics/angular` packages. | ||
* But these packages are not installed in this step. | ||
* */ | ||
import { | ||
addDependencyToPackageJson, | ||
getEvaIconsVersion, | ||
} from '../util/package'; | ||
|
||
/** | ||
* post-install schematics, install dependant packages | ||
* */ | ||
export default function (): Rule { | ||
return runPostInstallSchematics(); | ||
} | ||
|
||
/** | ||
* Add icons peer dependencies in package.json | ||
* */ | ||
function installDependantPeerDependencies(tree: Tree) { | ||
const evaIconsVersion = getEvaIconsVersion(); | ||
|
||
addDependencyToPackageJson(tree, 'eva-icons', evaIconsVersion); | ||
} | ||
|
||
/** | ||
* Runs `npm install` | ||
* */ | ||
function runPostInstallSchematics() { | ||
return (tree: Tree, context: SchematicContext) => { | ||
installDependantPeerDependencies(tree); | ||
|
||
context.addTask(new NodePackageInstallTask()); | ||
}; | ||
} |
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