Skip to content
This repository has been archived by the owner on Nov 24, 2017. It is now read-only.

Commit

Permalink
updated package name and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Umed Khudoiberdiev committed Jan 18, 2017
1 parent c503b0f commit a26e11f
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 81 deletions.
12 changes: 6 additions & 6 deletions README.md
@@ -1,4 +1,4 @@
# ng2-dropdown
# ngx-dropdown

Simple dropdown for your angular2 applications using bootstrap3. Does not depend of jquery.
If you don't want to use it without bootstrap - simply create proper css classes.
Expand All @@ -8,17 +8,17 @@ Please star a project if you liked it, or create an issue if you have problems w

1. Install npm module:

`npm install ng2-dropdown --save`
`npm install ngx-dropdown --save`

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

```json
{
"map": {
"ng2-dropdown": "node_modules/ng2-dropdown"
"ngx-dropdown": "node_modules/ngx-dropdown"
},
"packages": {
"ng2-dropdown": { "main": "index.js", "defaultExtension": "js" }
"ngx-dropdown": { "main": "index.js", "defaultExtension": "js" }
}
}
```
Expand Down Expand Up @@ -49,7 +49,7 @@ Please star a project if you liked it, or create an issue if you have problems w

```typescript
import {Component} from "@angular/core";
import {DropdownModule} from "ng2-dropdown";
import {DropdownModule} from "ngx-dropdown";

@Component({
selector: "app",
Expand Down Expand Up @@ -116,5 +116,5 @@ export class AppModule {
platformBrowserDynamic().bootstrapModule(AppModule);
```

