Skip to content

Commit 762e221

Browse files
author
Umed Khudoiberdiev
committed
updated package name and dependencies
1 parent 5de65e7 commit 762e221

File tree

6 files changed

+145
-54
lines changed

6 files changed

+145
-54
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
# ng2-popover
1+
# ngx-popover
22

33
Simple popover control for your angular2 applications using bootstrap3. Does not depend of jquery.
44
If you don't want to use it without bootstrap - simply create proper css classes. Please star a project if you liked it,
55
or create an issue if you have problems with it.
66

77
see [DEMO](http://plnkr.co/edit/tmGQ43m3OGhn8uoAYWua?p=preview).
88

9-
![angular 2 popover](https://raw.githubusercontent.com/pleerock/ng2-popover/master/resources/popover-example.png)
9+
![angular 2 popover](https://raw.githubusercontent.com/pleerock/ngx-popover/master/resources/popover-example.png)
1010

1111
## Installation
1212

1313
1. Install npm module:
1414

15-
`npm install ng2-popover --save`
15+
`npm install ngx-popover --save`
1616

1717
2. If you are using system.js you may want to add this into `map` and `package` config:
1818

1919
```json
2020
{
2121
"map": {
22-
"ng2-popover": "node_modules/ng2-popover"
22+
"ngx-popover": "node_modules/ngx-popover"
2323
},
2424
"packages": {
25-
"ng2-popover": { "main": "index.js", "defaultExtension": "js" }
25+
"ngx-popover": { "main": "index.js", "defaultExtension": "js" }
2626
}
2727
}
2828
```
@@ -80,7 +80,7 @@ Example of usage with dynamic html content:
8080

8181
```typescript
8282
import {Component} from "@angular/core";
83-
import {PopoverModule} from "ng2-popover";
83+
import {PopoverModule} from "ngx-popover";
8484

8585
@Component({
8686
selector: "app",
@@ -161,5 +161,5 @@ export class AppModule {
161161
}
162162
```
163163

164-
Take a look on samples in [./sample](https://github.com/pleerock/ng2-popover/tree/master/sample) for more examples of
164+
Take a look on samples in [./sample](https://github.com/pleerock/ngx-popover/tree/master/sample) for more examples of
165165
usages.

gulpfile.ts

Lines changed: 107 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Gulpclass, Task, SequenceTask} from "gulpclass";
1+
import {Gulpclass, Task, SequenceTask, MergedTask} from "gulpclass";
22

33
const gulp = require("gulp");
44
const del = require("del");
@@ -8,6 +8,12 @@ const mocha = require("gulp-mocha");
88
const chai = require("chai");
99
const tslint = require("gulp-tslint");
1010
const stylish = require("tslint-stylish");
11+
const ts = require("gulp-typescript");
12+
const rename = require("gulp-rename");
13+
const file = require("gulp-file");
14+
const uglify = require("gulp-uglify");
15+
16+
const packageName = require("./package.json").name;
1117

1218
@Gulpclass()
1319
export class Gulpfile {
@@ -39,6 +45,102 @@ export class Gulpfile {
3945
// Packaging and Publishing tasks
4046
// -------------------------------------------------------------------------
4147

48+
/**
49+
* Compiles and compiles bundles.
50+
*/
51+
@MergedTask()
52+
compileBundles() {
53+
const amdTsProject = ts.createProject("tsconfig.json", {
54+
module: "amd",
55+
outFile: packageName + ".amd.js",
56+
typescript: require("typescript")
57+
});
58+
const systemTsProject = ts.createProject("tsconfig.json", {
59+
module: "system",
60+
outFile: packageName + ".system.js",
61+
typescript: require("typescript")
62+
});
63+
const amdPureTsProject = ts.createProject("tsconfig.json", {
64+
module: "amd",
65+
outFile: packageName + ".pure.amd.js",
66+
noEmitHelpers: true,
67+
noImplicitUseStrict: true,
68+
typescript: require("typescript")
69+
});
70+
const systemPureTsProject = ts.createProject("tsconfig.json", {
71+
module: "system",
72+
outFile: packageName + ".pure.system.js",
73+
noEmitHelpers: true,
74+
noImplicitUseStrict: true,
75+
typescript: require("typescript")
76+
});
77+
78+
return [
79+
gulp.src("build/bundle/**/*.ts")
80+
.pipe(amdTsProject()).js
81+
.pipe(gulp.dest("build/package")),
82+
83+
gulp.src("build/bundle/**/*.ts")
84+
.pipe(systemTsProject()).js
85+
.pipe(gulp.dest("build/package")),
86+
87+
gulp.src("build/bundle/**/*.ts")
88+
.pipe(amdPureTsProject()).js
89+
.pipe(gulp.dest("build/package")),
90+
91+
gulp.src("build/bundle/**/*.ts")
92+
.pipe(systemPureTsProject()).js
93+
.pipe(gulp.dest("build/package"))
94+
];
95+
}
96+
97+
/**
98+
* Copies all source files into destination folder in a correct structure to build bundles.
99+
*/
100+
@Task()
101+
bundleCopySources() {
102+
return gulp.src(["./src/**/*.ts"])
103+
.pipe(gulp.dest("./build/bundle/" + packageName));
104+
}
105+
106+
/**
107+
* Creates special main file for bundle build.
108+
*/
109+
@Task()
110+
bundleCopyMainFile() {
111+
return gulp.src("./package.json", { read: false })
112+
.pipe(file(packageName + ".ts", `export * from "./${packageName}/index";`))
113+
.pipe(gulp.dest("./build/bundle"));
114+
}
115+
116+
/**
117+
* Uglifys bundles.
118+
*/
119+
@MergedTask()
120+
uglify() {
121+
return [
122+
gulp.src(`./build/package/${packageName}.pure.amd.js`)
123+
.pipe(uglify())
124+
.pipe(rename(`${packageName}.pure.amd.min.js`))
125+
.pipe(gulp.dest("./build/package")),
126+
127+
gulp.src(`./build/package/${packageName}.pure.system.js`)
128+
.pipe(uglify())
129+
.pipe(rename(`${packageName}.pure.system.min.js`))
130+
.pipe(gulp.dest("./build/package")),
131+
132+
gulp.src(`./build/package/${packageName}.amd.js`)
133+
.pipe(uglify())
134+
.pipe(rename(`${packageName}.amd.min.js`))
135+
.pipe(gulp.dest("./build/package")),
136+
137+
gulp.src(`./build/package/${packageName}.system.js`)
138+
.pipe(uglify())
139+
.pipe(rename(`${packageName}.system.min.js`))
140+
.pipe(gulp.dest("./build/package")),
141+
];
142+
}
143+
42144
/**
43145
* Publishes a package to npm from ./build/package directory.
44146
*/
@@ -71,24 +173,17 @@ export class Gulpfile {
71173
.pipe(gulp.dest("./build/package"));
72174
}
73175

74-
/**
75-
* This task will copy typings.json file to the build package.
76-
*/
77-
@Task()
78-
copyTypingsFile() {
79-
return gulp.src("./typings.json")
80-
.pipe(gulp.dest("./build/package"));
81-
}
82-
83176
/**
84177
* Creates a package that can be published to npm.
85178
*/
86179
@SequenceTask()
87180
package() {
88181
return [
89182
"clean",
90-
"compile",
91-
["packagePreparePackageFile", "packageReadmeFile", "copyTypingsFile"]
183+
["bundleCopySources", "bundleCopyMainFile"],
184+
["compile", "compileBundles"],
185+
["uglify"],
186+
["packagePreparePackageFile", "packageReadmeFile"]
92187
];
93188
}
94189

package.json

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "ng2-popover",
3-
"version": "0.0.13",
2+
"name": "ngx-popover",
3+
"version": "0.0.16",
44
"description": "Simple popover control for your angular2 applications using bootstrap3.",
55
"license": "MIT",
66
"readmeFilename": "README.md",
@@ -11,10 +11,10 @@
1111
},
1212
"repository": {
1313
"type": "git",
14-
"url": "https://github.com/pleerock/ng2-popover.git"
14+
"url": "https://github.com/pleerock/ngx-popover.git"
1515
},
1616
"bugs": {
17-
"url": "https://github.com/pleerock/ng2-popover/issues"
17+
"url": "https://github.com/pleerock/ngx-popover/issues"
1818
},
1919
"tags": [
2020
"popover",
@@ -26,41 +26,39 @@
2626
"@angular/core": "^2.0.0"
2727
},
2828
"devDependencies": {
29-
"@angular/common": "^2.3.1",
30-
"@angular/compiler": "^2.3.1",
31-
"@angular/compiler-cli": "^2.3.1",
32-
"@angular/core": "^2.3.1",
33-
"@angular/forms": "^2.3.1",
34-
"@angular/platform-browser": "^2.3.1",
35-
"@angular/platform-browser-dynamic": "^2.3.1",
36-
"@angular/platform-server": "^2.0.1",
37-
"@types/assertion-error": "^1.0.30",
38-
"@types/chai": "^3.4.34",
39-
"@types/mocha": "^2.2.32",
40-
"@types/node": "^6.0.45",
29+
"@angular/common": "^2.4.3",
30+
"@angular/compiler": "^2.4.3",
31+
"@angular/compiler-cli": "^2.4.3",
32+
"@angular/core": "^2.4.3",
33+
"@angular/forms": "^2.4.3",
34+
"@angular/platform-browser": "^2.4.3",
35+
"@angular/platform-browser-dynamic": "^2.4.3",
36+
37+
"@types/node": "^7.0.0",
4138
"bootstrap": "^3.3.7",
4239
"chai": "^3.4.1",
4340
"del": "^2.2.2",
44-
"es6-promise": "^4.0.5",
45-
"es6-shim": "^0.35.1",
41+
"es6-shim": "^0.35.2",
4642
"gulp": "^3.9.0",
43+
"gulp-file": "^0.3.0",
4744
"gulp-mocha": "^3.0.1",
45+
"gulp-rename": "^1.2.2",
4846
"gulp-replace": "^0.5.4",
4947
"gulp-shell": "^0.5.1",
50-
"gulp-sourcemaps": "^1.7.3",
51-
"gulp-tslint": "^6.1.2",
52-
"gulp-typescript": "^3.0.2",
48+
"gulp-tslint": "^7.0.1",
49+
"gulp-typescript": "^3.1.4",
50+
"gulp-uglify": "^2.0.0",
5351
"gulpclass": "^0.1.1",
54-
"mocha": "^3.1.2",
55-
"reflect-metadata": "0.1.8",
56-
"rxjs": "^5.0.0-rc.4",
57-
"sinon": "^1.17.6",
52+
"mocha": "^3.2.0",
53+
"reflect-metadata": "0.1.9",
54+
"rxjs": "^5.0.3",
55+
"sinon": "^1.17.7",
5856
"sinon-chai": "^2.8.0",
59-
"systemjs": "0.19.39",
60-
"tslint": "^3.15.1",
57+
"systemjs": "0.19.42",
58+
"tslint": "^4.3.1",
6159
"tslint-stylish": "^2.1.0-beta",
62-
"typescript": "^2.0.10",
63-
"zone.js": "^0.7.2"
60+
"typescript": "^2.1.5",
61+
"zone.js": "^0.7.6"
6462
},
6563
"scripts": {
6664
"tsc": "ngc -p tsconfig-aot.json"

sample/sample1-simple-usage/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<head>
33
<meta>
44
<meta charset="UTF-8"/>
5-
<title>ng2-popover</title>
5+
<title>ngx-popover</title>
66
<link rel="stylesheet" href="../../node_modules/bootstrap/dist/css/bootstrap.css">
77

88
<script src="../../node_modules/es6-shim/es6-shim.min.js"></script>
@@ -12,7 +12,7 @@
1212

1313
<script>
1414
System.config({
15-
baseURL: "/ng2-popover/", // replace with your baseURL here
15+
baseURL: "/ngx-popover/", // replace with your baseURL here
1616
defaultJSExtensions: true,
1717
paths: {
1818
// paths serve as alias

tsconfig-aot.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"compilerOptions": {
33
"outDir": "build/package",
44
"target": "es5",
5+
"lib": ["es6", "dom"],
56
"module": "commonjs",
67
"moduleResolution": "node",
78
"emitDecoratorMetadata": true,

tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
"compilerOptions": {
44
"outDir": "build/es5",
55
"target": "es5",
6-
"lib": [
7-
"es6",
8-
"dom"
9-
],
6+
"lib": ["es6", "dom"],
107
"module": "commonjs",
118
"moduleResolution": "node",
129
"emitDecoratorMetadata": true,

0 commit comments

Comments
 (0)