Skip to content

Commit

Permalink
feat(lib): Added support for AOT compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
kuuurt13 committed Feb 25, 2017
1 parent c7fe13b commit 524d976
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 32 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
node_modules
npm-debug.log
*.tgz
settings.json
*.tgz
*.metadata.json
/dist
/**/*.js
/**/*.js.map
3 changes: 1 addition & 2 deletions lib/components/block-ui.component.style.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export default
`
export const styles = `
.block-ui-wrapper {
position: absolute;
height: 100%;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export const template = `
<div class="block-ui-wrapper" [class]="'block-ui-wrapper ' + name" *ngIf="active">
<div class="block-ui-spinner">
<div class="loader"></div>
<div *ngIf="message" class="message">{{ message }}</div>
</div>
</div>
`;
5 changes: 3 additions & 2 deletions lib/components/block-ui.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import { Observable, Subscription } from 'rxjs';
import { BlockUIService } from '../services/block-ui.service';
import { BlockUIEvent } from '../models';
import { BlockUIActions, BlockUIDefaultName } from '../constants';
import styles from './block-ui.component.style';
import { styles } from './block-ui.component.style';
import { template } from './block-ui.component.template';

@Component({
selector: 'block-ui',
templateUrl: './block-ui.component.html',
template: template,
styles: [styles], // TODO: Find how to bundle styles for npm
encapsulation: ViewEncapsulation.None
})
Expand Down
2 changes: 1 addition & 1 deletion lib/constants/block-ui-default-name.constant.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const BlockUIDefaultName = 'block-ui-main'
export const BlockUIDefaultName: string = `block-ui-main`;
16 changes: 0 additions & 16 deletions lib/services/block-ui.service.spec.ts

This file was deleted.

22 changes: 17 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"name": "ng-block-ui",
"version": "0.1.1",
"description": "Angular (2 & up) Block UI",
"main": "index.ts",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"start": "webpack-dev-server --inline --progress --port 8080",
"build": "node_modules/.bin/ngc -p tsconfig.json",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand All @@ -23,6 +24,11 @@
"url": "https://github.com/kuuurt13/ng-block-ui/issues"
},
"homepage": "https://github.com/kuuurt13/ng-block-ui#readme",
"peerDependencies": {
"@angular/common": "^2.2.4",
"@angular/core": "^2.2.4",
"@angular/platform-browser": "^2.2.4"
},
"dependencies": {
"@angular/common": "^2.4.8",
"@angular/compiler": "^2.4.8",
Expand All @@ -36,8 +42,11 @@
"zone.js": "^0.7.7"
},
"devDependencies": {
"@types/node": "^6.0.45",
"@angular/compiler": "^2.4.8",
"@angular/compiler-cli": "^2.4.8",
"@angular/platform-server": "^2.4.8",
"@types/jasmine": "2.5.35",
"@types/node": "^6.0.45",
"angular2-template-loader": "^0.6.0",
"awesome-typescript-loader": "^3.0.0-beta.18",
"css-loader": "^0.26.1",
Expand All @@ -56,9 +65,12 @@
"raw-loader": "^0.5.1",
"rimraf": "^2.5.2",
"style-loader": "^0.13.1",
"typescript": "~2.0.10",
"typescript": "^2.2.1",
"webpack": "2.2.0",
"webpack-dev-server": "2.2.0-rc.0",
"webpack-merge": "^2.4.0"
}
},
"files": [
"dist"
]
}
28 changes: 23 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
{
"compilerOptions": {
"outDir": "dist",
"target": "es5",
"module": "commonjs",
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es2015", "dom"],
"sourceMap": false,
"noEmitHelpers": false,
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true
"declaration": true,
"skipLibCheck": true,
"stripInternal": true,
"lib": [
"es2015",
"dom"
]
},
"exclude": [
"node_modules",
"demo"
],
"files": [
"./index.ts"
],
"angularCompilerOptions": {
"genDir": "dist",
"skipTemplateCodegen": true
}
}
}

0 comments on commit 524d976

Please sign in to comment.