Skip to content

Commit

Permalink
fix(package): improved the angular schematics support
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyNahas committed Nov 12, 2019
1 parent a1b4fbc commit 83e9ca5
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 158 deletions.
24 changes: 0 additions & 24 deletions projects/angular-material-extensions/select-country/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"build": "../../../node_modules/.bin/ng build @angular-material-extensions/select-country",
"build:schematics": "../../../node_modules/.bin/tsc -p tsconfig.schematics.json",
"resync:schematics": "rsync -a schematics/collection.json ../../../dist/angular-material-extensions/select-country/schematics/",
"postbuild": "npm run build:schematics && npm run resync:schematics",
"resync:readme": "rsync -a ../../../README.md ../../../dist/angular-material-extensions/select-country/",
"postbuild": "npm run build:schematics && resync:readme && npm run resync:schematics",
"postpublish": "PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag select-country_v$PACKAGE_VERSION && git push --tags"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function addPackageJsonDependencies(): Rule {
type: NodeDependencyType.Default, version: loadPackageVersionGracefully()
|| '1.0.0', name: '@angular-material-extensions/select-country'
},
{type: NodeDependencyType.Default, version: '^1.2.6', name: 'svg-country-flags'}
];

dependencies.forEach(dependency => {
Expand Down Expand Up @@ -87,7 +88,7 @@ export function getPackageVersionFromPackageJson(tree: Tree, name: string): stri
function addLibAssetsToAssets(options: any) {
return (host: Tree, context: SchematicContext) => {
const lib = '@angular-material-extensions/select-country';
const assetPath = 'node_modules/@angular-material-extensions/select-country/assets/';
const assetPath = 'node_modules/svg-country-flags/svg';

try {
const angularJsonFile = host.read('angular.json');
Expand All @@ -102,7 +103,7 @@ function addLibAssetsToAssets(options: any) {
assets.push({
glob: '**/*',
input: assetPath,
output: './assets/'
output: 'assets/svg-country-flags/svg'
});
host.overwrite('angular.json', JSON.stringify(angularJsonFileObject, null, 2));
context.logger.log('info', `✅️ Added "${lib}" icons to assets`);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": "tsconfig",
"lib": [
"es2018",
"dom"
Expand All @@ -15,7 +15,7 @@
"noUnusedParameters": true,
"noUnusedLocals": true,
"rootDir": "schematics",
"outDir": "../../dist/angular-material-extensions/select-country/schematics",
"outDir": "../../../dist/angular-material-extensions/select-country/schematics",
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"sourceMap": true,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 83e9ca5

Please sign in to comment.