Skip to content

Commit

Permalink
Merge pull request #39 from VadimDez/feature/#36
Browse files Browse the repository at this point in the history
Feature/#36
  • Loading branch information
VadimDez authored Jun 22, 2017
2 parents 9f1b1b0 + 32a9e6e commit 5d8c8a6
Show file tree
Hide file tree
Showing 21 changed files with 128 additions and 85 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# compiled output
/dist
/tmp
/aot

# dependencies
/node_modules
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.0.0
* [[#36](https://github.com/VadimDez/ngx-filter-pipe/issues/36)] - Changed name tp `ngx-filter-pipe`.
* [[#38](https://github.com/VadimDez/ngx-filter-pipe/issues/38)] - Added UMD bundle.

### Breaking changes

* Module name was changed from `Ng2FilterPipeModule` to `FilterPipeModule`.
* UMD bundle for `SYSTEMJS` was added. user `/dist/bundles/ngx-filter-pipe.umd.js` instead of `/dist/index.js`.

## 0.1.10
* [[#31](https://github.com/VadimDez/ng2-filter-pipe/issues/31)] - How to filter by two variables of the same array.
* [[#4](https://github.com/VadimDez/ng2-filter-pipe/issues/4)] - Add $or operator.
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<h1 align="center">Angular2+ Filter Pipe</h1>

<p align="center">
<a href="https://www.npmjs.com/package/ng2-filter-pipe">
<img src="https://img.shields.io/npm/dm/ng2-filter-pipe.svg?style=flat" alt="downloads">
<a href="https://www.npmjs.com/package/ngx-filter-pipe">
<img src="https://img.shields.io/npm/dm/ngx-filter-pipe.svg?style=flat" alt="downloads">
</a>

<a href="https://travis-ci.org/VadimDez/ng2-filter-pipe" alt="build">
<img src="https://travis-ci.org/VadimDez/ng2-filter-pipe.svg?branch=master" height="18">
<a href="https://travis-ci.org/VadimDez/ngx-filter-pipe" alt="build">
<img src="https://travis-ci.org/VadimDez/ngx-filter-pipe.svg?branch=master" height="18">
</a>

<a href="https://badge.fury.io/js/ng2-filter-pipe">
<img src="https://badge.fury.io/js/ng2-filter-pipe.svg" alt="npm version" height="18">
<a href="https://badge.fury.io/js/ngx-filter-pipe">
<img src="https://badge.fury.io/js/ngx-filter-pipe.svg" alt="npm version" height="18">
</a>

<a href="https://david-dm.org/vadimdez/ng2-filter-pipe" title="dependencies status">
<img src="https://david-dm.org/vadimdez/ng2-filter-pipe.svg" height="18">
<a href="https://david-dm.org/vadimdez/ngx-filter-pipe" title="dependencies status">
<img src="https://david-dm.org/vadimdez/ngx-filter-pipe.svg" height="18">
</a>
</p>

Expand All @@ -28,17 +28,17 @@ Angular 2+ pipeline for filtering arrays.

### Demo Page

[https://vadimdez.github.io/ng2-filter-pipe/](https://vadimdez.github.io/ng2-filter-pipe/)
[https://vadimdez.github.io/ngx-filter-pipe/](https://vadimdez.github.io/ngx-filter-pipe/)

## Install

```
npm install ng2-filter-pipe --save
npm install ngx-filter-pipe --save
```

## Usage

In case you're using ```systemjs``` - see configuration [here](https://github.com/VadimDez/ng2-filter-pipe/blob/master/SYSTEMJS.md).
In case you're using ```systemjs``` - see configuration [here](https://github.com/VadimDez/ngx-filter-pipe/blob/master/SYSTEMJS.md).

Import `Ng2FilterPipeModule` to your module

Expand All @@ -47,7 +47,7 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app';

import { Ng2FilterPipeModule } from 'ng2-filter-pipe';
import { Ng2FilterPipeModule } from 'ngx-filter-pipe';

@NgModule({
imports: [BrowserModule, Ng2FilterPipeModule],
Expand Down
4 changes: 2 additions & 2 deletions SYSTEMJS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Append to `map`
```js
var map = {
...
'ng2-filter-pipe': 'node_modules/ng2-filter-pipe'
'ngx-filter-pipe': 'node_modules/ngx-filter-pipe'
}
```

Expand All @@ -16,6 +16,6 @@ and then add to `packages`
```js
var packages = {
...
'ng2-filter-pipe': { main: 'dist/index.js' }
'ngx-filter-pipe': { main: 'dist/bundles/ngx-filter-pipe.umd.js' }
}
````
6 changes: 3 additions & 3 deletions examples/ng-cli/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div mdl class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header mdl-layout--no-drawer-button">
<div class="mdl-layout__header-row">
<span class="mdl-layout-title">ng2-filter-pipe</span>
<span class="mdl-layout-title">ngx-filter-pipe</span>
</div>
</header>
<main class="mdl-layout__content">
Expand Down Expand Up @@ -305,9 +305,9 @@ <h5>After filtering</h5>

<footer class="mdl-mini-footer">
<div class="mdl-mini-footer__left-section">
<div class="mdl-logo">ng2-filter-pipe</div>
<div class="mdl-logo">ngx-filter-pipe</div>
<ul class="mdl-mini-footer__link-list">
<li><a href="https://github.com/VadimDez/ng2-filter-pipe">Github</a></li>
<li><a href="https://github.com/VadimDez/ngx-filter-pipe">Github</a></li>
<li><a href="https://github.com/VadimDez">Vadym Yatsyuk</a></li>
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions examples/ng-cli/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { HttpModule } from '@angular/http';

import { AppComponent } from './app.component';
// import { Ng2FilterPipeModule } from 'ng2-filter-pipe';
import { Ng2FilterPipeModule } from './shared/ng2-filter.module';
import { FilterPipeModule } from './shared/ngx-filter.module';

@NgModule({
imports: [
BrowserModule,
FormsModule,
HttpModule,
Ng2FilterPipeModule
FilterPipeModule
],
declarations: [
AppComponent,
Expand Down
12 changes: 0 additions & 12 deletions examples/ng-cli/src/app/shared/ng2-filter.module.ts

This file was deleted.

12 changes: 12 additions & 0 deletions examples/ng-cli/src/app/shared/ngx-filter.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Created by vadimdez on 28/11/2016.
*/
import { NgModule } from '@angular/core';
import { FilterPipe } from './ngx-filter.pipe';

@NgModule({
declarations: [FilterPipe],
exports: [FilterPipe]
})

export class FilterPipeModule {}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* tslint:disable:no-unused-variable */

import { Ng2FilterPipe } from './ng2-filter.pipe';
import { FilterPipe } from './ngx-filter.pipe';

describe('Pipe: Ng2FilterPipe', () => {
let pipe: Ng2FilterPipe;
describe('Pipe: FilterPipe', () => {
let pipe: FilterPipe;

beforeEach(() => {
pipe = new Ng2FilterPipe();
pipe = new FilterPipe();
});

it('create an instance', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Pipe, Injectable } from '@angular/core';
})

@Injectable()
export class Ng2FilterPipe {
export class FilterPipe {

private filterByString(filter) {
if (filter) {
Expand Down
2 changes: 1 addition & 1 deletion examples/ng-cli/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>NgCli</title>
<title>ngx-filter-pipe</title>
<base href="/">

<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Created by vadimdez on 28/11/2016.
*/
export * from './src/ng2-filter.module';
export * from './src/ng2-filter.pipe';
export * from './src/ngx-filter.module';
export * from './src/ngx-filter.pipe';
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
{
"name": "ng2-filter-pipe",
"version": "0.1.10",
"name": "ngx-filter-pipe",
"version": "1.0.0",
"author": "Vadym Yatsyuk <[email protected]>",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng server",
"typings": "typings install",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test --watch=false",
"pree2e": "webdriver-manager update",
"e2e": "protractor",
"minify": "uglifyjs ./dist/app/shared/ng2-filter.pipe.js --compress --mangle --output ./ng2-filter.pipe.min.js --source-map ./ng2-filter.pipe.min.js.map",
"build": "ngc -p tsconfig.json"
"minify": "uglifyjs ./dist/app/shared/ngx-filter.pipe.js --compress --mangle --output ./ngx-filter.pipe.min.js --source-map ./ngx-filter.pipe.min.js.map",
"build": "rimraf dist && tsc -p tsconfig-esm.json && mkdir ./dist/bundles && rollup -c rollup.config.js dist/index.js > dist/bundles/ngx-filter-pipe.umd.js && ngc -p tsconfig.json"
},
"repository": {
"type": "git",
"url": "git+https://[email protected]/VadimDez/ng2-filter-pipe.git"
"url": "git+https://[email protected]/VadimDez/ngx-filter-pipe.git"
},
"bugs": {
"url": "https://github.com/VadimDez/ng2-filter-pipe/issues"
"url": "https://github.com/VadimDez/ngx-filter-pipe/issues"
},
"homepage": "https://github.com/VadimDez/ng2-filter-pipe#readme",
"homepage": "https://github.com/VadimDez/ngx-filter-pipe#readme",
"peerDependencies": {
"@angular/core": ">=2.2.3"
},
"dependencies": {
"typings": "^2.0.0"
},
"dependencies": {},
"devDependencies": {
"@angular/common": "^4.0.1",
"@angular/compiler": "^4.0.1",
Expand All @@ -37,7 +33,6 @@
"@angular/http": "^4.0.1",
"@angular/platform-browser": "^4.0.1",
"@angular/platform-browser-dynamic": "^4.0.1",
"@types/core-js": "0.9.34",
"@types/jasmine": "^2.5.47",
"@types/node": "^6.0.51",
"@types/phantom": "3.2.1",
Expand All @@ -57,6 +52,9 @@
"material-design-lite": "^1.3.0",
"protractor": "^5.1.1",
"reflect-metadata": "^0.1.10",
"rollup": "^0.43.0",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-node-resolve": "^3.0.0",
"rxjs": "^5.2.1-smooth",
"systemjs": "^0.20.11",
"ts-node": "^3.0.2",
Expand All @@ -65,14 +63,16 @@
"uglifyjs": "^2.4.10",
"zone.js": "^0.8.5"
},
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"main": "dist/bundles/ngx-filter-pipe.umd.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"keywords": [
"angular",
"angular2",
"angular4",
"filter",
"pipe"
]
Expand Down
20 changes: 20 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Created by Vadym Yatsyuk on 22.06.17
*/
export default {
format: 'umd',
moduleName: 'ngx-filter-pipe',
external: [
'@angular/core'
],
onwarn: ( warning ) => {
const skip_codes = [
'THIS_IS_UNDEFINED',
'MISSING_GLOBAL_NAME'
];
if (skip_codes.indexOf(warning.code) !== -1) {
return;
}
console.error(warning);
}
};
12 changes: 0 additions & 12 deletions src/ng2-filter.module.ts

This file was deleted.

12 changes: 12 additions & 0 deletions src/ngx-filter.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Created by vadimdez on 28/11/2016.
*/
import { NgModule } from '@angular/core';
import { FilterPipe } from './ngx-filter.pipe';

@NgModule({
declarations: [FilterPipe],
exports: [FilterPipe]
})

export class FilterPipeModule {}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* tslint:disable:no-unused-variable */

import { Ng2FilterPipe } from './ng2-filter.pipe';
import { FilterPipe } from './ngx-filter.pipe';

describe('Pipe: Ng2FilterPipe', () => {
let pipe: Ng2FilterPipe;
describe('Pipe: FilterPipe', () => {
let pipe: FilterPipe;

beforeEach(() => {
pipe = new Ng2FilterPipe();
pipe = new FilterPipe();
});

it('create an instance', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/ng2-filter.pipe.ts → src/ngx-filter.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Pipe, Injectable } from '@angular/core';
})

@Injectable()
export class Ng2FilterPipe {
export class FilterPipe {

private filterByString(filter) {
if (filter) {
Expand Down
26 changes: 26 additions & 0 deletions tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"noImplicitAny": false,
"module": "es2015",
"target": "es5",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": true,
"sourceMap": true,
"moduleResolution": "node",
"rootDir": ".",
"outDir": "./dist/",
"lib": ["es2015", "dom"]
},
"files": [
"index.ts"
],
"exclude": [
"node_modules",
"dist",
"example",
"examples",
"typings",
"aot"
]
}
Loading

0 comments on commit 5d8c8a6

Please sign in to comment.