Skip to content

Commit

Permalink
fix(charts-angular): update build toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
cal-smith committed Dec 11, 2019
1 parent 253c696 commit aa63925
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 21 deletions.
77 changes: 77 additions & 0 deletions packages/angular/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"charts-angular": {
"root": "",
"sourceRoot": "src",
"projectType": "library",
"prefix": "sc",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "./tsconfig.json",
"project": "./ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"tsConfig": "./tsconfig.spec.json"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"./tsconfig.json",
"./tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"charts-angular-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "charts-angular:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**/*"
]
}
}
}
}
},
"defaultProject": "charts-angular",
"schematics": {
"@schematics/angular:component": {
"prefix": "ibm",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": "ibm"
}
}
}
10 changes: 10 additions & 0 deletions packages/angular/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
"dest": "./dist",
"lib": {
"entryFile": "src/index.ts"
},
"whitelistedNonPeerDependencies": [
"@carbon/charts"
]
}
21 changes: 8 additions & 13 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"$schema": "../../node_modules/ng-packagr/package.schema.json",
"name": "@carbon/charts-angular",
"version": "0.22.0",
"description": "Carbon charting components for Angular",
"main": "index.js",
"scripts": {
"build": "ng-packagr -p package.json",
"build": "ng build",
"storybook": "start-storybook -p 9005 -c .storybook -s ./.storybook/assets",
"demo:build": "build-storybook -o demo/bundle --quiet",
"clean": "rm -rf dist demo/bundle"
Expand Down Expand Up @@ -50,8 +49,10 @@
"zone.js": "^0.8.29 || ^0.9.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.8.9",
"@angular-devkit/core": "0.8.9",
"@angular-devkit/build-angular": "0.13.0",
"@angular-devkit/build-ng-packagr": "0.13.0",
"@angular-devkit/core": "8.2.2",
"@angular/cli": "~7.3.9",
"@angular/animations": "7.2.15",
"@angular/common": "7.2.15",
"@angular/compiler": "7.2.15",
Expand All @@ -71,15 +72,9 @@
"rxjs": "6.3.3",
"tslint": "5.14.0",
"typescript": "3.2.2",
"zone.js": "0.8.29"
},
"ngPackage": {
"lib": {
"entryFile": "src/charts.module.ts"
},
"whitelistedNonPeerDependencies": [
"@carbon/charts"
]
"zone.js": "0.8.29",
"tsickle": "0.37.1",
"tslib": "1.10.0"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 0 additions & 3 deletions packages/angular/src/charts.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";

// BaseChart needs to be imported for ng-packagr to recognize it
import { BaseChart } from "./base-chart.component";

import { DonutChartComponent } from "./donut-chart.component";
import { PieChartComponent } from "./pie-chart.component";
import { SimpleBarChartComponent } from "./bar-chart-simple.component";
Expand All @@ -17,7 +15,6 @@ import { ScatterChartComponent } from "./scatter-chart.component";
CommonModule
],
declarations: [
// BaseChart needs to be imported for ng-packagr to recognize it
BaseChart,
DonutChartComponent,
PieChartComponent,
Expand Down
9 changes: 9 additions & 0 deletions packages/angular/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export * from "./base-chart.component";
export * from "./donut-chart.component";
export * from "./pie-chart.component";
export * from "./bar-chart-simple.component";
export * from "./bar-chart-grouped.component";
export * from "./bar-chart-stacked.component";
export * from "./line-chart.component";
export * from "./scatter-chart.component";
export * from "./charts.module";
26 changes: 21 additions & 5 deletions packages/angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,35 @@
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"outDir": "./dist",
"rootDir": "src",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"inlineSources": true,
"declaration": true,
"moduleResolution": "node",
"module": "es2015",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"experimentalDecorators": true,
"downlevelIteration": true,
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"./node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
},
"include": [
"src/**/*"
],
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
}
}

0 comments on commit aa63925

Please sign in to comment.