From 3c319279c71699b6117ec466f31dae5f61feee93 Mon Sep 17 00:00:00 2001 From: Jason Hodges Date: Wed, 26 Apr 2017 13:41:31 -0600 Subject: [PATCH] feat($app): initial commit initial creation and commit post update from ng2-gist to work with Angular 4 --- .npmignore | 2 +- README.md | 20 +++++++-------- index.d.ts | 2 +- index.js | 2 +- package.json | 25 ++++++++++--------- ...ist.component.ts => ngx-gist.component.ts} | 4 +-- src/tsconfig.json | 15 ++++++++--- 7 files changed, 39 insertions(+), 31 deletions(-) rename src/{ng2-gist.component.ts => ngx-gist.component.ts} (92%) diff --git a/.npmignore b/.npmignore index 481a356..cb1ca29 100644 --- a/.npmignore +++ b/.npmignore @@ -10,5 +10,5 @@ Thumbs.db *.ts !*.d.ts -examples +docs src \ No newline at end of file diff --git a/README.md b/README.md index 13a69b2..e8f5b9e 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -# ng2-gist -Angular 2 Component for embedding a gist within an Angular site +# ng-gist +Angular 4 Component for embedding a gist within an Angular site -[![Build Status](https://travis-ci.org/jasonhodges/ng2-gist.svg?branch=master)](https://travis-ci.org/jasonhodges/ng2-gist) +[![Build Status](https://travis-ci.org/jasonhodges/ng-gist.svg?branch=master)](https://travis-ci.org/jasonhodges/ng-gist) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) ## Code Example -In order to use the component in your Angular 2 project after installation, follow these steps: +In order to use the component in your Angular 4 project after installation, follow these steps: -- Declare `ng2Gist` within app.module.ts +- Declare `ngGist` within app.module.ts ```@NgModule({ declarations: [ AppComponent, - ng2Gist + ngGist ], imports: [ BrowserModule, @@ -26,17 +26,17 @@ In order to use the component in your Angular 2 project after installation, foll }) export class AppModule { } ``` -- Use the `ng2-gist` component in any template files by using the `ng2-gist` tag along with username and gistId +- Use the `ng-gist` component in any template files by using the `ng-gist` tag along with username and gistId ```html - + ``` ## Motivation -This project was initiated after a search for an Angular 2 component of its kind returned no results. +This project was initiated after a search for an Angular 4 component of its kind returned no results. ## Installation -`npm i --save ng2-gist` +`npm i --save ng-gist` ## Contributors diff --git a/index.d.ts b/index.d.ts index 0e46e7b..2a16f78 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1 +1 @@ -export * from './lib/ng2-gist.component'; \ No newline at end of file +export * from './lib/ngx-gist.component'; \ No newline at end of file diff --git a/index.js b/index.js index faab0b8..9188953 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -exports.ng2Gist = require('./lib/ng2-gist.component').ng2Gist; \ No newline at end of file +exports.ngxGist = require('./lib/ngx-gist.component').ngxGist; \ No newline at end of file diff --git a/package.json b/package.json index 74aff89..8953093 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "ng2-gist", + "name": "ngx-gist", "version": "1.0.0", - "description": "Angular 2 Component for embedding a gist within an Angular site", - "main": "bundles/ng2-gist.umd.js", + "description": "Angular 4 Component for embedding a gist within an Angular site", + "main": "bundles/ngx-gist.umd.js", "module": "index.js", "scripts": { "semantic-release": "semantic-release pre && npm publish && semantic-release post", @@ -12,29 +12,30 @@ "typings": "./index.d.ts", "repository": { "type": "git", - "url": "https://github.com/jasonhodges/ng2-gist.git" + "url": "https://github.com/jasonhodges/ngx-gist.git" }, "keywords": [ - "angular2", + "angular", + "angular 4", "typescript", "gist", - "angular2-gist" + "ngx-gist" ], "author": "Jason Hodges ", "license": "MIT", "bugs": { - "url": "https://github.com/jasonhodges/ng2-gist/issues" + "url": "https://github.com/jasonhodges/ngx-gist/issues" }, - "homepage": "https://github.com/jasonhodges/ng2-gist#readme", + "homepage": "https://github.com/jasonhodges/ngx-gist#readme", "devDependencies": { "typescript": "^2.1.4", "webpack": "^1.14.0" }, "dependencies": { - "@angular/common": "^2.4.2", - "@angular/compiler": "^2.4.2", - "@angular/core": "^2.4.2", + "@angular/common": "^4.0.3", + "@angular/compiler": "^4.0.3", + "@angular/core": "^4.0.3", "rxjs": "^5.0.3", - "zone.js": "^0.7.4" + "zone.js": "^0.8.9" } } diff --git a/src/ng2-gist.component.ts b/src/ngx-gist.component.ts similarity index 92% rename from src/ng2-gist.component.ts rename to src/ngx-gist.component.ts index 70ad2f9..a760d2e 100644 --- a/src/ng2-gist.component.ts +++ b/src/ngx-gist.component.ts @@ -1,14 +1,14 @@ import {Component, Input, ViewChild, ElementRef, AfterViewInit} from '@angular/core'; @Component({ - selector: 'ng2-gist', + selector: 'ngx-gist', template:` `, styleUrls: [] }) -export class ng2Gist implements AfterViewInit { +export class ngxGist implements AfterViewInit { @ViewChild('iframe') iframe:ElementRef; @Input() gistId; diff --git a/src/tsconfig.json b/src/tsconfig.json index 34ac213..fdb8e12 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -2,15 +2,22 @@ "compilerOptions": { "emitDecoratorMetadata": true, "experimentalDecorators": true, - "target": "es6", - "module": "commonjs", + "target": "es5", + "module": "es2015", "moduleResolution": "node", "removeComments": true, "sourceMap": true, "outDir": "../lib", - "declaration": true + "declaration": true, + "lib": ["es2015", "dom"] }, + "files": [ + "../src/ngx-gist.component.ts" + ], "exclude": [ "node_modules" - ] + ], + "angularCompilerOptions": { + "skipTemplateCodegen": true + } } \ No newline at end of file