Take a look on samples in [./sample](https://github.com/pleerock/ng2-dropdown/tree/master/sample) for more examples of
Take a look on samples in [./sample](https://github.com/pleerock/ngx-dropdown/tree/master/sample) for more examples of
usages.
133 changes: 104 additions & 29 deletions gulpfile.ts
Expand Up @@ -9,7 +9,11 @@ const chai = require("chai");
const tslint = require("gulp-tslint");
const stylish = require("tslint-stylish");
const ts = require("gulp-typescript");
const sourcemaps = require("gulp-sourcemaps");
const rename = require("gulp-rename");
const file = require("gulp-file");
const uglify = require("gulp-uglify");

const packageName = require("./package.json").name;

@Gulpclass()
export class Gulpfile {
Expand Down Expand Up @@ -42,34 +46,112 @@ export class Gulpfile {
// -------------------------------------------------------------------------

/**
* Publishes a package to npm from ./build/package directory.
* Compiles and compiles bundles.
*/
@MergedTask()
compileBundles() {
const amdTsProject = ts.createProject("tsconfig.json", {
module: "amd",
outFile: packageName + ".amd.js",
typescript: require("typescript")
});
const systemTsProject = ts.createProject("tsconfig.json", {
module: "system",
outFile: packageName + ".system.js",
typescript: require("typescript")
});
const amdPureTsProject = ts.createProject("tsconfig.json", {
module: "amd",
outFile: packageName + ".pure.amd.js",
noEmitHelpers: true,
noImplicitUseStrict: true,
typescript: require("typescript")
});
const systemPureTsProject = ts.createProject("tsconfig.json", {
module: "system",
outFile: packageName + ".pure.system.js",
noEmitHelpers: true,
noImplicitUseStrict: true,
typescript: require("typescript")
});

return [
gulp.src("build/bundle/**/*.ts")
.pipe(amdTsProject()).js
.pipe(gulp.dest("build/package")),

gulp.src("build/bundle/**/*.ts")
.pipe(systemTsProject()).js
.pipe(gulp.dest("build/package")),

gulp.src("build/bundle/**/*.ts")
.pipe(amdPureTsProject()).js
.pipe(gulp.dest("build/package")),

gulp.src("build/bundle/**/*.ts")
.pipe(systemPureTsProject()).js
.pipe(gulp.dest("build/package"))
];
}

/**
* Copies all source files into destination folder in a correct structure to build bundles.
*/
@Task()
npmPublish() {
return gulp.src("package.json", { read: false })
.pipe(shell([
"cd ./build/package && npm publish"
]));
bundleCopySources() {
return gulp.src(["./src/**/*.ts"])
.pipe(gulp.dest("./build/bundle/" + packageName));
}

/**
* Copies all sources to the package directory.
* Creates special main file for bundle build.
*/
@MergedTask()
packageCompile() {
const tsProject = ts.createProject("tsconfig.json");
const tsResult = gulp.src(["./src/**/*.ts", "./typings/**/*.ts"])
.pipe(sourcemaps.init())
.pipe(ts(tsProject));
@Task()
bundleCopyMainFile() {
return gulp.src("./package.json", { read: false })
.pipe(file(packageName + ".ts", `export * from "./${packageName}/index";`))
.pipe(gulp.dest("./build/bundle"));
}

/**
* Uglifys bundles.
*/
@MergedTask()
uglify() {
return [
tsResult.dts.pipe(gulp.dest("./build/package")),
tsResult.js
.pipe(sourcemaps.write(".", { sourceRoot: "", includeContent: true }))
.pipe(gulp.dest("./build/package"))
gulp.src(`./build/package/${packageName}.pure.amd.js`)
.pipe(uglify())
.pipe(rename(`${packageName}.pure.amd.min.js`))
.pipe(gulp.dest("./build/package")),

gulp.src(`./build/package/${packageName}.pure.system.js`)
.pipe(uglify())
.pipe(rename(`${packageName}.pure.system.min.js`))
.pipe(gulp.dest("./build/package")),

gulp.src(`./build/package/${packageName}.amd.js`)
.pipe(uglify())
.pipe(rename(`${packageName}.amd.min.js`))
.pipe(gulp.dest("./build/package")),

gulp.src(`./build/package/${packageName}.system.js`)
.pipe(uglify())
.pipe(rename(`${packageName}.system.min.js`))
.pipe(gulp.dest("./build/package")),
];
}

/**
* Publishes a package to npm from ./build/package directory.
*/
@Task()
npmPublish() {
return gulp.src("package.json", { read: false })
.pipe(shell([
"cd ./build/package && npm publish"
]));
}

/**
* Change the "private" state of the packaged package.json file to public.
*/
Expand All @@ -91,24 +173,17 @@ export class Gulpfile {
.pipe(gulp.dest("./build/package"));
}

/**
* This task will copy typings.json file to the build package.
*/
@Task()
copyTypingsFile() {
return gulp.src("./typings.json")
.pipe(gulp.dest("./build/package"));
}

/**
* Creates a package that can be published to npm.
*/
@SequenceTask()
package() {
return [
"clean",
"compile",
["packagePreparePackageFile", "packageReadmeFile", "copyTypingsFile"]
["bundleCopySources", "bundleCopyMainFile"],
["compile", "compileBundles"],
["uglify"],
["packagePreparePackageFile", "packageReadmeFile"]
];
}

Expand Down
57 changes: 29 additions & 28 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "ng2-dropdown",
"version": "0.0.21",
"name": "ngx-dropdown",
"version": "0.0.22",
"description": "Simple dropdown for your angular2 applications using bootstrap3.",
"license": "MIT",
"readmeFilename": "README.md",
Expand All @@ -11,10 +11,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/pleerock/ng2-dropdown.git"
"url": "https://github.com/pleerock/ngx-dropdown.git"
},
"bugs": {
"url": "https://github.com/pleerock/ng2-dropdown/issues"
"url": "https://github.com/pleerock/ngx-dropdown/issues"
},
"tags": [
"dropdown",
Expand All @@ -27,37 +27,38 @@
"@angular/core": "^2.0.0"
},
"devDependencies": {
"@angular/common": "^2.2.0",
"@angular/compiler": "^2.2.0",
"@angular/core": "^2.2.0",
"@angular/platform-browser": "^2.2.0",
"@angular/platform-browser-dynamic": "^2.2.0",
"@angular/compiler-cli": "^2.2.3",
"@angular/platform-server": "^2.2.3",
"@types/node": "^6.0.42",
"bootstrap": "^3.3.6",
"@angular/common": "^2.4.3",
"@angular/compiler": "^2.4.3",
"@angular/compiler-cli": "^2.4.3",
"@angular/core": "^2.4.3",
"@angular/forms": "^2.4.3",
"@angular/platform-browser": "^2.4.3",
"@angular/platform-browser-dynamic": "^2.4.3",
"@types/node": "^7.0.0",
"bootstrap": "^3.3.7",
"chai": "^3.4.1",
"del": "^2.2.0",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"del": "^2.2.2",
"es6-shim": "^0.35.2",
"gulp": "^3.9.0",
"gulp-mocha": "^2.2.0",
"gulp-file": "^0.3.0",
"gulp-mocha": "^3.0.1",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-shell": "^0.5.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-tslint": "^6.1.2",
"gulp-typescript": "^3.0.2",
"gulp-tslint": "^7.0.1",
"gulp-typescript": "^3.1.4",
"gulp-uglify": "^2.0.0",
"gulpclass": "^0.1.1",
"mocha": "^2.3.2",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.12",
"sinon": "^1.17.2",
"mocha": "^3.2.0",
"reflect-metadata": "0.1.9",
"rxjs": "^5.0.3",
"sinon": "^1.17.7",
"sinon-chai": "^2.8.0",
"systemjs": "0.19.27",
"tslint": "^3.15.1",
"systemjs": "0.19.42",
"tslint": "^4.3.1",
"tslint-stylish": "^2.1.0-beta",
"typescript": "^2.0.3",
"zone.js": "^0.6.25"
"typescript": "^2.1.5",
"zone.js": "^0.7.6"
},
"scripts": {
"tsc": "ngc -p ."
Expand Down
4 changes: 2 additions & 2 deletions sample/sample1-simple-usage/index.html
Expand Up @@ -3,7 +3,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ng2-dropdown</title>
<title>ngx-dropdown</title>
<link rel="stylesheet" href="../../node_modules/bootstrap/dist/css/bootstrap.css">

<script src="../../node_modules/es6-shim/es6-shim.min.js"></script>
Expand All @@ -13,7 +13,7 @@

<script>
System.config({
baseURL: "/ng2-dropdown/", // replace with your baseURL here
baseURL: "/ngx-dropdown/", // replace with your baseURL here
defaultJSExtensions: true,
paths: {
// paths serve as alias
Expand Down
1 change: 1 addition & 0 deletions tsconfig-aot.json
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"outDir": "build/package",
"target": "es5",
"lib": ["es6", "dom"],
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
Expand Down
5 changes: 1 addition & 4 deletions tsconfig.json
Expand Up @@ -3,10 +3,7 @@
"compilerOptions": {
"outDir": "build/es5",
"target": "es5",
"lib": [
"es6",
"dom"
],
"lib": ["es6", "dom"],
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
Expand Down
12 changes: 0 additions & 12 deletions typings.json

This file was deleted.

0 comments on commit a26e11f

Please sign in to comment.