Skip to content

Commit

Permalink
fix(schematics): Don't fail if meta config already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
paviad committed Mar 20, 2019
1 parent 9e3dae1 commit ea647ad
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ng2-charts-schematics/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export function buildMetaConfig(_options: any): Rule {
_options.metaname = parsedPath.name;
_options.metapath = parsedPath.path;

const metaConfigExists = tree.exists('/src/app/app-chart-config.ts');

if (metaConfigExists) {
return tree;
}

const templateSource = apply(url('./files'), [
applyTemplates({
...strings,
Expand Down
8 changes: 1 addition & 7 deletions projects/ng2-charts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions projects/ng2-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"description": "Reactive, responsive, beautiful charts for Angular2 based on Chart.js",
"main": "src/public_api.ts",
"devDependencies": {
"@types/lodash": "^4.14.123",
"@types/node": "^11.11.3"
"@types/lodash": "^4.14.123"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
2 changes: 1 addition & 1 deletion projects/ng2-charts/src/lib/chartjs/angular-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ChartFontOptions } from './chart-font-options';
import { ChartTooltipsStaticConfiguration } from './chart-tooltips-static-configuration';
import { ChartArea } from './chart-area';

require('chart.js');
import 'chart.js';

declare class Chart {
// tslint:disable-next-line:variable-name
Expand Down
4 changes: 1 addition & 3 deletions projects/ng2-charts/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"types": [
"node"
],
"types": [],
"lib": [
"dom",
"es2018"
Expand Down

0 comments on commit ea647ad

Please sign in to comment.